alt.freeweights.vision / LightOnOCR-1B-1025
From: lightonai <huggingface.co/lightonai>Newsgroups: alt.freeweights.visionSubject:

LightOnOCR-1B-1025

Date: 2026-11-15Commit: 7e3e7b0Signed: 2DC28CC7B26A283B ✓

Image to text model with 1.2B parameters. Safetensors weights, 2.34 GB in all. Published by lightonai under Apache-2.0.

1.2B params2.34GBLightOnOCR-1B-1025safetensorspermissive
FactsParams1.2BSize2.34 GBFormatssafetensorsTaskimage to textLicenseApache-2.0From sourcepermissive
$ fw get lightonai/LightOnOCR-1B-1025
# manifest sha256 31ed949e75bb… · 2.34 GB · 17 files
$ fw verify ./LightOnOCR-1B-1025 lightonai/LightOnOCR-1B-1025
From sourceHosted (signed)lightonai/LightOnOCR-1B-1025Last check: 2026-11-15 02:41 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Runs with

Ranked by fit to this model (safetensors), then by GitHub stars.

Overview

Size
2.34 GB
Weights
2.32 GB (safetensors)
Parameters
1.2B
Formats
safetensors
Task
image to text
License
Apache-2.0 (permissive)
Files
17, each with a sha256
Publisher
lightonai
Added
2026-11-15
Section
alt.freeweights.vision
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:41 UTCpassed

Model card

From the publisher at commit 7e3e7b0. Shown as plain text with links; images open at the publisher.

Image: LightOn OCR-1B Banner

Note. 🚀 LightOnOCR-2 is now available and state-of-the-art on OlmOCR-bench, with new image detection variants! Check it out here: lightonai/LightOnOCR-2-1B

LightOnOCR-1B-1025#

Full BF16 version of the model. We recommend this variant for inference and further fine-tuning.

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.

Open In Colab

📄 Paper | 📝 Read the full blog post | 🚀 Try the demo | 📓 Finetuning notebook

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#

Image: OlmOCR-bench v1

All benchmarks evaluated using vLLM on the Olmo-Bench.


Installation#

VLLM#

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


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

vllm serve lightonai/LightOnOCR-1B-1025 \
    --limit-mm-per-prompt '{"image": 1}' --mm-processor-cache-gb 0 --no-enable-prefix-caching

PDF Inference

import base64
import requests
import pypdfium2 as pdfium
import io

ENDPOINT = "http://localhost:8000/v1/chat/completions"
MODEL = "lightonai/LightOnOCR-1B-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)
Transformers#

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

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

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

Variants#

VariantDescription
LightOnOCR-1B-1025Full multilingual model (default)
LightOnOCR-1B-32kFastest pruned-vocabulary version (32k tokens) optimized for European languages
LightOnOCR-1B-16kMost compact variant with smallest vocabulary

Fine-tuning#

Transformers integration is coming soon for training and inference.

LightOnOCR is fully differentiable and supports:

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

📓 Finetuning notebook


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}}
}

Files

17 files · 2.34 GBWeights 2.32 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 17 files with their sha256
FileSizesha256
.eval_results/olmocrbench.yaml2.03 KB2dffab429b8c3a53c4772e7517b7fc4ce0af55822bf180e3ef87875716049d9f
.gitattributes1.63 KB4182c80b6087d24eb19b1016b7ed883249714e487bdbacdd5d856e43258c8f94
README.md7.67 KB01c78a2cdf5c21a91ff3a9d35ffd6e67b3244e21dd8d800474203a20ab3c09f3
added_tokens.json707 Bc0284b582e14987fbd3d5a2cb2bd139084371ed9acbae488829a1c900833c680
chat_template.jinja720 B0942a43ee0ba48a608814e0b40ac9cb70bcc29ea72f19c84b1bf2597f05aa2bd
config.json2.09 KBdf8fda046413cb42e186aa7fc72d7cf0d697ff17678aed9e32ed8a5a863d6ab8
generation_config.json238 Bf97ec14de135aa4e6aaaaa71fa2e03e90f24b2fdfac6bb70b595d7b3c470d874
lightonocr-banner.png1.07 MB9c336d908f36808c8e7037db52cd2c7d7d80e6ed9c9da03ea0e51e3b57ab7e55
merges.txt1.67 MB8831e4f1a044471340f7c0a83d7bd71306a5b867e95fd870f74d0c5308a904d5
model.safetensors2.32 GBc588f8ef5e616dea80f0cb57cf9e82725d98571fdbce3e1e7f507859bb8140d7
notebook.ipynb107 KB8ca341326b4197c54b2c703dd94397a819778e9b10b3fa6302a66d32dd050731
preprocessor_config.json703 B03d2a75c089d5cc899895ba9b474fd0b45e87b35439b0ed57eb2b2929de64622
processor_config.json208 Bdbb67fdb079f4a590d711c0106d6d71894f2c11e8ae274317f19b750dffe0d05
special_tokens_map.json613 B76862e765266b85aa9459767e33cbaf13970f327a0e88d1c65846c2ddd3a1ecd
tokenizer.json11.4 MBaeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4
tokenizer_config.json5.56 KB8f8b9cb7e83e719af081a65b7e25af3539326892fe54e8da3da3be6562d03e35
vocab.json2.78 MBca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
7e3e7b0cb8 pinned now2026-11-15 02:41 UTC17 files · 2.34 GB

Use it

$ fw get lightonai/LightOnOCR-1B-1025
# manifest sha256 31ed949e75bb… · 2.34 GB · 17 files
$ fw verify ./LightOnOCR-1B-1025 lightonai/LightOnOCR-1B-1025
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/lightonai/LightOnOCR-1B-1025.json --dir ./LightOnOCR-1B-1025 $ python3 fw.py verify ./LightOnOCR-1B-1025 ./lightonai__LightOnOCR-1B-1025.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download lightonai/LightOnOCR-1B-1025 --revision 7e3e7b0cb83e237e7d237af5a583a002ea632547 --local-dir ./LightOnOCR-1B-1025

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
01c78a2cdf5c21a91ff3a9d35ffd6e67b3244e21dd8d800474203a20ab3c09f3
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: lightonai <huggingface.co/lightonai>Newsgroups: alt.freeweights.visionSubject: LightOnOCR-1B-1025Date: 2026-11-15Commit: 7e3e7b0Signed: 2DC28CC7B26A283B ✓
Upstream
lightonai/LightOnOCR-1B-1025
Pinned commit
7e3e7b0cb83e237e7d237af5a583a002ea632547
Manifest
LightOnOCR-1B-1025.json · .minisig
Manifest sha256
31ed949e75bbff718223934ac86a1d757a30ac3d28b5afb4f882fa6affa35de1
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:41 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/lightonai/LightOnOCR-1B-1025.json $ curl -O https://freeweights.allternit.com/manifests/lightonai/LightOnOCR-1B-1025.json.minisig $ minisign -Vm LightOnOCR-1B-1025.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Quantizations
1
Quantizations 1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download lightonai/LightOnOCR-1B-1025
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. LightOnOCR-1B-1025.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of LightOnOCR-1B-1025. Each has its own license check and page.

From: dima806 <huggingface.co/dima806>Subject: ai_vs_real_image_detection
From: legekka <huggingface.co/legekka>Subject: AI-Anime-Image-Detector-ViT
From: onnx-community <huggingface.co/onnx-community>Subject: AI-Anime-Image-Detector-ViT-ONNX
From: AICodexLab <huggingface.co/AICodexLab>Subject: answerdotai-ModernBERT-base-ai-detector
From: onnx-community <huggingface.co/onnx-community>Subject: answerdotai-ModernBERT-base-ai-detector-ONNX
From: onnx-community <huggingface.co/onnx-community>Subject: bart-large-cnn-ONNX