Downloads · 30 days
46
21% of all-time downloads
zhpy2004/coglang-drug-distill
coglang-drug-distill is a text generation model from zhpy2004. Use it when you need the model to write or continue text. It is set up for gguf. The card lists the license as apache-2.0.
A CogLang-specialist small model for on-device inference. It translates natural-language medication-safety questions into CogLang — a graph-first intermediate language — which is then executed against a curated drug-i…
Downloads · 30 days
46
21% of all-time downloads
All-time downloads
215
Public
Repo size
2 GB
Likes
1
Public
Click a slice to open those files.
.gguf2 GB · 100%
From the Hugging Face model README
A CogLang-specialist small model for on-device inference. It translates natural-language medication-safety questions into CogLang — a graph-first intermediate language — which is then executed against a curated drug-interaction graph.
The model only writes graph queries; it never answers drug questions from memory. Pharma facts live in the graph, not the weights.
⚠️ Medical disclaimer. Learning/research demo only. Not a medical device, not clinical decision support. The accompanying graph is a tiny illustrative seed, not authoritative. Never use any output for real medical decisions.
| File | Description |
|---|---|
drug-v6-q4_k_m.gguf | Recommended. Latest model — verb→operator routing rules baked into weights + weak-operator training data. |
drug-v5-q4_k_m.gguf | Previous version (kept for reproducibility). |
Q4_K_M quantize| Eval surface | Config | drug-v5 | drug-v6 |
|---|---|---|---|
| Curated OOD set (10) | Q4 + GBNF + SYSTEM_v6d | 80% (8/10) | 100% (10/10) |
| Wild prompts, executed end-to-end (19) | + few-shot ICL | ~68% (13/19) | ~84% (16/19) |
| parse / validate / hallucinated | — | 100% / 100% / 0 | 100% / 100% / 0 |
drug-v6 bakes the SYSTEM_v6d verb→operator rules into the weights and adds targeted training data for the operators v5 still missed (Traverse-as-"causes", ForEach, Trace[...] wrapping, Do[...] pairing). This cured those routing errors — OOD is now saturated at 100%. The remaining ~3 wild misses are structural limits of single-shot CogLang (multi-relation union, reverse traversal), not routing.
Pairing the model with the CogLang GBNF grammar guarantees 100% parseable output, so the model only has to learn semantics, not syntax.
# get the CogLang GBNF grammar from the upstream repo:
# https://github.com/jaysinailabs/coglang -> examples/grammar/coglang.gbnf
llama-cli -m drug-v6-q4_k_m.gguf \
-st \
-sys "$(cat SYSTEM_v6d.txt)" \
-p "warfarin interactions" \
--grammar-file coglang.gbnf \
-n 256 --temp 0 -t 8
# -> Traverse["warfarin", "interacts_with"]
The tuned system prompt (SYSTEM_v6d.txt) and few-shot blocks live in the GitHub repo. An interactive CLI (pipeline/drug_chat.py) and a modular local web app (app/, runnable on desktop and in Termux on a phone) wire NL → CogLang → execution against the seed graph.
Apache-2.0. Built on and depends on CogLang (Jason Xin / Bigcoders, Apache-2.0), which is not redistributed here.