GGUF build of ViExtract-EC 0.5B for CPU
and low-VRAM machines via llama.cpp. Same weights, same contract, same prompt.
| file | size | use |
|---|---|---|
vietextract-q4_k_m.gguf |
379 MiB | default: laptops, small servers, best size/quality |
vietextract-q5_k_m.gguf |
401 MiB | a little more fidelity if RAM allows |
vietextract-q8_0.gguf |
506 MiB | near-fp16 quality, still CPU-friendly |
No fp16 GGUF is published; use the transformers repo if you need reference precision.
Do not use a chat template. This model is trained on a literal ### Instruction: /
### Response: block. Applying <|im_start|> tokens degrades output badly.
llama-cli -m vietextract-q4_k_m.gguf \
-p '### Instruction:
Bạn là một công cụ trích xuất thông tin. Dựa trên đoạn chat sau và khung JSON (schema) được cung cấp, hãy điền thông tin chính xác vào khung JSON. Nếu không tìm thấy thông tin, giữ nguyên null.
Khung JSON:
{
"customer": {"name": null},
"items": [{"name": null, "qty": null, "price": null}]
}
Đoạn chat:
Khách: shop ơi còn áo sơ mi trắng size L k
Shop: dạ còn 2 cái
Khách: lấy 1 cái, giao về 22 Hai Bà Trưng, tên Trang
### Response:
' -n 512 --temp 0 --no-display-prompt -st
Server mode:
llama-server -m vietextract-q4_k_m.gguf --port 8080 -c 2560 -n 512 --temp 0
Python (llama-cpp-python):
from llama_cpp import Llama
llm = Llama(model_path="vietextract-q4_k_m.gguf", n_ctx=2560, n_gpu_layers=-1, verbose=False)
out = llm(prompt, max_tokens=512, temperature=0.0, stop=["### Instruction:"])
print(out["choices"][0]["text"])
null scalar, {...} object, [{...}] array of items.null, absent array → [].| metric | value |
|---|---|
| Schema/shape validity | 99.8% |
| Leaf F1 strict / tolerant | 0.805 / 0.869 |
| Item F1 (arrays) | 0.817 |
| Exact item count | 67.3% |
| Fabrication (not in chat) | 0.6% |
Per difficulty (tolerant): D1 0.923 · D2 0.812 · D3 0.882 · D4 0.920.
Throughput on the reference i7-6700 with Q4_K_M, no GPU: roughly 200+ tok/s prompt and 40–50 tok/s generation, so a typical extraction lands in 2–5 s.
Synthetic, in-domain Vietnamese e-commerce/service data. Weakest on array item counts, time expressions and free-text notes. Trained at ≤1536 tokens — window long threads. Full discussion in the fp16 model card.
Apache-2.0. Base: Qwen2.5-0.5B-Instruct.
Qwen/Qwen2.5-0.5B-Instruct