Unlimited-OCR: Baidu’s 3B-Parameter Open-Source OCR That Handles 100-Page PDFs in One Pass

Unlimited-OCR is a 3‑billion‑parameter, open‑source OCR model from Baidu that can process an entire 100‑page PDF in a single forward pass using a 32K context window, achieving 93% benchmark accuracy, sub‑0.11% error after 40 pages, multilingual support, and fully offline deployment on consumer‑grade GPUs.

Black & White Path
Black & White Path
Black & White Path
Unlimited-OCR: Baidu’s 3B-Parameter Open-Source OCR That Handles 100-Page PDFs in One Pass

Background

Unlimited-OCR, released by Baidu’s research team in June 2026, targets “one‑shot long‑horizon parsing” so that a model can ingest an entire document (e.g., a 100‑page PDF) in a single forward pass.

Compared with cloud OCR services (AWS Textract, Google Vision, Azure Document Intelligence) that charge $1.5–15 per 1 000 pages, Unlimited-OCR runs locally on a GPU, eliminating per‑page fees and keeping data offline.

Core capabilities

One‑shot long‑text parsing : 32 K token context window enables processing of a 100‑page PDF without page‑wise fragmentation.

Accuracy : Standard benchmark score 93 % (6 % above baseline) and error rate < 0.11 % after 40 pages.

Native multilingual support : Chinese, English, Japanese, Korean and other major languages work out‑of‑the‑box.

Fully offline operation : GPU‑only inference, no network traffic.

Compact model size : 3 B parameters; INT4‑quantized version runs on consumer‑grade GPUs such as RTX 3090.

Framework coverage : Compatible with Transformers, vLLM, SGLang, Ollama, llama.cpp and Docker.

Direct PDF handling : Built‑in PyMuPDF pipeline converts PDF pages to images and runs OCR in a single flow.

OpenAI‑compatible API : Deploy via vLLM or SGLang and call the model through the standard ChatGPT endpoint.

System requirements

GPU memory: ≥ 16 GB for bf16 model; ≥ 8 GB for INT4‑quantized model.

GPU: NVIDIA with CUDA 12.x.

Python: 3.12 or newer.

Dependencies: torch 2.10, transformers 4.57, PyMuPDF, Pillow, einops, etc.

Quick installation (Transformers)

pip install torch torchvision transformers Pillow einops pymupdf

python -c "
import os, torch
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained(
    'baidu/Unlimited-OCR',
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
)
model = model.eval().cuda()
tokenizer = AutoTokenizer.from_pretrained('baidu/Unlimited-OCR', trust_remote_code=True)

# Single‑image OCR
model.infer(tokenizer,
    prompt='<image>document parsing.',
    image_file='your_image.jpg',
    output_path='./outputs',
    base_size=1024, image_size=640, crop_mode=True,
    max_length=32768,
    no_repeat_ngram_size=35, ngram_window=128,
    save_results=True)

# Multi‑page PDF OCR (images pre‑converted with PyMuPDF)
model.infer_multi(tokenizer,
    prompt='<image>Multi page parsing.',
    image_files=['page1.png', 'page2.png'],
    output_path='./outputs',
    image_size=1024, max_length=32768,
    no_repeat_ngram_size=35, ngram_window=1024,
    save_results=True)
"

Docker one‑click deployment (vLLM)

docker run --rm --gpus all --network host --ipc host \
  vllm/vllm-openai:unlimited-ocr \
  baidu/Unlimited-OCR \
  --trust-remote-code \
  --logits_processors vllm.model_executor.models.unlimited_ocr:NGramPerReqLogitProcessor \
  --no-enable-prefix-caching \
  --mm-processor-cache-gb 0

After the container starts, the model is reachable via the OpenAI‑compatible endpoint:

POST http://127.0.0.1:8000/v1/chat/completions

Related resources

GitHub: https://github.com/baidu/Unlimited-OCR

Hugging Face: https://huggingface.co/baidu/Unlimited-OCR

arXiv paper: https://arxiv.org/abs/2606.23050

vLLM recipe: https://recipes.vllm.ai/baidu/Unlimited-OCR

Online demo: https://huggingface.co/spaces/baidu/Unlimited-OCR

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerOCROpen SourceMultilingualOfflineBaidu
Black & White Path
Written by

Black & White Path

We are the beacon of the cyber world, a stepping stone on the road to security.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.