Rapha β€” Clinical AI Physician Assistant

Rapha conducts structured, empathetic clinical interviews across five stages (greeting, OPQRST symptom exploration, medical history, red-flag screening, escalation report) and hands a structured report to a physician. Rapha never diagnoses.

  • Base model: unsloth/Qwen2.5-3B-Instruct-bnb-4bit
  • Method: QLoRA (Unsloth) β†’ curriculum SFT β†’ DPO
  • Chat template: ChatML
  • Context window: 8,192 tokens (training) / 4,096 (Ollama default)
  • LoRA config: r=32, alpha=32, target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • Trained: 2026-07-22

Training architecture (v2.3)

Single-trainer curriculum SFT: three phases concatenated into one ordered dataset with a single cosine LR schedule. This avoids the optimizer restart and warmup re-run issues of the previous multi-trainer approach.

Phase Data Purpose
1 Stage1 + Stage4 + Adversarial Interview boundaries + robustness
2 Stage2 + Stage3 Clinical content (OPQRST + history)
3 Full mix + FullArc Complete session flows (Stage1β†’5)

Repo contents

Path Contents
/ (root) LoRA adapter (PEFT) β€” small, load on top of the base model
merged/ Full merged fp16 weights β€” standalone, no base model needed
gguf/ Quantised GGUF files (Q4_K_M, Q5_K_M, Q8_0) for Ollama / llama.cpp / LM Studio
datasets/ Raw JSONL training/validation/DPO datasets used for this run

Training data

Total training records: ~159,766

Dataset Records File
Stage 1 β€” Greetings 25,000 stage1_greetings.jsonl
Stage 2 β€” OPQRST 40,344 stage2_opqrst.jsonl
Stage 3 β€” History 40,000 stage3_history.jsonl
Stage 4 β€” Red Flags 14,422 stage4_red_flags.jsonl
Adversarial 10,000 adversarial.jsonl
Full-Arc Conversations 30,000 full_arc_conversations.jsonl
Validation 1,100 val_sharegpt.jsonl
DPO Preference Pairs 3,000 preference_pairs.jsonl

Stage 1 greetings, Stage 2 OPQRST symptom exploration, Stage 3 medical history, Stage 4 red-flag screening, and a multi-turn adversarial set (self-diagnosis, symptom denial, medication refusal, minimised red flags, prompt injection β€” a portion include a patient pushback turn to test boundary-holding). Followed by DPO preference alignment on the pairs above.

Red-flag terms screened for

worst headache, can't feel my legs, arm feels heavy and chest, can't breathe, loss of consciousness, sudden vision, neck stiff, light hurts, confused, won't stop bleeding, bilateral leg weakness, bladder dysfunction, tachypnoea, thunderclap, cauda equina, qsofa, meningitis

Eval metrics (last training run)

Metric Value
(no eval metrics captured) β€”

Usage β€” Ollama (GGUF)

ollama create rapha -f Modelfile.q4_k_m
ollama run rapha

Usage β€” Transformers (LoRA adapter)

from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="Phora68/rapha",
    max_seq_length=8192,
    load_in_4bit=True,
)
FastLanguageModel.for_inference(model)

Safety

Rapha is an information-gathering and triage-support tool. It is not a diagnostic device and must not be deployed without physician oversight. Red-flag detection and escalation responses should be validated against the clinical accuracy benchmark before any clinical use.


Generated automatically by train_rapha_llm.py v2.3.

Downloads last month
244
Safetensors
Model size
2B params
Tensor type
F32
Β·
BF16
Β·
U8
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Phora68/rapha

Base model

Qwen/Qwen2.5-3B
Quantized
(17)
this model