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
- LM Studio
- Jan
- Ollama
How to use Phora68/rapha with Ollama:
ollama run hf.co/Phora68/rapha:Q4_K_M
- Unsloth Studio
How to use Phora68/rapha with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Phora68/rapha to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Phora68/rapha to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Phora68/rapha to start chatting
- 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
|
@@ -2,15 +2,15 @@
|
|
| 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
|
|
@@ -24,14 +24,16 @@ never diagnoses.**
|
|
| 24 |
- **Method:** QLoRA (Unsloth) β curriculum SFT β DPO
|
| 25 |
- **Chat template:** ChatML
|
| 26 |
- **Context window:** 8,192 tokens (training) / 4,096 (Ollama default)
|
| 27 |
-
- **
|
| 28 |
-
- **Trained:** 2026-07-22
|
| 29 |
|
| 30 |
-
## Training architecture (v2.
|
| 31 |
|
| 32 |
Single-trainer curriculum SFT: three phases concatenated into one ordered
|
| 33 |
-
dataset with a single cosine LR schedule.
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
| Phase | Data | Purpose |
|
| 37 |
|---|---|---|
|
|
@@ -46,38 +48,27 @@ and warmup re-run issues of the previous multi-trainer approach.
|
|
| 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 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
## Usage β Ollama (GGUF)
|
| 83 |
|
|
@@ -107,4 +98,4 @@ 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.
|
|
|
|
| 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
|
|
|
|
| 24 |
- **Method:** QLoRA (Unsloth) β curriculum SFT β DPO
|
| 25 |
- **Chat template:** ChatML
|
| 26 |
- **Context window:** 8,192 tokens (training) / 4,096 (Ollama default)
|
| 27 |
+
- **Trained:** 2026-07-30
|
|
|
|
| 28 |
|
| 29 |
+
## Training architecture (v2.5)
|
| 30 |
|
| 31 |
Single-trainer curriculum SFT: three phases concatenated into one ordered
|
| 32 |
+
dataset with a single cosine LR schedule. DPO uses a de-duplicated
|
| 33 |
+
preference set with a held-out validation split (by unique prompt) and a
|
| 34 |
+
corrected stage-aware system prompt (v2.3 had a bug where every DPO
|
| 35 |
+
example was trained under the Adversarial system prompt, regardless of
|
| 36 |
+
its actual stage β fixed in v2.4).
|
| 37 |
|
| 38 |
| Phase | Data | Purpose |
|
| 39 |
|---|---|---|
|
|
|
|
| 48 |
| `/` (root) | LoRA adapter (PEFT) β small, load on top of the base model |
|
| 49 |
| `merged/` | Full merged fp16 weights β standalone, no base model needed |
|
| 50 |
| `gguf/` | Quantised GGUF files (Q4_K_M, Q5_K_M, Q8_0) for Ollama / llama.cpp / LM Studio |
|
|
|
|
| 51 |
|
| 52 |
## Training data
|
| 53 |
|
| 54 |
+
Curriculum SFT across 5 datasets (~170k records): Stage 1 greetings, Stage 2
|
| 55 |
+
OPQRST symptom exploration, Stage 3 medical history, Stage 4 red-flag
|
| 56 |
+
screening, and a multi-turn adversarial set (self-diagnosis, symptom denial,
|
| 57 |
+
medication refusal, minimised red flags, prompt injection β ~50% with a
|
| 58 |
+
patient pushback turn). Followed by DPO preference alignment on a
|
| 59 |
+
de-duplicated, leak-safe train/val split.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
## Eval metrics (last training run)
|
| 62 |
|
| 63 |
| Metric | Value |
|
| 64 |
|---|---|
|
| 65 |
+
| empathy_rate | 0.2500 |
|
| 66 |
+
| escalation_accuracy | 0.0000 |
|
| 67 |
+
| adversarial_hold_rate | 1.0000 |
|
| 68 |
+
| pushback_hold_rate | 1.0000 |
|
| 69 |
+
| multi_question_rate | 0.0250 |
|
| 70 |
+
| repetition_rate | 0.0000 |
|
| 71 |
+
| avg_response_length | 36.2000 |
|
| 72 |
|
| 73 |
## Usage β Ollama (GGUF)
|
| 74 |
|
|
|
|
| 98 |
the clinical accuracy benchmark before any clinical use.
|
| 99 |
|
| 100 |
---
|
| 101 |
+
*Generated automatically by `train_rapha_llm.py` v2.5.*
|