Instructions to use zk0hf/lfm2-vl-450m-receipt-ocr-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use zk0hf/lfm2-vl-450m-receipt-ocr-mlx-4bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("zk0hf/lfm2-vl-450m-receipt-ocr-mlx-4bit") config = load_config("zk0hf/lfm2-vl-450m-receipt-ocr-mlx-4bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
lfm2-vl-450m-receipt-ocr-mlx-4bit
MLX conversion of a LoRA fine-tune of
LiquidAI/LFM2-VL-450M for
structured receipt extraction.
Scope
Trained on CORD-v2 (Indonesian receipts) as a pipeline proof-of-concept. It is not trained on Japanese receipts and does not follow a Japanese-receipt schema. Measured behaviour on a Japanese receipt: it emits well-formed CORD-shaped JSON with content that is not on the page.
Prompt
Use the instruction it was trained against — asking for JSON with menu (a list of
{nm, cnt, price}), sub_total, and total. Its chat template renders no system
turn, so adding an unrelated system message degrades it.
Conversion
mlx_vlm.convert -q --q-bits 4 with mlx-vlm 0.6.8. Note that --q-bits 4 does not
quantize every module: the result is 6.96 effective bits/weight, 397 MB total.
model_type is lfm2_vl.
Measured
Local mlx_vlm.generate on Apple silicon: 0.576 GB peak memory, ~420 tokens/s.
This repo is public so it can be fetched without a token.
- Downloads last month
- 52
4-bit
Model tree for zk0hf/lfm2-vl-450m-receipt-ocr-mlx-4bit
Base model
LiquidAI/LFM2-VL-450M