Skip to main content
Back

LlamaIndex Opens OCRia-1, a 4B Model That Tops 53 Open-Weight Document Parsers

LlamaIndex open-sourced OCRia-1, a 4B vision-language model that tops ParseBench open-weight leaderboards for parsing complex PDFs into structured Markdown.

Pro

  • LlamaIndex open-sourced OCRia-1, a 4B document parsing VLM fine-tuned from Qwen3.5-4B.
  • Scores 85.24 on ParseBench 2 and 84.65 on ParseBench 1, top open-weight on both.
  • Scores 82.5 on ParseBench 1 charts versus 69.1 for next-best open-weight model.
  • Outputs Markdown with HTML tables, LaTeX formulas, Mermaid diagrams, and page furniture tags.
  • Trained with SFT plus GRPO on 100K pages; technical report details reward functions.
  • Custom license: free under $2M revenue/funding, commercial license required above or for competing products.

LlamaIndex has published the weights for OCRia-1, the document-parsing model behind its hosted LlamaParse product. The four-billion-parameter vision-language model was fine-tuned from Qwen3.5-4B. LlamaIndex reports that it leads all open-weight entries on both ParseBench leaderboards.

OCRia-1 accepts a page image and returns Markdown, using HTML for tables and LaTeX for formulas. It can also convert charts into tables of data points and wrap headers, footers, and watermarks in dedicated tags. A single VLM call handles transcription and structure recovery from pixels, without an external OCR engine, layout detector, or PDF text layer.

Files included in the release
Artifact Purpose
BF16 Safetensors Full-precision inference with frameworks such as vLLM
GGUF builds Quantized local inference with llama.cpp or Ollama
ocria_grounding Post-processing that assigns page coordinates to generated content
prompt.txt The fixed system prompt expected by the model
Technical report Training, evaluation, and inference details

Charts and tables drive the benchmark lead

OCRia-1 targets structures that conventional OCR pipelines often lose: merged cells, spanning headers, tables with thousands of cells, plotted chart values, checkboxes, strikethrough, underlining, and subscript or superscript text.

ParseBench is LlamaIndex’s page-to-markup evaluation suite, with higher scores indicating better reconstruction. The company reports these results:

  • ParseBench 2: 85.24 overall, ranking seventh among 61 systems and first among 23 open-weight models.
  • ParseBench 1: 84.65 overall, ranking second among 158 systems and first among 53 open-weight models.
  • ParseBench 1 charts: 82.5, compared with 69.1 for the next-highest open-weight entry.
  • Other evaluations: first place on the table and formula categories of olmOCR-bench, plus PulseBench-Tab and fr-bench-pdf2md.
Radar chart comparing OCRia-1 with other OCR models across ParseBench categories
LlamaIndex’s comparison of OCRia-1 with other document-parsing models across ParseBench categories.

Chart conversion is the release’s clearest technical differentiator. OCRia-1 represents a chart as an HTML table, placing extracted values under their corresponding series and labels. That structure can flow directly into search, analytics, or retrieval-augmented generation pipelines without a separate chart parser. Teams should still test numerical accuracy on their own chart styles, especially for crowded plots, faint labels, and unusual axes.

Serving hinges on one flag

Each request handles one page rendered at roughly 300 DPI. Multi-page PDFs therefore need to be rasterized, submitted page by page, and reassembled in page order. Dense pages can exceed 20,000 output tokens, so the recommended setup uses a 32,768-token context window and allows about 24,576 generated tokens.

The Qwen3.5 chat template enables reasoning by default, which causes OCRia-1 to return the wrong output format. Requests must set enable_thinking=False. A minimal vLLM server command is:

vllm serve llamaindex/OCRia-1 --served-model-name ocria-1 \
  --max-model-len 32768 \
  --limit-mm-per-prompt '{"image": 1}'

An OpenAI-compatible request can load the supplied prompt, attach one base64-encoded page image, and pass the template setting through vLLM:

import base64
from pathlib import Path
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="local",
)

prompt = Path("prompt.txt").read_text()
image = base64.b64encode(
    Path("page.png").read_bytes()
).decode()

response = client.chat.completions.create(
    model="ocria-1",
    temperature=0,
    max_tokens=24576,
    messages=[
        {"role": "system", "content": prompt},
        {
            "role": "user",
            "content": [
                {
                    "type": "image_url",
                    "image_url": {
                        "url": f"data:image/png;base64,{image}"
                    },
                }
            ],
        },
    ],
    extra_body={
        "chat_template_kwargs": {
            "enable_thinking": False
        }
    },
)

output = response.choices[0].message.content

The response arrives inside an outer Markdown fence, which applications should remove before storing or indexing the content. LlamaIndex also reports that the Q8_0 GGUF build matched BF16 quality on a ParseBench 2 sample, making quantized deployment on systems such as a Mac mini a practical option for smaller workloads.

Grounding runs after generation

OCRia-1 generates structured text without bounding boxes. The separate ocria_grounding package reconstructs coordinates after inference by combining the answer with information from the source page.

For PDFs with an embedded text layer, the package aligns generated words with the corresponding PDF word boxes. For scanned pages and images, it performs another attention pass to estimate where the model focused while producing each word, then snaps those estimates to visible ink. Docling’s Heron detector supplies the page regions used to group words into blocks.

An experimental fast-layout backend performs the post-processing on a CPU with frozen geometry predictors and skips the Heron detector. Its output carries several documented limits: block boundaries follow the detector’s segmentation, bold lead-ins or list markers can separate from their paragraphs, and image-only documents rely on less precise attention-derived positions.

Structural rewards shape the model

The training writeup describes a corpus of 100,979 pages containing about 370 million target tokens. Roughly 83,000 real pages use teacher-generated transcriptions checked against PDF text, while approximately 18,000 synthetic pages provide exact ground truth.

The recipe uses two training stages followed by checkpoint averaging:

  1. Supervised fine-tuning: two epochs on pages rendered at approximately 1,024 pixels.
  2. GRPO reinforcement learning: deterministic rewards evaluate table structure, cell values, chart data points, and inline formatting. Penalties cover split or merged tables, repetition, and invented formatting.
  3. Checkpoint averaging: two reinforcement-learning checkpoints with strengths in different evaluation categories are averaged uniformly.

The GRPO rewards measure many of the same structures used by ParseBench, including tables, charts, and formatting. That overlap can favor the benchmark’s scoring criteria, so results on unrelated document sets remain useful for assessing generalization.

Line chart page used to demonstrate OCRia-1 chart-to-table extraction
An example chart that OCRia-1 converts into an HTML table of series, labels, and values.

Peak speed needs the production stack

LlamaIndex’s highest throughput figures come from the production LlamaParse stack described in its inference stack post. That configuration runs on one Nvidia B200, quantizes the model with a mixture of NVFP4 and FP8, and adds custom vLLM kernels. It also uses a 690-million-parameter DFlash 2 block-diffusion speculator, which proposes groups of tokens for the main model to verify.

Reported inference configurations
Configuration Format and hardware Reported throughput
Public checkpoint BF16 on stock vLLM About 320 to 330 output tokens per second for one page
LlamaParse production stack Mixed NVFP4 and FP8 on one B200, with speculation and custom kernels About 4,700 output tokens per second for one request; 10.2 pages per second at 64 concurrent requests

The production stack’s single-request token rate is roughly fourteen times the published rate for the public BF16 checkpoint. Pages that generate more than 20,000 tokens can therefore take about a minute on the reported stock-vLLM setup, before accounting for image rendering, queueing, grounding, or network overhead.

The custom license draws hard boundaries

The OCRia-1 Model and Code License is based on OpenRAIL-M and permits free research and personal use. It also permits commercial use by organizations below the license’s stated $2 million revenue and funding thresholds.

Organizations above those thresholds need a commercial license. Products that compete with LlamaParse or LlamaCloud require one regardless of company size. The license assigns generated outputs to the user, while the Qwen3.5-4B base model retains its Apache 2.0 license. Prospective commercial users should review the license text for its definitions, measurement periods, and competitive-use restrictions.

OCRia-1 gives developers a self-hosted route to extracting complex tables, formulas, formatting, and chart data with one model call per page. Adoption depends on four practical checks: quality on representative documents, output-token costs, the accuracy required from optional grounding, and eligibility under the custom license.