CoolFace
Modelpublic

kayodekosi/medical-clinical-decision-support-7b

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes
Model Card

kayodekosi/medical-clinical-decision-support-7b

Production-oriented Clinical Decision Support (CDS) assistant Symptom / history → differential diagnosis, urgency triage, and guideline-aware recommendations with strong refusal & escalation behaviour.

Brief description: given a patient case, produces urgency triage, a ranked differential diagnosis, recommended next steps, and explicit red-flag/escalation notes, refusing a definitive read when the input is insufficient. A ready-to-deploy Gradio demo lives in `space/` — see the Deploying the demo Space section below.

Intended Hospital Use-Case

  • —Assist clinicians with rapid differential generation and triage urgency scoring.
  • —Surface relevant guideline snippets (when provided in context) and recommended next investigations.
  • —Explicitly refuse or escalate when information is insufficient or the case is high-risk.
  • —Always framed as decision support — never autonomous diagnosis or treatment.

Model Details

ItemValue
BaseQwen/Qwen2.5-7B-Instruct
MethodQLoRA SFT (Unsloth, with automatic fallback to plain PEFT + TRL) + optional DPO on clinician preference / safety pairs
Adapter typeLoRA (PEFT) — load on top of the base model
DataPublic medical QA + symptom→diagnosis + triage style corpora, chat-format pairs
Safety featuresRefusal on incomplete data, escalation phrases, no treatment orders without human confirmation

Training Recipe

bash
pip install -r requirements-train.txt
python train.py --config train_config.yaml
python train.py --config train_config.yaml --push_to_hub --hub_repo_id kayodekosi/medical-clinical-decision-support-7b

See `train_config.yaml` and `train.py` for the exact recipe.

Quickstart Inference

bash
pip install -r requirements.txt
python inference.py --case sample_data/example_case.txt

This pulls the base model plus the fine-tuned LoRA adapter from the Hub by default. Point --adapter at a local checkpoint directory to test a fresh training run, or pass --adapter none for base-model-only output.

Output Structure (example)

Urgency: Immediate / Urgent / Routine / Insufficient information
Differential (ranked):
1. ... (likelihood, key supporting features)
2. ...
Recommended next steps: ...
Escalation / Red flags: ...
Disclaimer: This is decision support only. Licensed clinician must confirm.

HF Path

kayodekosi/medical-clinical-decision-support-7b

Safety Statement

This model is not a medical device and must not be used for autonomous diagnosis or treatment decisions. It is intended for use by licensed healthcare professionals as an assistive tool inside a controlled hospital environment with full human oversight.

Deploying the demo Space

`space/` is a complete, self-contained Gradio Space (app.py, requirements.txt, README.md with the Space metadata front matter). Deploy it with the portfolio-level script:

bash
pip install -r ../../scripts/requirements.txt
huggingface-cli login
python ../../scripts/deploy_spaces.py --only clinical-decision-support

This creates kayodekosi/medical-clinical-decision-support-demo if it doesn't exist and uploads the whole space/ folder — nothing to copy by hand.

Repository Layout

03-clinical-decision-support/
├── README.md                # this file / HF model card
├── train_config.yaml
├── train.py
├── inference.py
├── requirements.txt
├── requirements-train.txt
├── requirements-serving.txt
├── sample_data/example_case.txt
└── space/                    # Gradio demo Space (app.py + requirements.txt + README.md)

Author: Kayode Okosi — kayodeokosi@gmail.com © 2026