← Back to models

LightOnOCR

readerImage

Read scanned pages, forms, and tables into text with LightOnOCR 3. This page uses the 4B checkpoint for document transcription; page images are passed directly to Antfly’s reader API.

antfly inference pull lightonai/LightOnOCR-3-4B:safetensors@b71010f095dc3735de7ee6b9969bff8f8f50b39a
By lightonaiLicense: apache-2.0Hugging Face source

Technical Specs

Architecture
LightOnOCR 3 / Qwen3.5
Parameters
4B

About#

LightOnOCR 3 is Antfly's recommended OCR model. It turns a page image into Markdown, keeping tables as HTML and formulas as LaTeX, so scanned PDFs, forms, and photographed pages become searchable text with their structure intact.

The 4B checkpoint is the larger and more accurate of the two sizes. Start with LightOnOCR 0.8B for most corpora, and switch to 4B when handwriting, photos, or degraded scans come out poorly. The 4B weights take about 9.1 GB, against about 1.7 GB for 0.8B. Both use the same prompt and API, so switching is a model name change.

Capabilities#

  • Page images to Markdown, with HTML tables and LaTeX formulas
  • A grounding mode that returns labeled blocks with bounding boxes, image descriptions, and chart data as tables
  • 4096 output tokens per page by default, up to 8192 for dense pages
  • Runs on CPU, Metal, and CUDA, with page batching on Metal and CUDA

Where it fits in Antfly#

LightOnOCR is the reader for PDFs and images in an index. Name it as the ocr.reader of a document_extraction enrichment, and Antfly runs OCR on scanned pages as documents are written. In auto mode only pages without a usable text layer go to the reader, so born-digital PDFs skip it.

See Index PDFs and Scanned Documents for the table setup and the LightOnOCR-3 guide for output budgets and image sizing.

Usage#

Pull and start Antfly#

antfly inference pull lightonai/LightOnOCR-3-4B:safetensors@b71010f095dc3735de7ee6b9969bff8f8f50b39a

antfly standalone

Read a page image#

Send a page image to the reader endpoint to transcribe its text.

curl http://localhost:8080/ai/v1/read \
-H 'Content-Type: application/json' \
-d '{
"model": "lightonai/LightOnOCR-3-4B",
"images": [
  {
    "url": "data:image/png;base64,<base64-encoded-page>"
  }
],
"max_tokens": 1024
}'