Run this model with HF Jobs

Run VisualInference/OCRia-1-MLX-4bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/VisualInference/OCRia-1-MLX-4bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/VisualInference/OCRia-1-MLX-4bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/VisualInference/OCRia-1-MLX-4bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

OCRia-1 for MLX, 4bit

For Macs with 8 GB of memory and up. OCRia-1 is LlamaIndex's 4B vision-language model for document parsing (a fine-tune of Qwen3.5-4B): it reads a page image and writes the page as Markdown, with tables in HTML. This is a 4-bit build in mlx-vlm format with the vision tower kept at bf16: 2.83 GiB of weights, peak memory 4.5 GiB on a full page.

Build Weights Language model Transcripts vs bf16 (4 pages)
4bit (this repo) 2.83 GiB 4-bit affine, groups of 64 every table and chart cell identical; LaTeX bracket style and one chart title differ
8bit 4.78 GiB 8-bit affine, groups of 64 identical on 3 pages; on the fourth, one line closes its bold and underline tags earlier

Licence: read this first

OCRia-1 is not under an open-source licence. The weights are released under the OCRia-1 Model and Code License (a modified OpenRAIL-M), included here as LICENSE, and this build is a Derivative of the Model under it. Its use-based restrictions (paragraph 5 and Attachment A) apply to you: in short, free for research and personal use and for organisations under $2M in annual revenue and $2M in funding; a commercial licence from LlamaIndex is needed above those thresholds and for any document-parsing, OCR or extraction product that competes with LlamaParse or LlamaCloud. The licence text is what binds; read it. Licensing: llamaindex.ai/contact.

Model and weights by LlamaIndex, Inc. This build is not made or endorsed by LlamaIndex. Changes made: the language model's linear layers and embeddings were quantized as stated above, everything else converted from float32 to bf16; the Transformers/CUDA grounding code (ocria_grounding/) and examples are not included.

Use

pip install -U mlx-vlm
mlx_vlm.generate --model VisualInference/OCRia-1-MLX-4bit \
  --system "$(curl -sL https://huggingface.co/VisualInference/OCRia-1-MLX-4bit/resolve/main/prompt.txt)" \
  --prompt "" --no-enable-thinking --image page.png --max-tokens 24576 --temperature 0

Settings that matter, as on the original card:

  • The system prompt is prompt.txt (included), with no user text, one page image per request.
  • Thinking off. The Qwen3.5 template turns thinking on by default; with it on, the model answers in the wrong format.
  • Greedy decoding and a large output limit. Dense pages can need more than 20,000 tokens.
  • Page images: render PDFs at about 200-300 DPI (the original's benchmarks use about 4.1 megapixels per page).

In Python:

from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template

model, processor = load("VisualInference/OCRia-1-MLX-4bit")
system = open("prompt.txt").read()
prompt = apply_chat_template(processor, model.config,
                             [{"role": "system", "content": system}, {"role": "user", "content": ""}],
                             num_images=1, enable_thinking=False)
print(generate(model, processor, prompt, image=["page.png"], max_tokens=24576, temperature=0.0).text)

Smoke test

The four example pages from the original card, transcribed greedily with the settings above, on this build and on the original bf16 weights in mlx-vlm, on a Mac mini (M4 Pro, 48 GB). Similarity is the character-level ratio between the two transcripts (1.000 = identical).

Page Output tokens Similarity to bf16 Decode, this build Decode, bf16
insurance form with a 163-cell table 1977 1.000 79.9 tok/s 27.2 tok/s
line chart (data read off the plot) 467 0.922 81.7 tok/s 27.3 tok/s
handwritten math (Czech) 302 0.910 82.2 tok/s 26.6 tok/s
hearing notice, formatted text 1060 0.995 82.2 tok/s 26.5 tok/s

Prompt processing runs at about 500 tok/s on this machine; a page image is about 1,300 prompt tokens.

Not measured

ParseBench or olmOCR-bench scores for this build: not run. The layout-box grounding from the original repository needs Transformers attention maps and is not available in MLX. Tested on one machine.

Credits

OCRia-1: LlamaIndex, Inc., see the original card and its technical report. Base model: Qwen3.5-4B, Qwen team, Apache 2.0. MLX runtime: the mlx-vlm authors. Conversion and this card: VisualInference.

Downloads last month
9
Safetensors
Model size
5B params
Tensor type
U32
ยท
BF16
ยท
MLX
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for VisualInference/OCRia-1-MLX-4bit

Finetuned
Qwen/Qwen3.5-4B
Quantized
(12)
this model