Instructions to use abhinand/Osler-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abhinand/Osler-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="abhinand/Osler-9B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("abhinand/Osler-9B", trust_remote_code=True) model = AutoModel.from_pretrained("abhinand/Osler-9B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Osler-9B
Osler-9B (abhinand/Osler-9B) is a standalone, merged 8.39B Apache-2.0 general medical & clinical decision model ("System One" single-pass). Given any clinical state (an EHR note, discharge summary, clinical trial record, FDA drug label, or medical question) and typed questions (choice over 2–255 options, noul yes/no, or score over 2–10 ordered levels), it returns calibrated probabilities for every offered option in one prefill pass — no text generation and no external custom library required.
- #1 overall across 12 evaluated models on 5-set macro (
0.7801vs.0.7600forpplx-27B), #1 on fresh post-cutoff decisions (0.9008), #1 best calibrated on the 7-dataset External Panel (ECE 0.0229), and top-2 / best ≤10B on Medical Exams (0.7322) & External Panel (0.5927) — while beatingpplx-27Bby +9.6 pts on EHR & clinical documentation (0.8375vs.0.7411) at 2.7× lower latency (33.7 ms) and 3.1× less VRAM (17.3 GB). - Standalone merged weights: Full BF16
Qwen3_5Modelsafetensors shards (attention LoRAr=32merged) + FP32[255, 4096]option-code readout + bundledd3_runtime&d3_server.py. - Non-generative by architecture: Carries no
lm_head(Qwen3_5Model+ 255-way option-code readout); cannot generate free text. - Dev-only per-type calibration built in:
choice: 1.5274,noul: 2.3185,score: 1.7035(applied automatically byAutoModel.from_pretrained(..., trust_remote_code=True)). - Base model:
vllm-sr/d3-flash(revision67e03e1bc157961c582ee7c6a35d9b15fada3dec, Apache-2.0, built onQwen/Qwen3.5-9B). - Links: Project Page · Live Leaderboard Space · MedDecide-Bench · GitHub · Clinical Examples · Osler-4B (9.6 GB) · HF Collection
Key Capabilities & Pareto Frontier
1. Both sizes on the Efficiency–Accuracy Pareto frontier: On
Size / Latency / VRAM vs. 5-Set Macro, Osler-4B (4.55B,9.6 GB,0.7530) and Osler-9B (8.39B,17.3 GB,0.7801) define the frontier — Osler-9B strictly outperformspplx-27B(26.09B,52.9 GB,0.7600) at 3.1× less VRAM and 2.7× lower latency.2. General medical & independent external proof (not just EHR): Even with zero EHR sets, Osler-9B sits on the
Size vs. General Medical QAPareto frontier (0.7419, best ≤10B), ranks #1 on Fresh Tier-2 (0.9008), #1 of 11 on External Panel calibration (ECE 0.0229, 5× better thanpplx-27B), and #1 / #2 on independent MedNLI (0.89179B /0.89104B — both beatingpplx-27B0.8748).3. EHR mastery, 2–255 options & calibrated abstention: Both models beat
pplx-27Bon EHR & Clinical Docs (+9.6 pts9B,+8.6 pts4B), natively score 2–255 options (no 10-option cap), and reach 98.2% accuracy at 80% coverage (99.8% at 50%) on Clinical Docs via a single confidence threshold.
Quickstart — Hugging Face transformers (Zero Extra Libraries)
pip install "transformers>=5.0.0" torch safetensors accelerate pillow
# Optional fast linear-attention kernels on CUDA:
pip install flash-linear-attention
from transformers import AutoModel
model = AutoModel.from_pretrained("abhinand/Osler-9B", trust_remote_code=True)
result = model.system_one(
state=(
"68-year-old male admitted with fever 38.9C, HR 118, RR 26, BP 84/52 mmHg, "
"lactate 4.2 mmol/L, and blood cultures growing E. coli. Started on IV norepinephrine "
"and piperacillin-tazobactam in the ICU."
),
questions={
"sepsis_supported": {
"type": "noul",
"instructions": "Does the clinical documentation support a diagnosis of septic shock?",
},
"acuity": {
"type": "choice",
"instructions": "Select the highest-acuity clinical syndrome documented.",
"criteria": {
"septic_shock": "Sepsis with vasopressor-dependent hypotension and hyperlactatemia",
"uncomplicated_uti": "Lower urinary tract infection without systemic involvement",
"stable_angina": "Exertional chest pain relieved by rest",
},
},
"documentation_strength": {
"type": "score",
"instructions": "Rate the strength of clinical indicator evidence for severe sepsis.",
"criteria": ["none", "weak", "moderate", "strong", "definitive"],
},
},
)
print(result["answers"])
Example Clinical Decisions (click to expand 5 diverse real-world vignettes)
Measured directly on this merged checkpoint (one question per call, built-in dev calibration). See more examples on GitHub.
| Clinical Scenario (condensed state) | Question (type) |
Osler-9B Output |
|---|---|---|
| Negation / Ruled-out PE: Substernal burning post-flight; CTA chest showed NO PE, trop <6, resolved with lidocaine + pantoprazole. | Confirm PE? (noul) / Final dx (choice: pe, nstemi, gerd, pneumothorax) |
p(yes) = 0.043 / gerd (0.993) |
| Messy EHR distractor: Childhood asthma + mild wheeze ("cardiac asthma"), failed albuterol; EF 25%, JVP 14, BNP 2,650, Kerley B lines. | Primary driver of dyspnea? (choice: asthma, hfref_exacerbation, copd, pneumonia) / IV diuretic indicated? (noul) |
hfref_exacerbation (0.997) / p(yes) = 0.956 |
| Metabolic differential: T2DM on metformin, gastroenteritis, Cr 4.1 (base 1.5), glucose 114, lactate 10.2, ketones negative. | Metabolic emergency? (choice: dka, hhs, mala, salicylate) / Supports DKA? (noul) |
mala (0.985) / p(yes) = 0.086 |
| Abstention / Missing evidence: 1.8 cm spiculated RUL lung nodule on screening CT; PET-CT and biopsy pending, no pathology yet. | Confirmed TNM stage? (choice: stage_i, stage_iii, stage_iv, insufficient_info) |
insufficient_info (0.968) |
| Trial eligibility exclusion: Meets HFrEF inclusion (NYHA III, LVEF 30% on GDMT), but eGFR 28 (<30 exclusion) & active FOLFOX chemo. | Eligible to enroll? (noul) |
p(yes) = 0.019 |
Serving with vLLM Semantic Router & Standalone HTTP Server
Note on standard
vllm serve: Osler-9B is a noncausal full-attention single-pass decision model (Qwen3_5Model+[255, 4096]option-code readout, nolm_head). Standard autoregressivevllm serveexpects a causalForCausalLMarchitecture and does not serve noncausal System-One readout heads. Use vLLM Semantic Router Engine mode (vllm-sr) or the bundledd3_server.pyHTTP server below.
Option A — vLLM Semantic Router (vllm-sr, recommended for production throughput)
Osler-9B uses the native Decision 3.0 (d3-code-readout-v1) package layout supported directly by vLLM Semantic Router:
curl -fsSL https://vllm-sr.ai/install.sh | bash -s -- --channel dev --no-launch
export PATH="$HOME/.local/bin:$PATH"
vllm-sr serve -e abhinand/Osler-9B
Query the live endpoint:
curl -s http://localhost:8899/v1/systemone -H 'content-type: application/json' -d '{
"model": "abhinand/Osler-9B",
"state": "Serum creatinine rose from 0.9 mg/dL to 2.4 mg/dL over 36 hours with oliguria.",
"questions": {
"aki": {"type": "noul", "instructions": "Do the documented lab values meet KDIGO AKI criteria?"}
}
}'
(Note: vllm-sr uses the scalar temperature in decision_config.json (1.5274, exact for choice); for exact per-qtype noul/score temperatures over HTTP, use Option B below.)
Option B — Bundled Standalone HTTP Server (d3_server.py)
huggingface-cli download abhinand/Osler-9B --local-dir ./Osler-9B
python ./Osler-9B/d3_server.py --model ./Osler-9B --host 0.0.0.0 --port 8080
Headline Benchmark Results (12-Model Unified Evaluation, 9 Frozen Sets)
| Model | Params | panel (4,353) |
knowledge (5,456) |
confirm_general (5,988) |
mr_verdict (13,103) |
mimic_suite (4,253) |
5-Set Macro | Batch-1 p50 | Peak VRAM |
|---|---|---|---|---|---|---|---|---|---|
| Osler-9B | 8.39B | 0.5927 | 0.7322 | 0.9008 | 0.9016 | 0.7733 | 0.7801 | 33.71 ms | 17.32 GB |
pplx-27B (27B ceiling) |
26.09B | 0.6510 | 0.7823 | 0.8843 | 0.8093 | 0.6729 | 0.7600 | 90.96 ms | 52.92 GB |
| Osler-4B | 4.55B | 0.5502 | 0.6728 | 0.8883 | 0.8941 | 0.7597 | 0.7530 | 26.54 ms | 9.60 GB |
d3-flash (9B base) |
8.39B | 0.5899 | 0.7335 | 0.8774 | 0.7351 | 0.6301 | 0.7132 | 33.80 ms | 17.32 GB |
pplx-flash (4B base) |
4.54B | 0.5615 | 0.6835 | 0.8889 | 0.7466 | 0.6240 | 0.7009 | 25.51 ms | 9.58 GB |
Clef-Flash |
9.00B | 0.5711 | 0.6864 | 0.8933 | 0.6831 | 0.6306 | 0.6929 | — | — |
MedDecider-9B |
9.00B | 0.5603 | 0.6997 | 0.8825 | 0.6653 | 0.6189 | 0.6853 | — | — |
MedDecider-4B |
4.00B | 0.5436 | 0.6703 | 0.8820 | 0.6681 | 0.6019 | 0.6732 | — | — |
- Global 2-axis Pareto front (General Medical QA Avg vs. EHR & Clinical Docs Avg): Osler-9B
(0.7419, 0.8375)andpplx-27B(0.7725, 0.7411). Osler-9B is the only ≤10B model on the front, outperformspplx-27Bby +9.6 pts on EHR and clinical documentation tasks (mr_verdict+9.23,mimic_suite+10.04) while running 2.7× faster in 3.1× less VRAM, and strictly dominates every comparable ≤10B model on all five headline sets. - Calibration:
panelECE 0.0229 (raw0.1085, best of all 12 models; Brier0.5223),mr_verdictECE 0.0220 (Brier0.1421),knowledgeECE0.0441. - Selective abstention: At 80% coverage, Osler-9B reaches 98.22% accuracy on
mr_verdict(99.77%at 50%) and 82.81% onmimic_suite(90.31%at 50%). - Additional sets:
mednli_test0.8917 (#1),pairs_test0.9620 (#1),mimic_heldout0.7000.
Privacy & MIMIC PHI / Memorisation Audit (Local-Only)
- MIMIC-IV 3.1 / MIMIC-IV-Note 2.2 / MIMIC-IV-ED were processed strictly on local hardware (never sent to any hosted API), split by patient (
anchor_year_group ≥ 2014held out). Zero training data or MIMIC text is included in this repository. - Visited-member membership inference (2,000 MIMIC rows visited during training vs. 2,000 late-anchor non-members with 0 hash overlap): AUC 0.5876
[0.5703, 0.6051]vs. zero-shotd3-flashcontrol 0.5408 → Δ +0.0468 (clears pre-registered≤ 0.05rule). Y10 historical compatibility AUC: 0.5018. - Verbatim extraction: Structurally not applicable — Osler-9B carries no
lm_headand cannot generate text.
Honest Limitations
- OOD QA parity vs. base / ceiling vs. 27B: Ties (does not beat)
d3-flashonpanel(+0.0028 [-0.0069, +0.0129]) andknowledge(-0.0013 [-0.0090, +0.0062]), and trailspplx-27Bon hard multi-step medical QA (MedXpertQA,MMLU-Pro Health). - Held-out template failure (
READOUT_FAIL): Onmr_heldout_test / synthea_indicator_evidence_v1(n=514, excluded from training), Osler-9B falls below chance (0.356,READOUT_FAIL) while its base passes (0.459). - Fresh-distribution calibration shift: Dev-fitted temperatures leave the model under-confident on fresh
confirm_general(mean confidence0.814vs. accuracy0.901, ECE0.090). Recalibrate on a small target-domain dev split when deploying under strong distribution shift. - Not for unsupervised clinical decisions: Research model outputs must be reviewed by qualified clinicians.
- Downloads last month
- 53