Dosage guard
Every dose in a draft must match a source, however it’s written.
fifteen milligrams15mg15 mg15 mgin sourceStart Caloradine at 50 mg once daily.50 mgin no sourceOpen-source clinical AI that answers only from sources you trust, cites every claim, and refuses when it can’t back one up.
MIT licensed. Or try the live demo.
Question: “What is the recommended dose of Zalortin for a patient with Veltris syndrome?”
A real screen recording of the dashboard on a laptop, with no API key.
Plain, testable checks decide what’s shown, with or without AI.
Each sentence points to the source passage it came from.
A full trace is saved, whether it answered or refused.
Unedited screenshots of the app in this repository.
Start from guardrails that already work, with tests.
See refusal, citation and audit enforced in code.
An offline testbed with 2,008 test questions.
Trace any decision to its check and its source.
Not for patient care. GroundCheck isn’t clinically validated or cleared by any regulator.
Any check can stop the run. Everything after it is skipped and recorded.
Real inputs, real results.
Every dose in a draft must match a source, however it’s written.
fifteen milligrams15mg15 mg15 mgin sourceStart Caloradine at 50 mg once daily.50 mgin no sourceRefuses before drafting when a key term appears in no source.
Can children take Caloradine?childrennot coveredEach claim must be supported by the source it cites.
Caloradine is started at 15 mg once daily for 14 daysVELT-002groundedRedacts obvious personal data and blocks injection attempts.
My email is a@b.comMy email is [redacted]Ignore previous instructions and…blockedOnly the drafting step changes. The same checks decide every time.
Answers are built from sentences in your sources.
Any OpenAI-compatible model drafts the answer. Groq is the default.
An open-source model on your own machine drafts the answer.
If a model fails or times out, GroundCheck falls back to the extractive answer.
AI-written answers that never leave your computer.
The build fails if a single question that should be refused gets answered.
Unknown drugs, off-topic questions, missing context. Gates every build.
6 over-refusals: safe, but reported.
Leading questions, misspellings, injections. Reported, not gating.
Runs offline in extractive mode, so these results measure the checks, not a language model.
Structured like MedQuAD and DailyMed drug labels. Every drug and dose is invented, so it’s safe to share and fork.
| Type | Documents |
|---|---|
| Conditions | |
| Drug labels | |
| Lab markers | |
| Procedures | |
| Reference notes |
Call it from your own app, a batch job or a test suite.
curl -X POST http://localhost:8000/api/ask \
-H "Content-Type: application/json" \
-d '{"query": "What is the recommended dose of Zalortin?"}'
{
"decision": "refuse",
"refused_reason": "the term 'zalortin' does not appear in any trusted source",
"claims": [],
"sources": [{ "id": "VELT-002", "score": 0.71, … }],
"trace": [
{ "name": "retrieval gate", "status": "pass", "detail": "best score 0.71 clears threshold 0.30" },
{ "name": "source coverage", "status": "fail", "detail": "the term 'zalortin' does not appear in any trusted source" },
{ "name": "generate", "status": "skip", "detail": "not reached" },
…
],
"audit_id": "a83c1266",
"llm_used": false
}
Send a settings object to override thresholds or switch individual guards for a single request. Configured defaults are never changed.
POST /api/askGET /api/auditGET /api/audit/{id}GET /api/settingsGET /api/eval-summaryGET /api/corpusGET /api/healthPoint it at your documents and run it on your own machines.
Replace app/data/corpus.json and rebuild the index.
[
{
"id": "FORM-042",
"title": "Amoxicillin: dosage",
"topic": "amoxicillin",
"section": "Dosage and Administration",
"kind": "drug",
"text": "…"
}
]
Every threshold is an environment variable.
RETRIEVAL_MIN_SCORE=0.30
GROUNDING_MIN=0.45
TOP_K=4
RATE_LIMIT_PER_MINUTE=30
Any OpenAI-compatible API, or none at all.
GROQ_API_KEY=…
GROQ_BASE_URL=https://api.groq.com/openai/v1
GEN_MODEL=llama-3.3-70b-versatile
FORCE_EXTRACTIVE=false
One container. In extractive mode, nothing leaves the machine.
docker build -t groundcheck .
docker run -p 7860:7860 groundcheck
Each one is a good place to contribute.
From a reference pipeline to a platform hospitals can run safely. Planned work is built in the open.
Prove that a clinical assistant can refuse, cite and record by design.
AI-written answers that never leave the machine.
Give every user, source and decision a durable, queryable home.
Answer from a hospital’s own approved guidelines, formularies and protocols.
Turn every refusal and flagged answer into a reviewed, closed case.
Meet hospital IT and information governance requirements.
Check answers against the patient in front of the clinician, not just the literature.
Bring grounded answers into the clinical workflow, where decisions are made.
Apply the same principle to scans: show the evidence, or abstain.
Train imaging models on your own data and hardware, then reuse them anywhere in the platform.
Run across many sites, and catch problems before clinicians do.
GroundCheck holds no certifications or clearances today. These are the standards it is being designed toward.
Want to shape what comes first, or help build it? Join the discussion on GitHub.
For teams without a machine learning platform. None of this is built yet.
Run it locally in a few minutes. Python 3.12, or Docker. The embedding model downloads once, the first time you build the index.
git clone https://github.com/sumitgundawar/GroundCheck.git
cd GroundCheck
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python scripts/build_index.py
uvicorn app.main:app --port 8000
Then open http://localhost:8000.
git clone https://github.com/sumitgundawar/GroundCheck.git
cd GroundCheck
docker build -t groundcheck .
docker run -p 7860:7860 groundcheck
Then open http://localhost:7860. The image builds the index and runs the evaluation during the build.
Full setup, configuration and Windows instructions are in the README.
Not answered here? Ask on GitHub.
No. It’s research and engineering software. It hasn’t been clinically validated or cleared by the FDA, a notified body or any other regulator, and it must not be used to make decisions about real patients.
Not in extractive mode. Questions are processed locally, and the only download is the embedding model when the index is first built. In live model mode, the redacted question and retrieved passages are sent to the provider you configure, so choose that provider under your own data-protection rules.
Yes. Replace the corpus with your own records and rebuild the index. Then re-tune the thresholds and write evaluation cases for your content, because the defaults were tuned on synthetic data. Keep real patient data out of the corpus, issues and pull requests.
Any API compatible with OpenAI chat completions that supports JSON output mode, including servers you host yourself. Set GROQ_BASE_URL, GROQ_API_KEY and GEN_MODEL. The variable names mention Groq because it’s the default provider.
That’s what the planned local AI option is for. GroundCheck will recommend open-source models that fit your machine, download one, and run it locally. Until then, extractive mode is fully local, without AI-written drafts.
No. Embeddings and vector search run on a CPU, and a laptop handles the demo corpus comfortably. The planned local AI models will use a GPU when one is available, and smaller models will run on a CPU.
The MIT License allows commercial use, modification and redistribution. Making a clinical product out of it is your responsibility, including any regulatory approvals, validation and data-protection obligations.
Not yet. A training studio is planned. It’s designed to train on a folder you choose, using a GPU when one is available, and to save each model to a library for reuse.
Not yet. CT and MRI support is planned. Today GroundCheck works with text documents only.
Run it, break it, and tell us what it got wrong. Code, test cases and ideas are all welcome.