Instructions to use NeuralMetrics/RolmOCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NeuralMetrics/RolmOCR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="NeuralMetrics/RolmOCR") 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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("NeuralMetrics/RolmOCR") model = AutoModelForMultimodalLM.from_pretrained("NeuralMetrics/RolmOCR", device_map="auto") 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 NeuralMetrics/RolmOCR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NeuralMetrics/RolmOCR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeuralMetrics/RolmOCR", "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/NeuralMetrics/RolmOCR
- SGLang
How to use NeuralMetrics/RolmOCR 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 "NeuralMetrics/RolmOCR" \ --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": "NeuralMetrics/RolmOCR", "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 "NeuralMetrics/RolmOCR" \ --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": "NeuralMetrics/RolmOCR", "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 NeuralMetrics/RolmOCR with Docker Model Runner:
docker model run hf.co/NeuralMetrics/RolmOCR
Add Neural Metrics card (upstream card preserved below)
Browse files
README.md
CHANGED
|
@@ -5,6 +5,29 @@ datasets:
|
|
| 5 |
- allenai/olmOCR-mix-0225
|
| 6 |
base_model: Qwen/Qwen2.5-VL-7B-Instruct
|
| 7 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# RolmOCR by [Reducto AI](https://reducto.ai/)
|
| 10 |
|
|
@@ -89,4 +112,6 @@ print(ocr_page_with_rolm(img_base64))
|
|
| 89 |
title = {RolmOCR: A Faster, Lighter Open Source OCR Model},
|
| 90 |
year = {2025},
|
| 91 |
}
|
| 92 |
-
```
|
|
|
|
|
|
|
|
|
| 5 |
- allenai/olmOCR-mix-0225
|
| 6 |
base_model: Qwen/Qwen2.5-VL-7B-Instruct
|
| 7 |
---
|
| 8 |
+
<div align="center">
|
| 9 |
+
|
| 10 |
+
# Neural Metrics · A faster, lighter take on the olmOCR recipe.
|
| 11 |
+
|
| 12 |
+
<img src="https://img.shields.io/badge/Neural%20Metrics-document%20extraction-4F46E5?style=for-the-badge" alt="Neural Metrics" />
|
| 13 |
+
<img src="https://img.shields.io/badge/fork%20of-reducto%2FRolmOCR-2563EB?style=flat-square" alt="fork" />
|
| 14 |
+
|
| 15 |
+
</div>
|
| 16 |
+
|
| 17 |
+
Reducto's RolmOCR builds on the olmOCR approach with a Qwen2.5-VL backbone, trading some setup complexity for speed and lower memory use - no PDF metadata prompting required.
|
| 18 |
+
|
| 19 |
+
**We use it for:** throughput-sensitive batch OCR - head-to-head comparison against olmOCR on our own document mix.
|
| 20 |
+
|
| 21 |
+
> ### Attribution
|
| 22 |
+
> This is an **unmodified fork** of [`reducto/RolmOCR`](https://huggingface.co/reducto/RolmOCR), created by the [Qwen team](https://huggingface.co/Qwen).
|
| 23 |
+
> All weights, files and behaviour are identical to upstream — we rehost it so our experiments stay
|
| 24 |
+
> reproducible and version-pinned. The original license and all credit remain with the Qwen team.
|
| 25 |
+
> If you want the canonical model, please use [the original](https://huggingface.co/reducto/RolmOCR).
|
| 26 |
+
|
| 27 |
+
---
|
| 28 |
+
|
| 29 |
+
<details>
|
| 30 |
+
<summary><b>Original model card from reducto/RolmOCR</b> (click to expand)</summary>
|
| 31 |
|
| 32 |
# RolmOCR by [Reducto AI](https://reducto.ai/)
|
| 33 |
|
|
|
|
| 112 |
title = {RolmOCR: A Faster, Lighter Open Source OCR Model},
|
| 113 |
year = {2025},
|
| 114 |
}
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
</details>
|