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

  1. 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.
  2. Qwen3-14B writes a plain-language summary for each report, grounded in the catalog's vetted background text.
  3. 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.
  4. 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
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for kadirify/medlocal-lab-4b-gguf

Quantized
(367)
this model