Instructions to use jamezoon/qwen3-5-9b-medmcqa-gguf 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 jamezoon/qwen3-5-9b-medmcqa-gguf 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 jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf jamezoon/qwen3-5-9b-medmcqa-gguf: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 jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf jamezoon/qwen3-5-9b-medmcqa-gguf: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 jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
Use Docker
docker model run hf.co/jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use jamezoon/qwen3-5-9b-medmcqa-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jamezoon/qwen3-5-9b-medmcqa-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jamezoon/qwen3-5-9b-medmcqa-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
- Ollama
How to use jamezoon/qwen3-5-9b-medmcqa-gguf with Ollama:
ollama run hf.co/jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
- Unsloth Studio
How to use jamezoon/qwen3-5-9b-medmcqa-gguf 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 jamezoon/qwen3-5-9b-medmcqa-gguf 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 jamezoon/qwen3-5-9b-medmcqa-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for jamezoon/qwen3-5-9b-medmcqa-gguf to start chatting
- Pi
How to use jamezoon/qwen3-5-9b-medmcqa-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use jamezoon/qwen3-5-9b-medmcqa-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use jamezoon/qwen3-5-9b-medmcqa-gguf with Docker Model Runner:
docker model run hf.co/jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
- Lemonade
How to use jamezoon/qwen3-5-9b-medmcqa-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
Run and chat with the model
lemonade run user.qwen3-5-9b-medmcqa-gguf-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use jamezoon/qwen3-5-9b-medmcqa-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default jamezoon/qwen3-5-9b-medmcqa-gguf:Q4_K_M
Run Hermes
hermes
- Atomic Chat
Qwen3.5-9B MedMCQA — GGUF Q4_K_M
A Q4_K_M GGUF quantization of Qwen/Qwen3.5-9B fine-tuned on the MedMCQA dataset — 182K medical multiple-choice questions covering 21 subjects from Indian medical entrance exams (AIIMS/PG style).
The LoRA adapter (jamezoon/qwen3-5-9b-medmcqa-lora) was fully merged into the base weights before quantization. This file is ready for offline inference — no Python ML stack required.
Developed by: James Oon (@jamezoon), SUTD MSTR-DAIE Deep Learning Project
Files
| File | Size | Format | Use with |
|---|---|---|---|
lora-9b-medmcqa-q4_k_m.gguf |
5.2 GB | GGUF Q4_K_M | llama.cpp, Ollama, LM Studio, Jan |
tokenizer.json |
19 MB | JSON | Reference tokenizer |
tokenizer_config.json |
1.1 KB | JSON | Tokenizer config |
Quick Start
llama.cpp
# Download
huggingface-cli download jamezoon/qwen3-5-9b-medmcqa-gguf \
lora-9b-medmcqa-q4_k_m.gguf --local-dir ./
# Run (GPU offload — adjust -ngl to match your VRAM)
./llama-cli -m lora-9b-medmcqa-q4_k_m.gguf \
--ctx-size 2048 -n 256 -ngl 99 \
-p "Question: A 45-year-old male presents with sudden-onset chest pain radiating to the left arm. Which enzyme is most useful in diagnosing myocardial infarction at 6 hours?\nOptions: A. LDH B. CK-MB C. Troponin I D. AST\nExplanation:"
Ollama
# Create Modelfile
cat > Modelfile << 'EOF'
FROM ./lora-9b-medmcqa-q4_k_m.gguf
SYSTEM "You are a helpful medical tutor for pre-med students preparing for AIIMS/PG entrance exams. For each question, think step by step, then provide the answer in the format:\nExplanation: ...\nAnswer: <A, B, C, or D>"
EOF
ollama create medmcqa-9b -f Modelfile
ollama run medmcqa-9b
LM Studio
Download the .gguf file and load it directly. Recommended settings:
- Context length: 2048
- GPU layers: max available
- Temperature: 0.1 (for deterministic answers)
Python (llama-cpp-python)
from llama_cpp import Llama
llm = Llama(
model_path="lora-9b-medmcqa-q4_k_m.gguf",
n_ctx=2048,
n_gpu_layers=-1, # -1 = all layers on GPU; set 0 for CPU-only
verbose=False,
)
prompt = (
"<|im_start|>system\n"
"You are a helpful tutor for pre-med students preparing for medical entrance exams.\n"
"<|im_end|>\n"
"<|im_start|>user\n"
"Question: Which nerve is damaged in wrist drop?\n"
"Options: A. Radial B. Ulnar C. Median D. Musculocutaneous\n"
"Think step by step. Then respond in the format:\nExplanation: ...\nAnswer: <one of A, B, C, D>\n"
"<|im_end|>\n"
"<|im_start|>assistant\n"
)
response = llm(prompt, max_tokens=256, stop=["<|im_end|>"])
print(response["choices"][0]["text"])
Memory Requirements
| Precision | File Size | Min VRAM / RAM |
|---|---|---|
| BF16 (original) | ~18 GB | ~20 GB |
| Q4_K_M (this file) | 5.2 GB | ~6–7 GB |
Runs comfortably on a 8 GB consumer GPU (RTX 3070/4060), Apple M-series with 8 GB unified memory, or CPU-only (slower).
Training Details
Base Model
- Qwen/Qwen3.5-9B — 9B parameters, BF16, hybrid GatedDeltaNet architecture (interleaved linear + softmax attention)
Dataset
- MedMCQA — 182,822 training samples, 4,183 validation samples
- 21 medical subjects: Anatomy, Physiology, Biochemistry, Pathology, Pharmacology, Microbiology, Medicine, Surgery, Paediatrics, Gynaecology, Dental, ENT, Ophthalmology, Skin, Psychiatry, Forensic Medicine, Radiology, Orthopaedics, Anaesthesia, and more
LoRA Configuration
| Parameter | Value |
|---|---|
| Rank (r) | 16 |
| Alpha (α) | 32 |
| Dropout | 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj, out_proj |
| Trainable parameters | 7,077,888 (0.079% of 9B) |
Training Hyperparameters
| Hyperparameter | Value |
|---|---|
| Training steps | 1,000 |
| Per-device batch size | 4 |
| Gradient accumulation | 4 (effective batch = 16) |
| Learning rate | 2e-4 (cosine decay) |
| Warmup steps | 100 |
| Max sequence length | 512 tokens |
| Precision | BF16 |
Hardware
- NVIDIA GB10 Grace Blackwell (DGX Spark), 121 GB unified memory
- Training duration: ~50 minutes (1,000 steps at ~3s/step)
Validation Metrics (Dev Set, 4,183 samples)
| Checkpoint | Eval Loss | Token Accuracy |
|---|---|---|
| Step 200 | 0.9800 | 78.5% |
| Step 600 | 0.9730 | 78.8% |
| Best (saved) | 0.9669 | 78.7% |
Quantization
- Method: Q4_K_M via llama.cpp
- F16 GGUF intermediate → Q4_K_M final (intermediate deleted)
- Quantized on DGX Spark (CPU-only quantization, no CUDA required)
Prompt Format
This model uses the Qwen3.5 chat template (ChatML). Use it as shown above.
<|im_start|>system
You are a helpful tutor for pre-med students preparing for medical entrance exams.
<|im_end|>
<|im_start|>user
Question: {question}
Options: A. {opa} B. {opb} C. {opc} D. {opd}
Think step by step. Then respond in the format:
Explanation: ...
Answer: <one of A, B, C, D>
<|im_end|>
<|im_start|>assistant
See Also
- LoRA adapter (PEFT, not merged): jamezoon/qwen3-5-9b-medmcqa-lora
- 14B version (higher accuracy): jamezoon/qwen3-14b-medmcqa-gguf
Citation
If you use this model, please cite the MedMCQA dataset:
@inproceedings{pmlr-v174-pal22a,
title = {MedMCQA: A Large-scale Multi-Subject Multi-Choice Dataset for Medical domain Question Answering},
author = {Pal, Ankit and Umapathi, Logesh Kumar and Sankarasubbu, Malaikannan},
booktitle = {Proceedings of the Conference on Health, Inference, and Learning},
year = {2022},
publisher = {PMLR}
}
Disclaimer
This model is intended for research and educational purposes only. Do not use it for real clinical decision-making. Medical decisions must be made by qualified healthcare professionals.
- Downloads last month
- 30
4-bit