Instructions to use ajvikram/cranebear-extraction-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 ajvikram/cranebear-extraction-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 ajvikram/cranebear-extraction-4b-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf ajvikram/cranebear-extraction-4b-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 ajvikram/cranebear-extraction-4b-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf ajvikram/cranebear-extraction-4b-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 ajvikram/cranebear-extraction-4b-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ajvikram/cranebear-extraction-4b-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 ajvikram/cranebear-extraction-4b-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ajvikram/cranebear-extraction-4b-gguf:Q4_K_M
Use Docker
docker model run hf.co/ajvikram/cranebear-extraction-4b-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ajvikram/cranebear-extraction-4b-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ajvikram/cranebear-extraction-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": "ajvikram/cranebear-extraction-4b-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ajvikram/cranebear-extraction-4b-gguf:Q4_K_M
- Ollama
How to use ajvikram/cranebear-extraction-4b-gguf with Ollama:
ollama run hf.co/ajvikram/cranebear-extraction-4b-gguf:Q4_K_M
- Unsloth Desktop
- Pi
How to use ajvikram/cranebear-extraction-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 ajvikram/cranebear-extraction-4b-gguf:Q4_K_M
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": "ajvikram/cranebear-extraction-4b-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ajvikram/cranebear-extraction-4b-gguf with Docker Model Runner:
docker model run hf.co/ajvikram/cranebear-extraction-4b-gguf:Q4_K_M
- Lemonade
How to use ajvikram/cranebear-extraction-4b-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ajvikram/cranebear-extraction-4b-gguf:Q4_K_M
Run and chat with the model
lemonade run user.cranebear-extraction-4b-gguf-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ajvikram/cranebear-extraction-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 ajvikram/cranebear-extraction-4b-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 ajvikram/cranebear-extraction-4b-gguf:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ajvikram/cranebear-extraction-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 ajvikram/cranebear-extraction-4b-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 "ajvikram/cranebear-extraction-4b-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"
CraneBear Extraction 4B (GGUF)
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.
โ ๏ธ Read this first: presence schema + exact system prompt
Two serving mistakes silently destroy accuracy (one of them looked like a 41-point regression during development):
- Use the shipped
SYSTEMprompt 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. - Emit the presence schema, not the closed schema. The model always
outputs explicit sentinels (
NOT_REPORTED,NO_EMERGENCY,NOT_APPLICABLE) and presence booleans โ nevernull. Map to nulls in application code (or use the partner'sGeneratedMapping). Pairing these weights with a grammar that allowsnullrecreates 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) |
Output schema (presence)
{
"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.
Measured quality (held-out 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.
Usage
Ollama
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.
llama.cpp (on-device)
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
Training summary
| 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.
Intended use / limitations
- Intended: on-device / edge extraction of structured fields from short emergency voice transcripts for a human dispatcher.
- Not intended: autonomous triage, medical advice, or replacing a dispatcher.
- Eval set is small (24 cases). Treat point estimates as directional; the blocking under-triage metric is the load-bearing claim.
- Synthetic training data from a teacher model; partner gold is eval-only.
License
Apache-2.0 (inherits from Qwen3-4B).
- Downloads last month
- 62
4-bit