Instructions to use Phora68/rapha with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Phora68/rapha with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Phora68/rapha", filename="gguf/rapha-qwen25-3b-q4_k_m.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- 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
- Atomic Chat new
- 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
llm.create_chat_completion(
messages = "No input example has been defined for this model task."
)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
Model tree for Phora68/rapha
Base model
Qwen/Qwen2.5-3B
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Phora68/rapha", filename="", )