Please refer to the official vLLM recipe for deployment details:
Unlimited-OCR-2
baidu·Instruct·released 26 Oct 2026
llama-server -hf RX5950XT/Unlimited-OCR-2-GGUF:Q4_K_MUnlimited-OCR-2 is an instruct-tuned OCR and document AI model from Baidu. It has 3.3B total parameters, of which 1.1B are active, using a mixture-of-experts design. It accepts image and text inputs, returns text, supports multilingual content and has a 131,072-token context window. The model is released under the MIT licence, which permits commercial use, and it has no family members listed in this directory.
How much VRAM does Unlimited-OCR-2 need?
At Q8_0 Unlimited-OCR-2 needs about 4.5 GB of GPU memory.
| Quantisation | Total |
|---|---|
| 4-bitRecommended default for local use | ≈2.8 GB |
| 8-bitrecommendedLossless in practice, twice the size of Q4 | ≈4.0 GB |
| FP16 / BF16Full precision, as released | ≈7.1 GB |
Estimates for the weights plus runtime overhead; activations vary with resolution and batch size. Pick a GPU above and the fit column checks every row against it. Weights marked “file” use the real GGUF download size; “est.” rows are computed from the parameter count.
Run Unlimited-OCR-2 locally
--quantQ4_K_Mdefault; pick your GPU to tailor itRX5950XT/Unlimited-OCR-2-GGUF
llama-server -hf RX5950XT/Unlimited-OCR-2-GGUF:Q4_K_MDownloads the GGUF on first run. Installed through llama.app? The same flags work with `llama serve`.
vllm serve baidu/Unlimited-OCR-2 vllm serve AutomatosX/AX-Unlimited-OCR-2-AXQ-MXFP8services:
vllm:
image: vllm/vllm-openai:latest
command: baidu/Unlimited-OCR-2
ports:
- "8000:8000"
ipc: host
volumes:
- ~/.cache/huggingface:/root/.cache/huggingface
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]API on port 8000.
sglang serve baidu/Unlimited-OCR-2 --host 0.0.0.0 --port 30000services:
sglang:
image: lmsysorg/sglang:latest
command: sglang serve baidu/Unlimited-OCR-2 --host 0.0.0.0 --port 30000
ports:
- "30000:30000"
ipc: host
volumes:
- ~/.cache/huggingface:/root/.cache/huggingface
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]API on port 30000.
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="baidu/Unlimited-OCR-2", dtype="auto", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg"},
{"type": "text", "text": "Describe this image."},
],
}
]
out = pipe(text=messages, max_new_tokens=256)
print(out[0]["generated_text"][-1]["content"])Quantised versions and downloads
| Repository | Format | Quant | Size |
|---|---|---|---|
| AtomicChat/Unlimited-OCR-2-W4A16 | Safetensors | INT4 | — |
| AutomatosX/AX-Unlimited-OCR-2-CUDA-AXQ-NVFP4-W4A16 | Safetensors | NVFP4 | — |
| AutomatosX/AX-Unlimited-OCR-2-AXQ-MXFP8 | Safetensors | FP8 | — |
| AtomicChat/Unlimited-OCR-2-GGUF | GGUF | Q4_K | 2.0 GB |
| AtomicChat/Unlimited-OCR-2-GGUF | GGUF | Q5_K | 2.3 GB |
| AtomicChat/Unlimited-OCR-2-GGUF | GGUF | Q6_K | 2.7 GB |
| AtomicChat/Unlimited-OCR-2-GGUF | GGUF | Q8_0 | 3.1 GB |
| AtomicChat/Unlimited-OCR-2-GGUF | GGUF | BF16 | 5.9 GB |
| RX5950XT/Unlimited-OCR-2-GGUF | GGUF | — | — |
| Soulfate24/Unlimited-OCR-2-Paretrix-GGUF | GGUF | — | — |
About Unlimited-OCR-2
Sparse Reference Sliding Window Attention (SR-SWA): Compresses text-visual attention interactions from ultra-long sequences down to a fixed-size set of working references (e.g., 512 tokens). This bounds computational complexity, keeping per-step decoding latency and memory footprint nearly constant regardless of document length. From Long- to Unlimited-Horizon Parsing: Powered by SR-SWA, Unlimited-OCR 2 achieves true, unbounded document parsing within a finite context window—effectively eliminating quadratic attention scaling and memory bottlenecks as documents grow. * Ultra-Long Document Parsing SOTA: Achieves state-of-the-art performance across both dozens-of-pages benchmarks (e.g., MPDocBench) and extreme hundred-page benchmarks (e.g., MarathonDocBench). Unlimited OCR 2 supports Transformers (native, for quick tests) and SGLang (recommended for serving). Tested with Python 3.10, torch==2.13.0, transformers==4.52.1, huggingface-hub==0.36.0, tokenizers==0.21.4, on an NVIDIA A800-80GB: Load the model once: Multi-page inference (infer_multi). All pages of a document are parsed in one request, so the model can use cross-page context. Pass the page images in page order: The prompt is built automatically as " " * num_pages + "Multi page parsing.", and each page is encoded as one global view (base mode). The output contains one per input page, in the same order as image_files.
Full model card on Hugging Face →Alternatives to Unlimited-OCR-2
All alternatives →Refer to 🌟GitHub for guidance on model inference acceleration and PDF processing, etc.
Refer to 🌟GitHub for guidance on model inference acceleration and PDF processing, etc.
Nanonets-OCR2 by Nanonets is a family of powerful, state-of-the-art image-to-markdown OCR models that go far beyond traditional text extraction.
We present dots.mocr. Beyond achieving state-of-the-art (SOTA) performance in standard multilingual document parsing among models of comparable size, dots.mocr excels at converting structured graphics (e.g., charts, UI layouts, scientific figures and etc.) directly into SVG code.
dots.ocr is a powerful, multilingual document parser that unifies layout detection and content recognition within a single vision-language model while maintaining good reading order. Despite its compact 1.7B-parameter LLM foundation, it achieves state-of-the-art(SOTA) performance.
Unlimited-OCR-2 FAQ
- How much VRAM does Unlimited-OCR-2 need?
- About 4.5 GB at Q8_0. Full precision needs about 8.0 GB.
- Can Unlimited-OCR-2 run on the RTX 4060?
- Yes. It fits at FP16 / BF16 (about 7.1 GB). It fits comfortably on the Apple M4 (16 GB), Radeon RX 6700 XT, RTX 3060 12GB.
- Can I use Unlimited-OCR-2 commercially?
- Yes. It is released under MIT. Permissive: do almost anything as long as you keep the copyright notice.
- How do I run Unlimited-OCR-2 with llama.cpp?
- Run llama-server -hf RX5950XT/Unlimited-OCR-2-GGUF:Q4_K_M. It downloads the GGUF and starts an OpenAI-compatible server.
Rate this model
Data from Hugging Face, the model card and public leaderboards. Memory and speed figures are estimates; real numbers depend on the runtime, context length and drivers. Always check the licence yourself before commercial use.
0 comments