AI SeedbankHelp preserve open and free AI for humanity's future

← All models

lightonai_LightOnOCR-2-1B

lightonai · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


license: apache-2.0 pipeline_tag: image-text-to-text language:

  • en
  • fr
  • de
  • es
  • it
  • nl
  • pt
  • sv
  • da
  • zh
  • ja library_name: transformers tags:
  • ocr
  • document-understanding
  • vision-language
  • pdf
  • tables
  • forms


📄 Paper | 📝 Blog | 🚀 Demo | 📊 Dataset | 📓 Finetuning

LightOnOCR-2-1B

Best OCR model . LightOnOCR-2-1B is LightOn's flagship OCR model, refined with RLVR training for maximum accuracy. We recommend this variant for most OCR tasks.

About LightOnOCR-2

LightOnOCR-2 is an efficient end-to-end 1B-parameter vision-language model for converting documents (PDFs, scans, images) into clean, naturally ordered text without relying on brittle pipelines. This second version is trained on a larger and higher-quality corpus with stronger French, arXiv, and scan coverage, improved LaTeX handling, and cleaner normalization. LightOnOCR-2 achieves state-of-the-art performance on OlmOCR-Bench while being ~9× smaller and significantly faster than competing approaches.

Highlights

  • Speed: 3.3× faster than Chandra OCR, 1.7× faster than OlmOCR, 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
  • 📍 Image detection: Predicts bounding boxes for embedded images (bbox variants)

📄 Paper | 📝 Blog Post | 🚀 Demo | 📊 Dataset | 📊 BBox Dataset | 📓 Finetuning Notebook | LightOn blog entry


Model Variants

Variant Description
LightOnOCR-2-1B Best OCR model
LightOnOCR-2-1B-base Base model, ideal for fine-tuning
LightOnOCR-2-1B-bbox Best model with image bounding boxes
LightOnOCR-2-1B-bbox-base Base bbox model, ideal for fine-tuning
LightOnOCR-2-1B-ocr-soup Merged variant for extra robustness
LightOnOCR-2-1B-bbox-soup Merged variant: OCR + bbox combined

Benchmarks

See the paper for full benchmark details and methodology.


Usage with Transformers

Note: LightOnOCR-2 is avaible in latest transformers release starting from v5.

uv pip install transformers # => 5.0.0
uv pip install pillow pypdfium2
import torch
from transformers import LightOnOcrForConditionalGeneration, LightOnOcrProcessor

device = "mps" if torch.backends.mps.is_available() else "cuda" if torch.cuda.is_available() else "cpu"
dtype = torch.float32 if device == "mps" else torch.bfloat16

model = LightOnOcrForConditionalGeneration.from_pretrained("lightonai/LightOnOCR-2-1B", torch_dtype=dtype).to(device)
processor = LightOnOcrProcessor.from_pretrained("lightonai/LightOnOCR-2-1B")

url = "https://huggingface.co/datasets/hf-internal-testing/fixtures_ocr/resolve/main/SROIE-receipt.jpeg"

conversation = [{"role": "user", "content": [{"type": "image", "url": url}]}]

inputs = processor.apply_chat_template(
    conversation,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
)
inputs = {k: v.to(device=device, dtype=dtype) if v.is_floating_point() else v.to(device) for k, v in inputs.items()}

output_ids = model.generate(**inputs, max_new_tokens=1024)
generated_ids = output_ids[0, inputs["input_ids"].shape[1]:]
output_text = processor.decode(generated_ids, skip_special_tokens=True)
print(output_text)

Usage with vLLM

vllm serve lightonai/LightOnOCR-2-1B \
    --limit-mm-per-prompt '{"image": 1}' --mm-processor-cache-gb 0 --no-enable-prefix-caching
import base64
import requests
import pypdfium2 as pdfium
import io

ENDPOINT = "http://localhost:8000/v1/chat/completions"
MODEL = "lightonai/LightOnOCR-2-1B"

# 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 at 200 DPI to images using a target longest dimension of 1540px
  • Maintain aspect ratio to preserve text geometry

Fine-tuning

LightOnOCR-2 is fully differentiable and supports:

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

For fine-tuning, we recommend starting with the LightOnOCR-2-1B-base variant.


License

Apache License 2.0


Acknowlegments

The project received funding from the BPI Scribe project.


Citation

@misc{lightonocr2_2026,
  title        = {LightOnOCR: A 1B End-to-End Multilingual Vision-Language Model for State-of-the-Art OCR},
  author       = {Said Taghadouini and Adrien Cavaill\`{e}s and Baptiste Aubertin},
  year         = {2026},
  howpublished = {\url{https://arxiv.org/abs/2601.14251}}
}

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:fc5b69315945b2b04300a2e30bda6b770d426c20&dn=lightonai_LightOnOCR-2-1B

Open magnet in torrent client · infohash fc5b69315945b2b04300a2e30bda6b770d426c20

Files & hashes

PathSizesha1sha256
README.md7.7 KB (7,912 B)35bfd5cf9bce015f92e4585224e360bd3171c82a92a1e0f0a25403e345510cd78256caa86c9c5db89625663011b7a953cef212bf
added_tokens.json707 B (707 B)b54f9135e44c1e81047e8d05cb027af8bc039eedc0284b582e14987fbd3d5a2cb2bd139084371ed9acbae488829a1c900833c680
benchmark.png319.0 KB (326,664 B)2c39ba68cc1617cf47653a26104a2390d8a30505588f08c83690be0564e0275a369911b17fae02c4bfaac46a243323bd4efe23b8
chat_template.jinja720 B (720 B)0c27424f10adf7009c9b85b96f70ac4a38f6a4890942a43ee0ba48a608814e0b40ac9cb70bcc29ea72f19c84b1bf2597f05aa2bd
config.json2.3 KB (2,363 B)946a7b032b6dd85ac86d4e2e499fa3dcc5c94b2c43b62f9ec0a7207f67fd032f7ef9719fa8b6b44d7b3cf20fbc2346329493ff3a
generation_config.json219 B (219 B)601f1694ec89f0f0a9a7e18aaad8ec2dd798b16f7d2566b271454af41e9ebc28851888e1ec7ca33a53fe644dac207856df952981
lightonocr-banner.png342.8 KB (350,989 B)af674a72f0ed20c39a17cb126d7ca119441a33ebe32c44dc131d4e07b344a41bb9651eb97ce4ce73d4e78463821267467810462c
model.safetensors1.87 GB (2,011,367,489 B)f38e34a71582e227e2b08abaed05bb34f2a8bfb5cbe12d0831cca119facce91268fc7c5fb72babdf919a6e352e3131bda85c8fbb
processor_config.json1023 B (1,023 B)7ecc6bf29bc2a09112a59b0a87b14db19e8f93dd5292a61a089835ec6884836e3896bba1fc571c60df872e3ca9eb45bd3288910d
special_tokens_map.json613 B (613 B)ac23c0aaa2434523c494330aeb79c5839537810376862e765266b85aa9459767e33cbaf13970f327a0e88d1c65846c2ddd3a1ecd
tokenizer.json10.9 MB (11,422,822 B)1b7e524d88b8c0cbbbcca9062fd4b9d059dc1a7cf54b55fa0c3aba0c91ce09ea79ae4e62da24e2a1a630f96c4bae34aba25e234a
tokenizer_config.json5.4 KB (5,562 B)ed6efd44665050f7a741c4ca97733494bbb4056831f5876fbfe2bba0d931d540b84f4ffa03eb7c364d31858c38d1bf2c2fff97f3

Cite this release

Canonical URL
https://aiseedbank.org/models/lightonai_LightOnOCR-2-1B/
Slug
lightonai_LightOnOCR-2-1B
Infohash
fc5b69315945b2b04300a2e30bda6b770d426c20
License
apache-2.0
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: lightonai_LightOnOCR-2-1B.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositorylightonai/LightOnOCR-2-1B
Revision (pinned)c97bd377f04481830395218fa8951df9deaba756
Fetched at2026-09-04T01:30:42Z
License at fetchapache-2.0
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-04T01:31:01Z

apache-2.01.88 GB (2,023,487,083 bytes)transformerssafetensorsmistral3text-generationocrdocument-understandingvision-languagepdftablesformsimage-text-to-textconversationaleval-resultsendpoints_compatible11 languages (en, fr, de …)paper: 2601.14251paper: 2412.13663