Downloads · 30 days
9
12% of all-time downloads
ajvikram/cranebear-extraction-4b-gguf
cranebear-extraction-4b-gguf is a text generation model from ajvikram. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A QLoRA fine-tune of Qwen3-4B that turns a panic emergency voice transcript into structured extraction JSON for a human dispatcher. Quantized to Q4KM (~2.3 GB) for on-device / edge use.
Downloads · 30 days
9
12% of all-time downloads
All-time downloads
74
Public
Repo size
2.5 GB
Likes
0
Public
Click a slice to open those files.
.gguf2.5 GB · 100%
From the Hugging Face model README
A QLoRA fine-tune of Qwen3-4B that turns a panic emergency voice transcript into structured extraction JSON for a human dispatcher. Quantized to Q4_K_M (~2.3 GB) for on-device / edge use.
The model extracts. A human decides. It never triages, dispatches, or advises. Severity bands are evidence labels for a trained dispatcher, not autonomous decisions.
This checkpoint is round 3 of the CraneBear extraction fine-tune — the round that clears the partner's blocking safety gate when served correctly.
Two serving mistakes silently destroy accuracy (one of them looked like a 41-point regression during development):
SYSTEM prompt byte-for-byte. Do not substitute a
different extractor prompt, and do not use an older Modelfile from a prior
round. The weights and the prompt are a matched set.NOT_REPORTED, NO_EMERGENCY, NOT_APPLICABLE)
and presence booleans — never null. Map to nulls in application code
(or use the partner's GeneratedMapping). Pairing these weights with a
grammar that allows null recreates the drift bug.Ship with this repo:
| File | Role |
|---|---|
cranebear-extraction-4b-q4_k_m.gguf | Weights (Q4_K_M) |
Modelfile | Ollama: template + exact SYSTEM + temperature 0 |
cranebear-extraction-presence.gbnf | llama.cpp GBNF (no null production) |
{
"casualty_count_stated": true,
"casualty_count": 1,
"severity": "IMMEDIATE",
"severity_confidence": "HIGH",
"hazards_assessed": true,
"hazards": {
"fire": false,
"gas_chem": false,
"electrical": false,
"bio": false
},
"summary": "Caller reports trapped person, heavy bleeding."
}
| Field | Values |
|---|---|
casualty_count_stated | true / false |
casualty_count | 0–15 (0 when not stated) |
severity | MINOR | DELAYED | IMMEDIATE | DECEASED | NOT_REPORTED | NO_EMERGENCY |
severity_confidence | LOW | MEDIUM | HIGH | NOT_APPLICABLE |
hazards_assessed | true / false |
hazards.* | booleans; all false when not assessed |
summary | condensed restatement, ~15–99 GSM-7 chars |
Closed-schema consumers map sentinels → null (severity/confidence/hazards)
and casualty_count_stated=false → casualty_count=null.
seed.jsonl, 24 cases)With the shipped prompt + presence constraint + deterministic post-guards:
| Metric | Result | Gate |
|---|---|---|
| Field accuracy (macro) | 93.8% (Ollama) / 91.7% (llama.cpp b10642) | ≥ 90% |
| Missed-IMMEDIATE (asserted) | 0.0% | < 2% (blocking) |
| Sanitize-clean | 100% | 100% |
The ~2-point Ollama vs llama.cpp gap is two near-tie presence-boolean flips on a 24-case set (one field flip ≈ 1.04 pts of macro). Both runs pass the blocking gate.
Guardrails (confidence clamps for hedged/degraded transcripts, raise-only severity floor, summary length/GSM-7/non-verbatim repairs) are part of the published score. Without them, macro is still above 90% with 0% missed-IMMEDIATE; confidence accuracy is lower because teacher labels disagreed with the partner's HIGH rubric on hedged cases.
hf download ajvikram/cranebear-extraction-4b-gguf cranebear-extraction-4b-q4_k_m.gguf
hf download ajvikram/cranebear-extraction-4b-gguf Modelfile
ollama create cranebear-extraction -f Modelfile
curl -s http://localhost:11434/api/generate -d '{
"model": "cranebear-extraction",
"prompt": "Transcript:\nHe is under the car, not responding, a lot of blood on the pavement.",
"format": "json",
"stream": false,
"options": { "temperature": 0, "num_ctx": 2048 }
}'
Prompt the user turn as Transcript:\n... — that is how the model was trained.
Use cranebear-extraction-presence.gbnf with root symbol root, greedy
decoding (temperature 0), context 2048, and the same chat template as the
Modelfile (Qwen3 <|im_start|> with the thinking block closed empty).
# Example shape — paths/flags vary by build
./llama-cli -m cranebear-extraction-4b-q4_k_m.gguf \
--grammar-file cranebear-extraction-presence.gbnf \
-n 320 -c 2048 --temp 0
| Base | Qwen3-4B (Apache-2.0) |
| Method | QLoRA, completion-only loss |
| Checkpoint | Round 3 (best held-out; rounds 4–5 did not improve the gate) |
| Quant | Q4_K_M, ~2.3 GB |
| SHA-256 | e1f3bc1ee8b8298e191bd9331ad0a8040cc9071b3ee5bc964d06ae91ec52496c |
Full writeup of the five rounds, prompt-drift incident, and guardrails: SLM_TRAINING.md (if mirrored) / project docs in the training repo.
Apache-2.0 (inherits from Qwen3-4B).