Safetensors
GGUF
English
qwen2
clinical
medical
healthcare
qlora
unsloth
chatml
rapha
8-bit precision
conversational
Instructions to use Phora68/rapha with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Phora68/rapha with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Phora68/rapha:Q4_K_M # Run inference directly in the terminal: llama cli -hf Phora68/rapha:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Phora68/rapha:Q4_K_M # Run inference directly in the terminal: llama cli -hf Phora68/rapha:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Phora68/rapha:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Phora68/rapha:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Phora68/rapha:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Phora68/rapha:Q4_K_M
Use Docker
docker model run hf.co/Phora68/rapha:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use Phora68/rapha with Ollama:
ollama run hf.co/Phora68/rapha:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Phora68/rapha with Docker Model Runner:
docker model run hf.co/Phora68/rapha:Q4_K_M
- Lemonade
How to use Phora68/rapha with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Phora68/rapha:Q4_K_M
Run and chat with the model
lemonade run user.rapha-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Update model card
Browse files
README.md
CHANGED
|
@@ -1,19 +1,110 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
-
-
|
| 4 |
-
-
|
| 5 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
---
|
| 7 |
|
| 8 |
-
#
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
**
|
| 13 |
-
-
|
| 14 |
-
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
##
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: other
|
| 3 |
+
base_model: unsloth/Qwen2.5-3B-Instruct-bnb-4bit
|
| 4 |
tags:
|
| 5 |
+
- clinical
|
| 6 |
+
- medical
|
| 7 |
+
- healthcare
|
| 8 |
+
- qlora
|
| 9 |
+
- unsloth
|
| 10 |
+
- chatml
|
| 11 |
+
- rapha
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# Rapha β Clinical AI Physician Assistant
|
| 17 |
|
| 18 |
+
Rapha conducts structured, empathetic clinical interviews across five stages
|
| 19 |
+
(greeting, OPQRST symptom exploration, medical history, red-flag screening,
|
| 20 |
+
escalation report) and hands a structured report to a physician. **Rapha
|
| 21 |
+
never diagnoses.**
|
| 22 |
|
| 23 |
+
- **Base model:** `unsloth/Qwen2.5-3B-Instruct-bnb-4bit`
|
| 24 |
+
- **Method:** QLoRA (Unsloth) β curriculum SFT β DPO
|
| 25 |
+
- **Chat template:** ChatML
|
| 26 |
+
- **Context window:** 8,192 tokens (training) / 4,096 (Ollama default)
|
| 27 |
+
- **LoRA config:** r=32, alpha=32, target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 28 |
+
- **Trained:** 2026-07-22
|
| 29 |
|
| 30 |
+
## Training architecture (v2.3)
|
| 31 |
+
|
| 32 |
+
Single-trainer curriculum SFT: three phases concatenated into one ordered
|
| 33 |
+
dataset with a single cosine LR schedule. This avoids the optimizer restart
|
| 34 |
+
and warmup re-run issues of the previous multi-trainer approach.
|
| 35 |
+
|
| 36 |
+
| Phase | Data | Purpose |
|
| 37 |
+
|---|---|---|
|
| 38 |
+
| 1 | Stage1 + Stage4 + Adversarial | Interview boundaries + robustness |
|
| 39 |
+
| 2 | Stage2 + Stage3 | Clinical content (OPQRST + history) |
|
| 40 |
+
| 3 | Full mix + FullArc | Complete session flows (Stage1β5) |
|
| 41 |
+
|
| 42 |
+
## Repo contents
|
| 43 |
+
|
| 44 |
+
| Path | Contents |
|
| 45 |
+
|---|---|
|
| 46 |
+
| `/` (root) | LoRA adapter (PEFT) β small, load on top of the base model |
|
| 47 |
+
| `merged/` | Full merged fp16 weights β standalone, no base model needed |
|
| 48 |
+
| `gguf/` | Quantised GGUF files (Q4_K_M, Q5_K_M, Q8_0) for Ollama / llama.cpp / LM Studio |
|
| 49 |
+
| `datasets/` | Raw JSONL training/validation/DPO datasets used for this run |
|
| 50 |
+
|
| 51 |
+
## Training data
|
| 52 |
+
|
| 53 |
+
**Total training records: ~159,766**
|
| 54 |
+
|
| 55 |
+
| Dataset | Records | File |
|
| 56 |
+
|---|---|---|
|
| 57 |
+
| Stage 1 β Greetings | 25,000 | `stage1_greetings.jsonl` |
|
| 58 |
+
| Stage 2 β OPQRST | 40,344 | `stage2_opqrst.jsonl` |
|
| 59 |
+
| Stage 3 β History | 40,000 | `stage3_history.jsonl` |
|
| 60 |
+
| Stage 4 β Red Flags | 14,422 | `stage4_red_flags.jsonl` |
|
| 61 |
+
| Adversarial | 10,000 | `adversarial.jsonl` |
|
| 62 |
+
| Full-Arc Conversations | 30,000 | `full_arc_conversations.jsonl` |
|
| 63 |
+
| Validation | 1,100 | `val_sharegpt.jsonl` |
|
| 64 |
+
| DPO Preference Pairs | 3,000 | `preference_pairs.jsonl` |
|
| 65 |
+
|
| 66 |
+
Stage 1 greetings, Stage 2 OPQRST symptom exploration, Stage 3 medical
|
| 67 |
+
history, Stage 4 red-flag screening, and a multi-turn adversarial set
|
| 68 |
+
(self-diagnosis, symptom denial, medication refusal, minimised red flags,
|
| 69 |
+
prompt injection β a portion include a patient pushback turn to test
|
| 70 |
+
boundary-holding). Followed by DPO preference alignment on the pairs above.
|
| 71 |
+
|
| 72 |
+
### Red-flag terms screened for
|
| 73 |
+
|
| 74 |
+
`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`
|
| 75 |
+
|
| 76 |
+
## Eval metrics (last training run)
|
| 77 |
+
|
| 78 |
+
| Metric | Value |
|
| 79 |
+
|---|---|
|
| 80 |
+
| _(no eval metrics captured)_ | β |
|
| 81 |
+
|
| 82 |
+
## Usage β Ollama (GGUF)
|
| 83 |
+
|
| 84 |
+
```bash
|
| 85 |
+
ollama create rapha -f Modelfile.q4_k_m
|
| 86 |
+
ollama run rapha
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Usage β Transformers (LoRA adapter)
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
from unsloth import FastLanguageModel
|
| 93 |
+
|
| 94 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 95 |
+
model_name="Phora68/rapha",
|
| 96 |
+
max_seq_length=8192,
|
| 97 |
+
load_in_4bit=True,
|
| 98 |
+
)
|
| 99 |
+
FastLanguageModel.for_inference(model)
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
## Safety
|
| 103 |
+
|
| 104 |
+
Rapha is an information-gathering and triage-support tool. It is **not**
|
| 105 |
+
a diagnostic device and must not be deployed without physician oversight.
|
| 106 |
+
Red-flag detection and escalation responses should be validated against
|
| 107 |
+
the clinical accuracy benchmark before any clinical use.
|
| 108 |
+
|
| 109 |
+
---
|
| 110 |
+
*Generated automatically by `train_rapha_llm.py` v2.3.*
|