LightOnOCR‑3
An open document model that turns PDFs and scanned pages into Markdown with their tables intact. lightonai/LightOnOCR-3-4B
- Accuracy
olmOCR-Bench, checks passed · not measured
- Time per request
Not timed one request at a time
- Serverless price
$0.14 in · $1.37 out
per 1M tokens
-
Convert pages to Markdown 48% cheaper than Mistral OCR 4.1
73.2%
Document checks passed · 8,234 checks
See the comparison on Doc to Markdown$2.05
Cost per 1,000 pages
Call it
from urllib.request import urlopenfrom sie_sdk import SIEClientclient = SIEClient(api_key="API keysk-sie-…")image_bytes = urlopen(imagemethomyl-page.pngbrowse).read()image = {"data": image_bytes, "format": "png"}result = client.extract( "modellightonai/LightOnOCR-3-4B", {"id": "methomyl-page", "images": [image]}, options={"max_new_tokens": 12288, "temperature": 0.1, "top_p": 1},)print(result["entities"][0]["text"])import { unpackMessage } from '@superlinked/sie-sdk';
const imageResponse = await fetch("https://superlinked.com/reference/doc-to-markdown/methomyl-page.png");
if (!imageResponse.ok) throw new Error(`Image returned ${imageResponse.status}`);
const image = new Uint8Array(await imageResponse.arrayBuffer());
const response = await fetch("https://api.superlinked.com/v1/extract/lightonai%2FLightOnOCR-3-4B", {
method: 'POST',
headers: {
Authorization: "Bearer sk-sie-…",
'Content-Type': 'application/json',
Accept: 'application/msgpack',
},
body: JSON.stringify({
items: [{ id: "methomyl-page", images: [{ data: Buffer.from(image).toString('base64'), format: "png" }] }],
params: {"options":{"max_new_tokens":12288,"temperature":0.1,"top_p":1}},
}),
});
if (!response.ok) throw new Error(`SIE returned ${response.status}`);
const result = unpackMessage<{ items: { id: string; entities: { text: string }[] }[] }>(
new Uint8Array(await response.arrayBuffer()),
);
const item = result.items[0];
if (result.items.length !== 1 || item?.id !== "methomyl-page" || !item.entities[0]?.text) {
throw new Error('Invalid OCR response');
}
console.log(item.entities[0].text);curl --fail --silent --show-error 'https://superlinked.com/reference/doc-to-markdown/methomyl-page.png' -o 'methomyl-page.png'
image_bytes=$(base64 < 'methomyl-page.png' | tr -d '\n')
curl https://api.superlinked.com/v1/extract/lightonai%2FLightOnOCR-3-4B \
-H "Authorization: Bearer sk-sie-…" \
-H "Content-Type: application/json" \
-d "{\"items\":[{\"id\":\"methomyl-page\",\"images\":[{\"data\":\"$image_bytes\",\"format\":\"png\"}]}],\"params\":{\"options\":{\"max_new_tokens\":12288,\"temperature\":0.1,\"top_p\":1}}}"Build the "Doc to Markdown" capability into my app using the Superlinked Inference Engine (SIE).
Context
- SIE is an OpenAI-style inference API. Python SDK: `from sie_sdk import SIEClient`; TypeScript: `@superlinked/sie-sdk`.
- Base URL: https://api.superlinked.com (or my regional endpoint). Auth: Bearer key from env `SIE_API_KEY` (never hard-code it).
- Model: lightonai/LightOnOCR-3-4B (SIE primitive: /extract). Keep the model id configurable.
Task
- Input: an uploaded image containing text.
- Behaviour: return the text visible in the image
- Fetch the unmodified PNG from https://superlinked.com/reference/doc-to-markdown/methomyl-page.png. Send one POST https://api.superlinked.com/v1/extract/lightonai%2FLightOnOCR-3-4B with item id "methomyl-page" and images [{data: original PNG bytes, format: "png"}]. Preserve params {"options":{"max_new_tokens":12288,"temperature":0.1,"top_p":1}}; keep this model and profile selected and fail when unavailable instead of substituting another model. In Python use SIEClient.extract; TypeScript uses the native REST body and public unpackMessage decoder shown in Copy. Read the transcription from items[0].entities[0].text (Python single-item result["entities"][0]["text"]), without repairing or calculating source values.
Deliverables
- A typed client wrapper, an application-level function for this task, error handling for timeouts/empty input, and unit tests with a stubbed client.
- Wire it into my existing stack (ask me which framework if unclear) and add a short usage example. Edit the code and run it live Sign up to run this example.
Get started no credit card required
Next to the other document models
| Model | olmOCR-Bench, checks passed | Time per request | Serverless price | Size |
|---|---|---|---|---|
| LightOnOCR-3 lightonai | Not measured | Not timed | $0.14 in · $1.37 out per 1M tokens | 4.5B |
| GLM-OCR zai-org | 73.8% | Not timed | $0.25 per 1,000 images | 1.3B |
| LightOnOCR 2 1B lightonai | 77.7% | Not timed | $2.00 per 1,000 pages | 1.0B |
| MinerU2.5 Pro 2604 1.2B opendatalab | 59.1% | Not timed | Run in your cloud | 1.2B |
| PaddleOCR VL 1.5 PaddlePaddle | 51.7% | Not timed | Run in your cloud | 959M |
Facts
- Size
- 4.5B parameters
- License
- Apache-2.0
- Reads
- Image
- Endpoint
-
extract
Evaluation
- Accuracy
- Run on SIE against the public dataset named in each figure
- Prices
- Serverless list prices
- Sources
- Task page runs and their inputs
Run LightOnOCR‑3 on Serverless or in your own cloud
SIE Serverless
We host the models; you call one API.
- No idle GPUs, pay for what you use
- Fits your stack: SDK, API, CLI, MCP
- Self-host the same open-source engine
- SOC 2 Type 2, US or EU data residency
- Create an account to try Serverless
SIE Cluster
Kubernetes in your own cloud, backed by our engineers.
- Terraform modules for your cloud
- Apache-2.0, same engine as Serverless
- GPU workers scale to zero between jobs
- Separate worker pools for each tenant
Agent prompt
Deploy SIE to our AWS account with the superlinked/sie/aws Terraform module. Docs: superlinked.com/docs/deployment.Deploy SIE to our Google Cloud project with the superlinked/sie/google Terraform module. Docs: superlinked.com/docs/deployment.Deploy SIE to our Azure subscription with the superlinked/sie/azure Terraform module. Docs: superlinked.com/docs/deployment.Deploy SIE to our Alibaba Cloud account with the superlinked/sie/alicloud Terraform module. Docs: superlinked.com/docs/deployment. SIE Local
The open-source server on your own machine.
- NVIDIA GPU
- One container, no cluster
- Process your data fully offline
- Same SDK and model IDs as Serverless
docker run --gpus all -p 8080:8080 ghcr.io/superlinked/sie-server:latest-cuda12-sglang-vision-extract