Downloads · 30 days
14
19% of all-time downloads
CraneAILabs/crane-medgemma-1.5-it
crane-medgemma-1.5-it is a text generation model from CraneAILabs. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
A clinical decision-support model fine-tuned from MedGemma 1.5 4B-IT on the Uganda Clinical Guidelines 2023, with Direct Preference Optimization (DPO) for improved format compliance and triage safety.
Downloads · 30 days
14
19% of all-time downloads
All-time downloads
72
Public
Parameters
4.3B
8.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.6 GB · 100%
From the Hugging Face model README
A clinical decision-support model fine-tuned from MedGemma 1.5 4B-IT on the Uganda Clinical Guidelines 2023, with Direct Preference Optimization (DPO) for improved format compliance and triage safety.
This is the primary production checkpoint — best overall performance across format compliance, triage safety, and clinical content quality. For the conservative SFT-only checkpoint, see v2.1-instruct-medgemma-bf16.
This model is a clinical thinking aid. It does not provide diagnoses, prescriptions, or automated clinical decisions.
Primary use case: Structured triage assessment for frontline health workers at Health Centre II–IV facilities in Uganda. Designed for the production Android app where compact XML output is parsed for clinical decision support at the point of care.
Output formats: XML, positional array, and prose — selected via system prompt. XML is the primary production format (~50% fewer tokens than prose, optimized for on-device latency).
Deployment target: On-device inference on Android via quantized GGUF. This bf16 checkpoint is the full-precision reference.
| Base model | google/medgemma-1.5-4b-it (Gemma 3 4B architecture) |
| Parameters | 4.3B |
| Precision | BF16 |
| Training method | QLoRA SFT + DPO (Direct Preference Optimization) |
| Training data | Decision-support Q&A pairs from UCG 2023 + format-switching instruction data + DPO preference pairs |
| Scope | Decision-support only — treatment and dosing excluded by design |
This model was trained in three stages:
Decision-support SFT: QLoRA fine-tuning on clinical Q&A pairs covering 7 categories (differential diagnosis, diagnosis, referral, investigation, danger signs, special populations, refusal). Treatment and dosing were excluded after evaluation confirmed a capacity ceiling on factual drug recall at the 4B parameter scale.
Instruction-following SFT: Continued fine-tuning from the SFT checkpoint to teach format-switching — emitting XML, array, or prose triage packets depending on the system prompt.
DPO alignment: Preference optimization using a structured taxonomy of preference pairs targeting format compliance, refusal consistency, and triage safety. DPO was stacked on the conservative SFT checkpoint (v2.1) to preserve its strong clinical reasoning baseline.
The model refuses treatment and dosing questions across all output formats. This is a deliberate safety boundary — drug name confusion at the 4B parameter scale made treatment responses unreliable.
| v2.1 (SFT-only) | This model (SFT + DPO) | |
|---|---|---|
| Training | SFT only | SFT + DPO |
| Best for | Prose Q&A, refusal compliance | XML triage packets, triage safety |
| Prose refusal | 5.00/5 (perfect) | 4.33/5 |
| XML parse rate | 98.2% | 99.4% |
| Array parse rate | 92.2% | 97.6% |
| Triage safety | 2.63/5 | 3.08/5 (best) |
| Ship gates passed | 5/12 | 6/12 |
Evaluated across three benchmarks using Gemini as an automated evaluator.
| Gate | Target | Result |
|---|---|---|
| Prose content quality (210 samples) | >= 3.43/5 | 3.41 |
| XML parse rate | >= 95% | 99.4% |
| Array parse rate | >= 95% | 97.6% |
| Prose parse rate | >= 95% | 100% |
| XML content quality (held-out) | >= 3.43/5 | 3.02 |
| Triage safety (50 presentations) | — | 3.08 (best) |
| XML refusal | >= 4.5/5 | 4.45 |
6 of 12 ship gates passed. Held-out content quality caps at ~3.0/5 — a 4B parameter capacity ceiling. RAG is expected to close this gap.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "CraneAILabs/crane-medgemma-1.5-it"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
# XML triage output
messages = [
{"role": "system", "content": "Respond in XML: <r><t>level</t><c>condition</c><cf>confidence</cf><sg>action1|action2</sg><ns>follow-up1|follow-up2</ns><rf>danger1|danger2</rf></r>"},
{"role": "user", "content": "A 28-year-old pregnant woman at 32 weeks presents with severe headache, blurred vision, and blood pressure 160/110."}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
outputs = model.generate(inputs, max_new_tokens=512, temperature=0.3)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
If you use this model, please cite:
@misc{crane-medgemma-2026,
title={Crane MedGemma 1.5 IT: Clinical Decision-Support for Uganda Clinical Guidelines},
author={Crane AI Labs},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/CraneAILabs/crane-medgemma-1.5-it}
}
This model is subject to the MedGemma Terms of Use. Additional fine-tuning artifacts are proprietary to Crane AI Labs.