lightonai / LightOnOCR-2-1B-bbox-base

huggingface.co
Total runs: 2.1K
24-hour runs: 36
7-day runs: 755
30-day runs: 1.8K
Model's Last Updated: June 30 2026
image-text-to-text

Introduction of LightOnOCR-2-1B-bbox-base

Model Details of LightOnOCR-2-1B-bbox-base

LightOnOCR-2-1B-bbox-base Banner

LightOnOCR-2-1B-bbox-base

Base model with bounding boxes for fine-tuning. This is the pre-RLVR checkpoint that predicts both text and image bounding boxes, ideal as a starting point for domain adaptation with localization capabilities.

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


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

Image Localization

The output format for embedded images is:

![image](image_N.png) x1,y1,x2,y2

Where coordinates are normalized to [0, 1000] .


Benchmarks
OlmOCR-Bench Results

See the paper for full benchmark details and methodology.


Usage with Transformers

Note: LightOnOCR-2 requires transformers installed from source (not yet in a stable release).

uv pip install git+https://github.com/huggingface/transformers
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-bbox-base", torch_dtype=dtype).to(device)
processor = LightOnOcrProcessor.from_pretrained("lightonai/LightOnOCR-2-1B-bbox-base")

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-bbox-base \
    --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-bbox-base"

# 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 1540px
  • Maintain aspect ratio to preserve text geometry
  • Use one image per page; batching supported by vLLM

Fine-tuning

LightOnOCR-2-1B-bbox-base is fully differentiable and supports:

  • LoRA fine-tuning
  • Domain adaptation with image localization requirements
  • Custom RLVR training with IoU-based or custom reward functions

License

Apache License 2.0


Citation
@misc{lightonocr2_2026,
  title        = {LightOnOCR: End-to-End, Multilingual, Efficient, State-of-the-Art Vision-Language Model for OCR},
  author       = {Said Taghadouini and Adrien Cavaill\`{e}s and Baptiste Aubertin},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/blog/lightonai/lightonocr-2}}
}

Runs of lightonai LightOnOCR-2-1B-bbox-base on huggingface.co

2.1K
Total runs
36
24-hour runs
41
3-day runs
755
7-day runs
1.8K
30-day runs

More Information About LightOnOCR-2-1B-bbox-base huggingface.co Model

More LightOnOCR-2-1B-bbox-base license Visit here:

https://choosealicense.com/licenses/apache-2.0

LightOnOCR-2-1B-bbox-base huggingface.co

LightOnOCR-2-1B-bbox-base huggingface.co is an AI model on huggingface.co that provides LightOnOCR-2-1B-bbox-base's model effect (), which can be used instantly with this lightonai LightOnOCR-2-1B-bbox-base model. huggingface.co supports a free trial of the LightOnOCR-2-1B-bbox-base model, and also provides paid use of the LightOnOCR-2-1B-bbox-base. Support call LightOnOCR-2-1B-bbox-base model through api, including Node.js, Python, http.

LightOnOCR-2-1B-bbox-base huggingface.co Url

https://huggingface.co/lightonai/LightOnOCR-2-1B-bbox-base

lightonai LightOnOCR-2-1B-bbox-base online free

LightOnOCR-2-1B-bbox-base huggingface.co is an online trial and call api platform, which integrates LightOnOCR-2-1B-bbox-base's modeling effects, including api services, and provides a free online trial of LightOnOCR-2-1B-bbox-base, you can try LightOnOCR-2-1B-bbox-base online for free by clicking the link below.

lightonai LightOnOCR-2-1B-bbox-base online free url in huggingface.co:

https://huggingface.co/lightonai/LightOnOCR-2-1B-bbox-base

LightOnOCR-2-1B-bbox-base install

LightOnOCR-2-1B-bbox-base is an open source model from GitHub that offers a free installation service, and any user can find LightOnOCR-2-1B-bbox-base on GitHub to install. At the same time, huggingface.co provides the effect of LightOnOCR-2-1B-bbox-base install, users can directly use LightOnOCR-2-1B-bbox-base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

LightOnOCR-2-1B-bbox-base install url in huggingface.co:

https://huggingface.co/lightonai/LightOnOCR-2-1B-bbox-base

Url of LightOnOCR-2-1B-bbox-base

LightOnOCR-2-1B-bbox-base huggingface.co Url

Provider of LightOnOCR-2-1B-bbox-base huggingface.co

lightonai
ORGANIZATIONS

Other API from lightonai

huggingface.co

Total runs: 11.4K
Run Growth: -236
Growth Rate: -2.06%
Updated:July 06 2026
huggingface.co

Total runs: 9.8K
Run Growth: 9.2K
Growth Rate: 93.65%
Updated:April 21 2026
huggingface.co

Total runs: 3.0K
Run Growth: 786
Growth Rate: 26.44%
Updated:February 10 2025
huggingface.co

Total runs: 1.7K
Run Growth: -2.4K
Growth Rate: -137.62%
Updated:November 13 2024
huggingface.co

Total runs: 1.6K
Run Growth: -2.0K
Growth Rate: -128.74%
Updated:December 10 2024
huggingface.co

Total runs: 1.4K
Run Growth: -855
Growth Rate: -58.97%
Updated:May 19 2022
huggingface.co

Total runs: 689
Run Growth: -195
Growth Rate: -28.30%
Updated:August 17 2026
huggingface.co

Total runs: 637
Run Growth: 616
Growth Rate: 96.70%
Updated:January 06 2025
huggingface.co

Total runs: 27
Run Growth: -5
Growth Rate: -18.52%
Updated:November 07 2024
huggingface.co

Total runs: 10
Run Growth: -1
Growth Rate: -10.00%
Updated:February 18 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:December 11 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 23 2023