Instructions to use kadirify/medlocal-lab-4b-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 kadirify/medlocal-lab-4b-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 kadirify/medlocal-lab-4b-gguf:Q8_0 # Run inference directly in the terminal: llama cli -hf kadirify/medlocal-lab-4b-gguf:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kadirify/medlocal-lab-4b-gguf:Q8_0 # Run inference directly in the terminal: llama cli -hf kadirify/medlocal-lab-4b-gguf:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf kadirify/medlocal-lab-4b-gguf:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf kadirify/medlocal-lab-4b-gguf:Q8_0
Use Docker
docker model run hf.co/kadirify/medlocal-lab-4b-gguf:Q8_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use kadirify/medlocal-lab-4b-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kadirify/medlocal-lab-4b-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": "kadirify/medlocal-lab-4b-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kadirify/medlocal-lab-4b-gguf:Q8_0
- Ollama
How to use kadirify/medlocal-lab-4b-gguf with Ollama:
ollama run hf.co/kadirify/medlocal-lab-4b-gguf:Q8_0
- Unsloth Desktop
- Pi
How to use kadirify/medlocal-lab-4b-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf kadirify/medlocal-lab-4b-gguf:Q8_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "kadirify/medlocal-lab-4b-gguf:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use kadirify/medlocal-lab-4b-gguf with Docker Model Runner:
docker model run hf.co/kadirify/medlocal-lab-4b-gguf:Q8_0
- Lemonade
How to use kadirify/medlocal-lab-4b-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kadirify/medlocal-lab-4b-gguf:Q8_0
Run and chat with the model
lemonade run user.medlocal-lab-4b-gguf-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use kadirify/medlocal-lab-4b-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 kadirify/medlocal-lab-4b-gguf:Q8_0
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 kadirify/medlocal-lab-4b-gguf:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use kadirify/medlocal-lab-4b-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf kadirify/medlocal-lab-4b-gguf:Q8_0
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 "kadirify/medlocal-lab-4b-gguf:Q8_0" \ --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"
MedLocal Lab Explainer (Q8_0 GGUF)
A fine-tuned Qwen3-4B model that summarises laboratory report results in plain language for patient communication. Designed to run locally via Ollama as part of MedLocal, a clinical support tool for physicians.
This model is a research artifact. It is not a medical device and has not been clinically validated. The clinical decision is always the physician's.
Intended use
A physician uploads a lab report PDF to MedLocal. Deterministic code reads the values, flags what is out of range, and feeds the flagged results โ along with vetted background text from an analyte catalog โ to this model. The model drafts a plain-language summary the physician can review before sharing with the patient.
The model never decides whether a value is abnormal; that is done by code. It only restates the catalog's vetted notes in plain language.
Training
| Base model | Qwen3-4B-Instruct-2507 (Apache 2.0) |
| Method | QLoRA, rank 16, alpha 16, all attention and MLP projections |
| Teacher | Qwen3-14B via Ollama |
| Dataset | 2,113 synthetic lab reports with teacher-generated summaries, half Turkish |
| Hardware | Single NVIDIA RTX 5070 (12 GB VRAM), ~80 minutes |
| Training | 393 steps (3 epochs), lr 1e-4 cosine, batch 1 x 16 gradient accumulation, bf16 |
| Quantisation | Merged adapter, converted to Q8_0 GGUF |
Data pipeline
- Synthetic reports are generated from a bilingual analyte catalog (58 analytes, English and Turkish). Calculated values (e.g. MCV from hemoglobin and hematocrit) are computed so reports are internally consistent. No real patient data is used.
- Qwen3-14B writes a plain-language summary for each report, grounded in the catalog's vetted background text.
- Every summary must pass eleven rule-based safety checks: every flagged result mentioned with the correct direction, no diagnosis, no medication advice, no health verdict, no conditions the catalog does not name, no false alarm about normal results, a referral to a doctor, plain text, sensible length.
- Reports the teacher cannot get right after five attempts are discarded.
Grounded generation
From v3 onward, the catalog's vetted background for every flagged result is included in the prompt at both training and inference time. The model restates that text rather than recalling medical knowledge from its weights. This was changed after v2 (which scored 95% on rules) produced a factually wrong statement about PDW on a real report.
Evaluation
262 held-out synthetic reports (122 English, 140 Turkish). A summary passes when it satisfies all eleven safety rules.
| Model | English | Turkish |
|---|---|---|
| Qwen3-4B, untuned | 63.9% | 20.0% |
| This model (QLoRA fine-tuned) | 89.3% | 92.1% |
These numbers measure rule compliance on synthetic data, not medical accuracy. Details, failure analysis, and what the rules miss are documented in docs/results/lab-explainer.md.
How to use
With Ollama (recommended)
ollama pull kadirify/medlocal-lab-explainer
Or, to build from the GGUF file directly:
# Modelfile
FROM ./medlocal-lab-q8_0.gguf
TEMPLATE """{{- range .Messages }}<|im_start|>{{ .Role }}
{{ .Content }}<|im_end|>
{{ end }}<|im_start|>assistant
"""
PARAMETER temperature 0
PARAMETER num_ctx 4096
PARAMETER stop <|im_end|>
ollama create medlocal-lab -f Modelfile
With the full MedLocal application
See the MedLocal repository for the complete application with PDF parsing, reference-range flagging, and a web interface.
Limitations
- Not a medical device. No output has been clinically validated.
- Rule-based checks catch unsafe patterns, not every medical inaccuracy.
- Turkish summaries occasionally contain stiff phrasing inherited from the teacher model.
- Reference ranges in the catalog are general adult values; laboratory-specific ranges always take precedence.
- The model has no vetted text for combinations of results, only individual analytes.
License
Apache 2.0, following the base model (Qwen3).
Citation
If you use this model in research, please cite the repository:
@misc{medlocal2026,
title={MedLocal: Local Clinical Support for Lab Report Review},
author={Kadir},
year={2026},
url={https://github.com/kadirify/MedLocal}
}
- Downloads last month
- 155
8-bit
Model tree for kadirify/medlocal-lab-4b-gguf
Base model
Qwen/Qwen3-4B-Instruct-2507