Xiaomi-OCR-0 CORD receipt LoRA GGUF
Lucasgitguy-co/Xiaomi-OCR-0-CORD-MLX-LoRA converted from MLX to a llama.cpp LoRA file. It pushes Xiaomi-OCR-0 to answer receipt images with CORD-style JSON.
| File | Type | Size (GB) |
|---|---|---|
Xiaomi-OCR-0-CORD-LoRA-F16.gguf |
LoRA, rank 8, alpha 16, 186 language-model layers | 0.011 |
Use
There is no official Xiaomi-OCR-0 GGUF. Tested base: prithivMLmods/Xiaomi-OCR-0-GGUF Xiaomi-OCR-0.Q4_K_M.gguf, with that repo's Xiaomi-OCR-0.mmproj-bf16.gguf for images.
hf download prithivMLmods/Xiaomi-OCR-0-GGUF Xiaomi-OCR-0.Q4_K_M.gguf Xiaomi-OCR-0.mmproj-bf16.gguf --local-dir .
hf download Lucasgitguy-co/Xiaomi-OCR-0-CORD-LoRA-GGUF Xiaomi-OCR-0-CORD-LoRA-F16.gguf --local-dir .
llama-mtmd-cli -m Xiaomi-OCR-0.Q4_K_M.gguf --mmproj Xiaomi-OCR-0.mmproj-bf16.gguf \
--lora Xiaomi-OCR-0-CORD-LoRA-F16.gguf --image receipt.jpg --temp 0 \
-p "Extract this receipt as JSON using the CORD schema: menu, sub_total, total. Use CORD field names such as nm, cnt, price, subtotal_price, tax_price, and total_price. Preserve printed values as strings, omit absent fields, and return only JSON."
The adapter was trained in MLX on a 4-bit Xiaomi-OCR-0 base. Its JSON is often malformed, and it mixes Chinese keys into answers to text-only prompts. See the source card for its evaluation numbers.
How it was made and tested
mlx_lora_to_peft.pyturned the MLX weights into a PEFT adapter: transposed A and B, alpha = scale 2.0 × rank 8 = 16. llama.cppconvert_lora_to_gguf.py(checkout1b6935b) then converted it againstxiaomi-research/Xiaomi-OCR-0revisionbbd8cf8.- Tested 2026-11-16 with llama.cpp 1.0.0 (build 12359):
- Base F16 + this LoRA gives exactly the same greedy text as a hand-merged model on 3 text prompts of 80 tokens each. It differs from the base on the two receipt prompts.
- With an F16 mmproj and the base repo's
receipt.jpg, the LoRA switched the output to CORD keys (menu,nm,cnt,price). The base model used its own keys. - It also loads without errors on prithivMLmods' Q4_K_M.
Licence
The adapter is Apache-2.0 (see LICENSE and NOTICE). The base model Xiaomi-OCR-0 is Apache-2.0. The CORD v2 training data is CC BY 4.0, by NAVER CLOVA, and is not included.