Dilr Mira reads clinical documents on your own hardware
Dilr Mira is the family of small, private language models from DILR.ai for clinical document extraction. The current release, Mira-Q2, reads a lab report or discharge summary on hardware you control and returns ten schema-valid JSON fields. In its published evaluation it was 100% valid on 200 held-out documents and 85.8% on 282 real physician notes.
Updated October 2026. Figures checked against the model card on 26 October 2026.

- 120 MB adapterQLoRA, on Qwen2.5-3B-Instruct
- 782 documents evaluatedFour published test sets
- 0 identifier leaksAcross all 782 documents
- Runs on your hardwareOn-premise or air-gapped
- English onlyTen required output fields
- Draft for human reviewNever an autonomous clinical decision
What is Dilr Mira?
Dilr Mira turns clinical documents into structured data without sending them anywhere.
It is a small model you run yourself. It reads a clinical document and returns the same ten fields every time.
How accurate is Mira-Q2?
Mira-Q2 is 100% valid on held-out data and 85.8% on real physician notes
JSON validity on four test sets, with 95% intervals. The drop on real documents is published on the model card rather than hidden.
- test_goldHeld-out, same distribution as training, 200 documents100.0%95% CI 100 to 100
- synthetic_v2A different formatting dialect, 150 documents100.0%95% CI 100 to 100
- extraction_relevantReal physician documents, on-schema, 150 documents94.7%95% CI 90.7 to 98.0
- mtsamplesReal physician documents, 39 specialties, 282 documents85.8%95% CI 81.9 to 89.7
Why the gap: Mira-Q2 was trained on synthetic data. It learned that data well and struggles with document types it never saw, such as operative notes and physical examinations. On real documents that match its schema the gap narrows to about five points.
How much does fine-tuning improve a small model?
Fine-tuning took JSON validity from 0% to 100% on the same task
Without training, the base model invents its own schema. Mira-Q2 follows the required one on every held-out document.
How Mira-Q2 was trained
- MethodQLoRA, 4-bit, rank 16, alpha 32, two epochs
- Training data8,400 examples: 6,400 built to be correct, plus 2,000 schema variants
- Vocabulary71,000 real ICD-10 codes, NLM drug names, curated lab reference ranges
- Loss0.132 training, 0.142 evaluation, a gap of 0.010
What does Mira-Q2 extract from a clinical document?
Mira-Q2 returns the same ten fields for every document
Pick a field to see what it holds. The schema can also be swapped: Mira-Q2 was trained on 2,000 schema variants so it follows a schema passed in its prompt.
document_type
What kind of document it is
One of lab_report, medication_list, discharge_summary, pathology_report, intake_form, progress_note or other.
patient
Age and sex, and nothing that identifies the patient
The patient object is de-identified by design: the schema never includes a name or a medical record number. Across all 782 evaluated documents the identifier leak rate was 0.0%.
encounter
When and where the encounter happened
The encounter date in ISO format, and the department.
vitals
The vital signs in the document
A list of every vital sign the document records.
labs
The lab results in the document
A list of lab results. Training data used curated lab reference ranges, so values and ranges come from real clinical vocabulary.
medications
The medications in the document
A list of medications. Training data used drug names from the US National Library of Medicine.
diagnoses
The diagnoses in the document
A list of diagnoses. Training data drew on 71,000 real ICD-10 codes.
procedures
The procedures in the document
A list of the procedures the document mentions.
allergies
The allergies in the document
A list of recorded allergies.
extraction_notes
Notes about the extraction
A notes field that travels with the result, for a human reviewer to read alongside the extracted fields.
Does patient data leave my network with Mira?
With Mira the document never leaves the machine that reads it
A hosted extraction API sends each document across the internet to someone else’s servers. Mira runs where the documents already are.
A hosted extraction API
Four hops, two of them outsideDilr Mira
Nothing leaves your networkWhat this means for HIPAA
Mira is a model, not a hosted service, so there is no vendor in the data path to sign a business associate agreement with. Documents stay inside the safeguards you already run. Compliance is still a property of your deployment and your controls, not of any model.
What the output holds back
The patient field returns age and sex only, never a name or record number. The published identifier leak rate was 0.0% on all four test sets, 782 documents in total.
How do I run Mira-Q2?
Mira-Q2 loads in a few lines of Python with Unsloth
This is the example from the model card. Load it with Unsloth, not PeftModel: the adapter was trained with Unsloth’s 4-bit quantisation.
Install Unsloth
The example runs on a CUDA GPU and loads the model in 4-bit.
Load the adapter
It pulls Qwen2.5-3B-Instruct as the base and the 120 MB Mira-Q2 adapter on top.
Send a document
The system prompt carries the schema. The reply is JSON for a person to review.
import torch
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="dilr/Mira-Q2",
max_seq_length=4096,
dtype=torch.float16,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "system", "content": "You are a clinical information extraction system..."},
{"role": "user", "content": "Patient: 45/M\nHb 12.5 g/dL (13-17) LOW\nWBC 8.2 x10^9/L (4-11) Normal"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=1024, do_sample=False,
eos_token_id=[tokenizer.eos_token_id,
tokenizer.convert_tokens_to_ids("<|im_end|>")])
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))Can I use Mira-Q2 commercially?
Mira-Q2 has two licences and only one allows commercial use
The adapter DILR publishes is Apache-2.0. The Qwen base model it runs on is licensed for non-commercial use. Check both before you build a product on it.
The Mira-Q2 adapter
Apache-2.0, published by DILR
The 120 MB of fine-tuned weights that make the model extract clinical fields. Apache-2.0 permits commercial use.
Mira-Q2 on Hugging FaceThe base model
Qwen2.5-3B-Instruct, Qwen Research License
Alibaba Cloud licenses this model for non-commercial use. Its licence asks commercial users to request a licence from Alibaba Cloud and to show a Built with Qwen notice.
Read the Qwen Research License
What can’t Mira-Q2 do yet?
Mira-Q2 reads English only and was trained on synthetic data
These limits are on the model card. They are the reason a private deployment starts with your own documents.
English only
Mira-Q2 has not been trained or tested on any other language.
Trained on synthetic data
Retraining on real documents from a design partner is what the model card says closes the gap.
85.8% valid across 39 specialties
It is strongest on lab reports, discharge summaries and medication lists, the types it was trained on.
A draft for human review
Every output is a draft for a person to check. Mira is an extraction tool and does not make clinical decisions.
Loads with Unsloth only
Loading it with PeftModel gives a quantisation mismatch, according to the model card.
What comes after Mira-Q2?
Mira-3 is in development and aims at the limits of Mira-Q2
These are plans, not shipped features. Clinical extraction in English is what ships today.
- In development
More than one language
Hinglish and code-switched clinical text first, then Spanish and Portuguese.
- In development
Any schema without setup
Point Mira at a JSON schema, such as an insurance claim profile, and get those fields back.
- In development
Identifiers removed first
Names and numbers replaced before the model reads the document, with a reversible vault.
Can DILR adapt Mira to our documents?
DILR fits Mira to your schema and runs it inside your environment
A private deployment is scoped and priced per engagement. It starts from your documents, not from our test sets.

Agree the schema
Your fields, from a schema file and a handful of seed examples. The model card says no code changes are needed for a new schema.
Train on your real documents
The synthetic-to-real gap is the main weakness of Mira-Q2, and real documents are what closes it.
Run it on your hardware
On-premise or air-gapped, with every output going to a person for review.
What else do people ask?
Short answers to common questions about Dilr Mira
Accuracy, privacy, HIPAA, licensing and hardware.
- Dilr Mira is a family of small, private language models from DILR.ai that read clinical documents, such as lab reports, medication lists and discharge summaries, and return source-grounded, schema-valid JSON. They run on hardware you control. The current release, Mira-Q2, is published on Hugging Face.
- On its published evaluation of 782 clinical documents, Mira-Q2 produced valid JSON on 100% of 200 held-out documents, 100% of 150 documents in a different formatting dialect, 94.7% of 150 real physician documents that match its schema, and 85.8% of 282 real physician documents across 39 specialties. Field-F1 on the held-out set was 1.000.
- No. Mira runs on your own hardware, on-premise or air-gapped, so documents are not sent to a third-party API. The schema is de-identified by design, returning age and sex but never a name or record number, and the identifier leak rate was 0.0% across all 782 evaluated documents.
- Mira is a model, not a hosted service, so there is no vendor in the data path to sign a business associate agreement with. Running it inside your own environment keeps clinical documents within the safeguards you already operate. HIPAA compliance remains a property of your deployment and your controls, not of any model.
- The Mira-Q2 adapter is published under Apache-2.0. It runs on top of Qwen2.5-3B-Instruct, which Alibaba Cloud licenses under the Qwen Research License for non-commercial use, and that licence asks commercial users to request a licence from Alibaba Cloud. Check the base model terms before commercial use, and raise it on a scoping call with DILR.
- Mira-Q2 is a 120 MB QLoRA adapter for Qwen2.5-3B-Instruct, a model with about 3.1 billion parameters. The model card loads it in 4-bit with Unsloth on a CUDA GPU, and warns against loading it with PeftModel. DILR does not publish CPU benchmarks for Mira-Q2.
- Mira-Q2 reads English only. It is strongest on the document types it was trained on: lab reports, medication lists, discharge summaries, pathology reports, intake forms and progress notes. It is weaker on types it never saw in training, such as operative notes and physical examinations.
- DILR has not run a head-to-head benchmark against other clinical models, so this page does not call Mira the best. When comparing private clinical LLMs, including the ones recommended on Reddit, ask each for three things: weights you can run yourself, a published scorecard on real documents with confidence intervals, and a stated identifier leak rate. Mira-Q2 publishes all three.
What else does DILR.ai make?
DILR.ai also offers AI consulting and other AI products
- AI consultingDATS, the five-stage method for placing AI in an organisation and running it
- Dilr VoiceAI voice agents that answer and make business calls
- CogniblWork management for people and AI agents, where done needs proof
- Dilr AcademyAn AI tutor licensed to universities, colleges and training providers
How do we run Mira privately?
Bring Mira the documents you cannot send out
Try the published model on Hugging Face, or talk to us about a private deployment fitted to your schema and your documents.
