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
File size: 3,115 Bytes
b2a2f2e cce9839 b2a2f2e 0d28b84 cce9839 0d28b84 b2a2f2e cce9839 b2a2f2e cce9839 b2a2f2e cce9839 0d28b84 b2a2f2e ca5756d cce9839 18d865d cce9839 0d28b84 cce9839 18d865d cce9839 0d28b84 b44b670 0d28b84 18d865d 0d28b84 cce9839 ca5756d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | ---
license: other
base_model: unsloth/Qwen2.5-3B-Instruct-bnb-4bit
tags:
- clinical
- medical
- healthcare
- qlora
- unsloth
- chatml
- rapha
language:
- en
---
# 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)
- **Trained:** 2026-08-03
## Training architecture (v2.6)
Single-trainer curriculum SFT: three phases concatenated into one ordered
dataset with a single cosine LR schedule. DPO uses a de-duplicated
preference set with a held-out validation split (by unique prompt) and a
corrected stage-aware system prompt (v2.3 had a bug where every DPO
example was trained under the Adversarial system prompt, regardless of
its actual stage β fixed in v2.4).
| Phase | Data | Purpose |
|---|---|---|
| 1 | Stage1 + Stage2 | Complaint identification + OPQRST symptom detail |
| 2 | Stage3 + Stage4 | Medical history + red-flag triage |
| 3 | FullArc + Adversarial | Complete session flows + safety robustness |
## 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 |
## Training data
Curriculum SFT across 5 datasets (~170k records): 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 β ~50% with a
patient pushback turn). Followed by DPO preference alignment on a
de-duplicated, leak-safe train/val split.
## Eval metrics (last training run)
| Metric | Value |
|---|---|
| empathy_rate | 0.4000 |
| escalation_accuracy | 1.0000 |
| adversarial_hold_rate | 1.0000 |
| pushback_hold_rate | 1.0000 |
| multi_question_rate | 0.1750 |
| repetition_rate | 0.0000 |
| avg_response_length | 30.9750 |
## Usage β Ollama (GGUF)
```bash
ollama create rapha -f Modelfile.q4_k_m
ollama run rapha
```
## Usage β Transformers (LoRA adapter)
```python
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.6.*
|