CoolFace
Modelpublic

lightonai/LightOnOCR-0.9B-32k-1025

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
20likes68downloads
Model Card

license: apache-2.0 language:

  • en
  • fr
  • de
  • es
  • it
  • nl
  • pt
  • sv
  • da basemodel: lightonai/LightOnOCR-1B-1025 libraryname: vllm tags:
  • ocr
  • document-understanding
  • vision-language
  • pdf
  • tables
  • forms ---

<div align="center"> <img src="lightonocr-banner.png" alt="LightOn OCR-1B Banner" width="400"/> </div>

[!NOTE] 🚀 LightOnOCR-2 is now available and state-of-the-art on [OlmOCR-bench](https://huggingface.co/datasets/allenai/olmOCR-bench), with new image detection variants! Check it out here: [lightonai/LightOnOCR-2-1B](https://huggingface.co/lightonai/LightOnOCR-2-1B)

LightOnOCR-0.9B-32k-1025

Pruned-vocabulary version (32k tokens) optimized for European languages, offering additional speedup with minimal accuracy loss.

LightOnOCR-1B is a compact, end-to-end vision–language model for Optical Character Recognition (OCR) and document understanding. It achieves state-of-the-art accuracy in its weight class while being several times faster and cheaper than larger general-purpose VLMs.

📄 [Paper]( https://arxiv.org/pdf/2601.14251) | 📝 [Read the full blog post](https://huggingface.co/blog/lightonai/lightonocr/) | 🚀 [Try the demo](https://huggingface.co/spaces/lightonai/LightOnOCR-1B-Demo)

Highlights

  • Speed: 5× faster than dots.ocr, 2× faster than PaddleOCR-VL-0.9B, 1.73× faster than DeepSeekOCR
  • 💸 Efficiency: Processes 5.71 pages/s on a single H100 (~493k pages/day) for <$0.01 per 1,000 pages
  • 🧠 End-to-End: Fully differentiable, no external OCR pipeline
  • 🧾 Versatile: Handles tables, receipts, forms, multi-column layouts, and math notation
  • 🌍 Compact variants: 32k and 16k vocab options for European languages

Model Overview

LightOnOCR combines a Vision Transformer encoder(Pixtral-based) with a lightweight text decoder(Qwen3-based) distilled from high-quality open VLMs. It is optimized for document parsing tasks, producing accurate, layout-aware text extraction from high-resolution pages.


Benchmarks

ModelArXivOld ScansMathTablesMulti-ColumnTiny TextBaseOverall
LightOnOCR-1B-1025 (151k vocab)81.471.676.435.280.088.799.576.1
LightOnOCR-1B-32k (32k vocab)80.666.273.533.571.287.699.573.1
LightOnOCR-1B-16k (16k vocab)82.372.975.333.578.685.199.875.4

All benchmarks evaluated using vLLM.


Installation

[2025/11/24] 🚀 LightOnOCR is now officially supported in vLLM v0.11.1 🚀

bash

uv venv --python 3.12 --seed
source .venv/bin/activate

# install any version higher than 0.11.1
uv pip install vllm==0.11.2
# extra deps need only to run the example below
uv pip install pypdfium2 pillow requests

Start Server

bash
vllm serve lightonai/LightOnOCR-0.9B-16k-1025 \
    --limit-mm-per-prompt '{"image": 1}'

PDF Inference

python
import base64
import requests
import pypdfium2 as pdfium
import io

ENDPOINT = "http://localhost:8000/v1/chat/completions"
MODEL = "lightonai/LightOnOCR-0.9B-16k-1025"

# Download PDF from arXiv
pdf_url = "https://arxiv.org/pdf/2412.13663"
pdf_data = requests.get(pdf_url).content

# Open PDF and convert first page to image
pdf = pdfium.PdfDocument(pdf_data)
page = pdf[0]
# Render at 200 DPI (scale factor = 200/72 ≈ 2.77)
pil_image = page.render(scale=2.77).to_pil()

# Convert to base64
buffer = io.BytesIO()
pil_image.save(buffer, format="PNG")
image_base64 = base64.b64encode(buffer.getvalue()).decode('utf-8')

# Make request
payload = {
    "model": MODEL,
    "messages": [{
        "role": "user",
        "content": [{
            "type": "image_url",
            "image_url": {"url": f"data:image/png;base64,{image_base64}"}
        }]
    }],
    "max_tokens": 4096,
    "temperature": 0.2,
    "top_p": 0.9,
}

response = requests.post(ENDPOINT, json=payload)
text = response.json()['choices'][0]['message']['content']
print(text)

Rendering and Preprocessing Tips

  • Render PDFs to PNG or JPEG at a target longest dimension of 1280–1300 px
  • Maintain aspect ratio to preserve text geometry
  • LightOnOCR is robust to moderate skew; heavy rotation correction is optional
  • Use one image per page; batching supported by vLLM

Variants

VariantDescription
[LightOnOCR-1B-1025](https://huggingface.co/lightonai/LightOnOCR-1B-1025)Full multilingual model (default)
[LightOnOCR-1B-32k](https://huggingface.co/lightonai/LightOnOCR-0.9B-32k-1025)Fastest pruned-vocabulary version (32k tokens) optimized for European languages
[LightOnOCR-1B-16k](https://huggingface.co/lightonai/LightOnOCR-0.9B-16k-1025)Most compact variant with smallest vocabulary

Fine-tuning

Transformers integration is coming soon for training.

LightOnOCR is fully differentiable and supports:

  • LoRA
  • Domain adaptation (receipts, scientific articles, forms, etc.)
  • Multilingual fine-tuning with task-specific corpora

Example fine-tuning configurations will be released alongside the dataset.


Data

Trained on a diverse large-scale PDF corpus covering:

  • Scientific papers, books, receipts, invoices, tables, forms, and handwritten text
  • Multiple languages (Latin alphabet dominant)
  • Real and synthetic document scans

The dataset will be released under an open license.


License

Apache License 2.0


Acknowlegments

The project received funding from the BPI Scribe project.


Citation

@misc{lightonocr2025,
  title        = {LightOnOCR-1B: End-to-End and Efficient Domain-Specific Vision-Language Models for OCR},
  author       = {Said Taghadouini and Baptiste Aubertin and Adrien Cavaillès},
  year         = {2025},
  howpublished = {\url{https://huggingface.co/blog/lightonai/lightonocr}}
}