Instructions to use ratlinghitman/qwen3vl-4b-receipt-extraction-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 ratlinghitman/qwen3vl-4b-receipt-extraction-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 ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16 # Run inference directly in the terminal: llama cli -hf ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16 # Run inference directly in the terminal: llama cli -hf ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
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 ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
Use Docker
docker model run hf.co/ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use ratlinghitman/qwen3vl-4b-receipt-extraction-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ratlinghitman/qwen3vl-4b-receipt-extraction-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": "ratlinghitman/qwen3vl-4b-receipt-extraction-gguf", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
- Ollama
How to use ratlinghitman/qwen3vl-4b-receipt-extraction-gguf with Ollama:
ollama run hf.co/ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
- Unsloth Desktop
- Pi
How to use ratlinghitman/qwen3vl-4b-receipt-extraction-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ratlinghitman/qwen3vl-4b-receipt-extraction-gguf with Docker Model Runner:
docker model run hf.co/ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
- Lemonade
How to use ratlinghitman/qwen3vl-4b-receipt-extraction-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
Run and chat with the model
lemonade run user.qwen3vl-4b-receipt-extraction-gguf-F16
List all available models
lemonade list
- Hermes Agent
How to use ratlinghitman/qwen3vl-4b-receipt-extraction-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 ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
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:9931/v1 hermes config set model.default ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ratlinghitman/qwen3vl-4b-receipt-extraction-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16
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:9931/v1 \ --custom-model-id "ratlinghitman/qwen3vl-4b-receipt-extraction-gguf:F16" \ --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"
Qwen3-VL-4B Receipt Extraction (GGUF Q4_K_M)
Reads a receipt image and returns it as structured JSON. GGUF build for llama.cpp, Ollama and LM Studio.
At a glance
| Base model | Qwen/Qwen3-VL-4B-Instruct |
| Fine-tuning | LoRA r=16, language tower only |
| Dataset | naver-clova-ix/cord-v2 |
| Format | Q4_K_M language model + f16 mmproj vision tower |
| Files | *-Q4_K_M.gguf (2.50 GB), mmproj-*-f16.gguf (0.84 GB) |
| Size on disk | 3.3 GB |
| Runtime | llama.cpp, Ollama, LM Studio |
Intended use
Turning a photo or scan of a retail receipt into structured JSON, for bookkeeping and expense pipelines, or as a starting point for research on document understanding.
Out of scope
Invoices, handwritten notes, and non-receipt images. The model was never trained on them. It also should not be trusted to make financial decisions on its own; treat the output as an extraction to be reviewed.
How to use
The model expects one image and this exact prompt, which is the prompt it was trained with:
Extract the receipt from the image into a structured JSON. Your output should contain ONLY correct JSON!
Two files: the quantized language model and its mmproj vision tower. You need both.
huggingface-cli download <your-hf-username>/qwen3vl-4b-receipt-extraction-gguf --local-dir gguf
llama-server -m gguf/*-Q4_K_M.gguf --mmproj gguf/mmproj-*-f16.gguf -ngl 99 -c 8192
Then query the OpenAI-compatible endpoint with an image and the prompt:
Extract the receipt from the image into a structured JSON. Your output should contain ONLY correct JSON!
Your llama.cpp build must support the Qwen3-VL qwen3vl_merger projector. LM Studio and
Ollama load the same pair.
Output
A single JSON object with three top-level keys: menu (the line items), sub_total and
total. Every value is a string, copied from the receipt.
{"menu": [{"nm": "Es Teh Manis", "cnt": "2", "price": "8,000"}],
"sub_total": {"subtotal_price": "8,000"},
"total": {"total_price": "8,000", "cashprice": "10,000", "changeprice": "2,000"}}
Evaluation
CORD-v2 test split, 100 receipts, greedy decoding, images capped at 1600 patches.
| field_f1 | nTED | json_validity | exact_match |
|---|---|---|---|
| 0.8737 | 0.9051 | 0.9700 | 0.4000 |
Measured in section 8.2b of finetune_qwen3vl.ipynb.
- field_f1 flattens the predicted and gold JSON into (field-path, value) leaf pairs and scores precision/recall over them. It asks whether the right values landed at the right paths.
- nTED (normalized tree-edit distance, following the CORD paper) compares the two JSON trees directly. It catches structural mistakes, like wrong nesting or a missing key, that leaf-flattening misses.
Neither subsumes the other, which is why both are here.
Training
Fine-tuned from Qwen/Qwen3-VL-4B-Instruct with LoRA on naver-clova-ix/cord-v2
(800 train / 100 validation / 100 test receipts). Labels were losslessly normalized before
training.
| LoRA rank / alpha / dropout | 16 / 32 / 0.05 |
| Adapted modules | language tower only (q,k,v,o,gate,up,down_proj); vision tower frozen |
| Precision | bf16 |
| Learning rate | 1e-4 |
| Batch size | 2 per device x 4 gradient accumulation |
| Epochs | 20 |
| Image budget | 1600 patches of 28x28 |
Training ran well past convergence on purpose, so there was a wide range of adapters to pick from. Validation loss and the task metrics peak at different times here: loss starts rising around epoch 3, while the best field_f1 and nTED land at epoch 9 or later. The adapter published here is the one that scored best on the validation split by field_f1, and it was then scored once on the held-out test split. Early-stopping on loss would have picked a noticeably worse one.
Quantization
The language model is quantized to Q4_K_M by llama.cpp's llama-quantize. This is
data-free: no calibration set, no receipts involved. The vision tower is exported separately
as an f16 mmproj file and is left unquantized.
It converts from the bf16 master rather than the GPTQ build, because llama.cpp cannot ingest GPTQ-packed weights. Being data-free, it gives up more than the calibrated GPTQ build does: field_f1 0.8737 here against 0.8840 for GPTQ, on the same test split.
Limitations
- The test split is 100 receipts. Gaps of a point or two in field_f1 are inside the noise band and should be read as ties.
- CORD-v2 is photographed Indonesian retail and restaurant receipts. Expect worse results on other layouts, languages, or document types (invoices, handwriting).
- Field names mirror the raw CORD keys (
nm,cnt,unitprice), not friendly names. - Values are transcribed text, not validated arithmetic. Nothing checks that the line items sum to the total. Do not use the output for financial decisions without review.
- Schema-constrained decoding was tried and scored far worse than plain decoding (field_f1 falls roughly 35 points), so plain greedy decoding is what these numbers use and what is recommended.
- Any timing or throughput figure depends heavily on hardware. Measure on the machine you intend to deploy on.
License
apache-2.0, inherited from the base model. The CORD-v2 dataset carries its own terms; see
its dataset card.
- Downloads last month
- 147
4-bit
Model tree for ratlinghitman/qwen3vl-4b-receipt-extraction-gguf
Base model
Qwen/Qwen3-VL-4B-InstructDataset used to train ratlinghitman/qwen3vl-4b-receipt-extraction-gguf
Evaluation results
- Field F1 on CORD-v2test set self-reported0.874
- Normalized TED on CORD-v2test set self-reported0.905
- JSON validity on CORD-v2test set self-reported0.970
- Exact match on CORD-v2test set self-reported0.400