Image-Text-to-Text
Transformers
Safetensors
mistral3
text-generation
ocr
document-understanding
vision-language
pdf
tables
forms
conversational
Eval Results
🇪🇺 Region: EU
Instructions to use lightonai/LightOnOCR-2-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lightonai/LightOnOCR-2-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="lightonai/LightOnOCR-2-1B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForSeq2SeqLM processor = AutoProcessor.from_pretrained("lightonai/LightOnOCR-2-1B") model = AutoModelForSeq2SeqLM.from_pretrained("lightonai/LightOnOCR-2-1B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lightonai/LightOnOCR-2-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lightonai/LightOnOCR-2-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lightonai/LightOnOCR-2-1B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/lightonai/LightOnOCR-2-1B
- SGLang
How to use lightonai/LightOnOCR-2-1B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "lightonai/LightOnOCR-2-1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lightonai/LightOnOCR-2-1B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "lightonai/LightOnOCR-2-1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lightonai/LightOnOCR-2-1B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use lightonai/LightOnOCR-2-1B with Docker Model Runner:
docker model run hf.co/lightonai/LightOnOCR-2-1B
Add overall OlmOCRBench results
Browse filesOlmOCRBench was recently updated to display "Overall" results by default, this PR ensures your model shows its score on the leaderboard.
It will show up here: https://huggingface.co/datasets/allenai/olmOCR-bench.
.eval_results/olmocrbench.yaml
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
- dataset:
|
| 2 |
id: allenai/olmOCR-bench
|
| 3 |
task_id: arxiv_math
|
| 4 |
value: 89.6
|
| 5 |
-
date: '2025-10-22'
|
| 6 |
source:
|
| 7 |
url: https://huggingface.co/papers/2601.14251
|
| 8 |
name: LightOnOCR technical report
|
|
@@ -11,7 +18,6 @@
|
|
| 11 |
id: allenai/olmOCR-bench
|
| 12 |
task_id: old_scans_math
|
| 13 |
value: 85.6
|
| 14 |
-
date: '2025-10-22'
|
| 15 |
source:
|
| 16 |
url: https://huggingface.co/papers/2601.14251
|
| 17 |
name: LightOnOCR technical report
|
|
@@ -20,7 +26,6 @@
|
|
| 20 |
id: allenai/olmOCR-bench
|
| 21 |
task_id: table_tests
|
| 22 |
value: 89.0
|
| 23 |
-
date: '2025-10-22'
|
| 24 |
source:
|
| 25 |
url: https://huggingface.co/papers/2601.14251
|
| 26 |
name: LightOnOCR technical report
|
|
@@ -29,7 +34,6 @@
|
|
| 29 |
id: allenai/olmOCR-bench
|
| 30 |
task_id: old_scans
|
| 31 |
value: 42.2
|
| 32 |
-
date: '2025-10-22'
|
| 33 |
source:
|
| 34 |
url: https://huggingface.co/papers/2601.14251
|
| 35 |
name: LightOnOCR technical report
|
|
@@ -38,7 +42,6 @@
|
|
| 38 |
id: allenai/olmOCR-bench
|
| 39 |
task_id: multi_column
|
| 40 |
value: 84.8
|
| 41 |
-
date: '2025-10-22'
|
| 42 |
source:
|
| 43 |
url: https://huggingface.co/papers/2601.14251
|
| 44 |
name: LightOnOCR technical report
|
|
@@ -47,7 +50,6 @@
|
|
| 47 |
id: allenai/olmOCR-bench
|
| 48 |
task_id: long_tiny_text
|
| 49 |
value: 91.4
|
| 50 |
-
date: '2025-10-22'
|
| 51 |
source:
|
| 52 |
url: https://huggingface.co/papers/2601.14251
|
| 53 |
name: LightOnOCR technical report
|
|
|
|
| 1 |
+
- dataset:
|
| 2 |
+
id: allenai/olmOCR-bench
|
| 3 |
+
task_id: overall
|
| 4 |
+
value: 83.2
|
| 5 |
+
source:
|
| 6 |
+
url: https://huggingface.co/papers/2601.14251
|
| 7 |
+
name: LightOnOCR technical report
|
| 8 |
+
user: nielsr
|
| 9 |
- dataset:
|
| 10 |
id: allenai/olmOCR-bench
|
| 11 |
task_id: arxiv_math
|
| 12 |
value: 89.6
|
|
|
|
| 13 |
source:
|
| 14 |
url: https://huggingface.co/papers/2601.14251
|
| 15 |
name: LightOnOCR technical report
|
|
|
|
| 18 |
id: allenai/olmOCR-bench
|
| 19 |
task_id: old_scans_math
|
| 20 |
value: 85.6
|
|
|
|
| 21 |
source:
|
| 22 |
url: https://huggingface.co/papers/2601.14251
|
| 23 |
name: LightOnOCR technical report
|
|
|
|
| 26 |
id: allenai/olmOCR-bench
|
| 27 |
task_id: table_tests
|
| 28 |
value: 89.0
|
|
|
|
| 29 |
source:
|
| 30 |
url: https://huggingface.co/papers/2601.14251
|
| 31 |
name: LightOnOCR technical report
|
|
|
|
| 34 |
id: allenai/olmOCR-bench
|
| 35 |
task_id: old_scans
|
| 36 |
value: 42.2
|
|
|
|
| 37 |
source:
|
| 38 |
url: https://huggingface.co/papers/2601.14251
|
| 39 |
name: LightOnOCR technical report
|
|
|
|
| 42 |
id: allenai/olmOCR-bench
|
| 43 |
task_id: multi_column
|
| 44 |
value: 84.8
|
|
|
|
| 45 |
source:
|
| 46 |
url: https://huggingface.co/papers/2601.14251
|
| 47 |
name: LightOnOCR technical report
|
|
|
|
| 50 |
id: allenai/olmOCR-bench
|
| 51 |
task_id: long_tiny_text
|
| 52 |
value: 91.4
|
|
|
|
| 53 |
source:
|
| 54 |
url: https://huggingface.co/papers/2601.14251
|
| 55 |
name: LightOnOCR technical report
|