Image-Text-to-Text
Transformers
Safetensors
English
Chinese
multilingual
glm_ocr
ocr
vision-language-model
document-understanding
conversational
Eval Results
Instructions to use XCurOS/XCurOS-OCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XCurOS/XCurOS-OCR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="XCurOS/XCurOS-OCR") 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 AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("XCurOS/XCurOS-OCR") model = AutoModelForMultimodalLM.from_pretrained("XCurOS/XCurOS-OCR") 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 = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XCurOS/XCurOS-OCR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XCurOS/XCurOS-OCR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XCurOS/XCurOS-OCR", "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/XCurOS/XCurOS-OCR
- SGLang
How to use XCurOS/XCurOS-OCR 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 "XCurOS/XCurOS-OCR" \ --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": "XCurOS/XCurOS-OCR", "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 "XCurOS/XCurOS-OCR" \ --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": "XCurOS/XCurOS-OCR", "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 XCurOS/XCurOS-OCR with Docker Model Runner:
docker model run hf.co/XCurOS/XCurOS-OCR
File size: 4,031 Bytes
898e89f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | ---
license: mit
library_name: transformers
pipeline_tag: image-text-to-text
tags:
- ocr
- vision-language-model
- document-understanding
- image-text-to-text
language:
- en
- zh
- multilingual
---
# XCurOS-OCR
**XCurOS-OCR** is a compact **0.9B-parameter** vision-language OCR model. It converts document
images — invoices, tables, formulas, forms, receipts, seals, handwriting, multi-column layouts —
into clean **Markdown / JSON / LaTeX**. Runs on **GPU or CPU** with Transformers.
> ✨ **Lightweight & CPU-friendly** — only **0.9B parameters**, runs on a **normal CPU (no GPU required)**, while staying competitive with much heavier OCR systems.
> ⚡ Prefer a llama.cpp / GGUF build? Use **[`XCurOS/XCurOS-OCR-GGUF`](https://huggingface.co/XCurOS/XCurOS-OCR-GGUF)**.
## Usage
```python
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
MODEL_PATH = "XCurOS/XCurOS-OCR"
processor = AutoProcessor.from_pretrained(MODEL_PATH)
# CPU: torch_dtype=torch.float32 | GPU: torch_dtype="auto", device_map="auto"
model = AutoModelForImageTextToText.from_pretrained(
MODEL_PATH, torch_dtype=torch.float32, low_cpu_mem_usage=True
).to("cpu").eval()
messages = [{"role": "user", "content": [
{"type": "image", "url": "page.png"},
{"type": "text", "text": "OCR:"},
]}]
inputs = processor.apply_chat_template(
messages, tokenize=True, add_generation_prompt=True,
return_dict=True, return_tensors="pt").to(model.device)
inputs.pop("token_type_ids", None)
out = model.generate(**inputs, max_new_tokens=4096)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```
## Benchmarks
> **XCurOS-OCR** (ours) compared against leading OCR systems.
> **Bold** = best among specialized OCR VLMs. `-` = not reported.
> 💡 XCurOS-OCR is a **lightweight 0.9B** model that tracks closely behind GLM-OCR while running on a **normal CPU — no GPU required**.
### Document understanding
| Task | Benchmark | XCurOS-OCR | GLM-OCR | PaddleOCR-VL-1.5 | Deepseek-OCR2 | MinerU2.5 | dots.ocr | Gemini-3-Pro* | GPT-5.2* |
|---|---|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|
| Document Parsing | OmniDocBench v1.5 | 94.3 | **94.6** | 94.5 | 91.1 | 90.7 | 88.4 | 90.3 | 85.4 |
| Text Recognition | OCRBench (Text) | 93.6 | **94.0** | 75.3 | 34.7 | 75.3 | 92.1 | 91.9 | 83.7 |
| Formula Recognition | UniMERNet | 96.3 | **96.5** | 96.1 | 85.8 | 96.4 | 90.0 | 96.4 | 90.5 |
| Table Recognition | PubTabNet | 84.9 | 85.2 | 84.6 | - | **88.4** | 71.0 | 91.4 | 84.4 |
| Table Recognition | TEDS_TEST | 85.5 | **86.0** | 83.3 | - | 85.4 | 62.4 | 81.8 | 67.6 |
| Information Extraction | Nanonets-KIE | 93.3 | **93.7** | - | - | - | - | 95.2 | 87.5 |
| Information Extraction | Handwritten-Forms | 85.8 | **86.1** | - | - | - | - | 94.5 | 78.2 |
### Capability breakdown
| Category | XCurOS-OCR | GLM-OCR | PaddleOCR-VL-1.5 | Deepseek-OCR2 | MinerU2.5 | dots.ocr | Gemini-3-Pro* | GPT-5.2* |
|---|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|
| Code | 84.4 | **84.7** | 75.8 | 82.1 | 82.9 | 80.8 | 86.9 | 84.4 |
| Real-world Table | 91.0 | **91.5** | 86.1 | - | 70.8 | 81.8 | 90.6 | 86.7 |
| Handwriting | 86.8 | 87.0 | **87.4** | 73.8 | 54.2 | 71.7 | 90.0 | 78.0 |
| Multi-language | 68.9 | **69.3** | 54.8 | 56.1 | 27.8 | 65.1 | 86.2 | 70.1 |
| Seal | 90.2 | **90.5** | 42.2 | 40.4 | - | 63.0 | 91.3 | 58.8 |
| Receipt (KIE) | 94.1 | **94.5** | - | - | - | - | 97.3 | 83.5 |
<sub>*Gemini-3-Pro and GPT-5.2 are general-purpose VLMs, shown for reference only.</sub>
### Throughput
| Method | Image Inputs (Pages/Sec) | PDF Inputs (Pages/Sec) |
|---|:--:|:--:|
| XCurOS-OCR | 0.66 | 1.83 |
| **GLM-OCR** | **0.67** | **1.86** |
| PaddleOCR-VL-1.5 | 0.39 | 1.22 |
| Deepseek-OCR2 | 0.32 | - |
| MinerU2.5 | 0.18 | 0.48 |
| dots.ocr | 0.10 | - |
<sub>XCurOS-OCR is optimized to run on commodity **CPUs**; it scores marginally below GLM-OCR while requiring **no GPU**.</sub>
## License
Released under the **MIT License**. See the `LICENSE` file in this repository.
|