Baidu’s Unlimited OCR 2 targets long-document parsing with sparse attention that keeps a bounded set of working references. It offers a local CUDA deployment path, but “unlimited” does not mean that a PDF can ignore input size, output limits or processing time. A successful run must preserve every page and finish the document.
Baidu announced version 2 on October 27, alongside its long-document work. The model card describes Sparse Reference Sliding Window Attention, or SR-SWA, using a fixed reference set such as 512 tokens. Baidu claims nearly constant per-step decoding memory and latency as document length grows. That claim concerns the decoding mechanism; it does not measure every allocation in a complete PDF service.
Start with the published CUDA environment
The authored deployment instructions offer Transformers for quick tests and a customized SGLang build for serving. The Transformers example was tested with Python 3.10, PyTorch 2.13.0, Transformers 4.52.1, Hugging Face Hub 0.36.0 and tokenizers 0.21.4 on an NVIDIA A800 with 80 GB of memory.
That is the stated test environment, not an 80 GB minimum. It also does not establish a consumer GPU minimum. The example loads BF16 weights and calls .cuda(); a parameter-count estimate cannot tell you the full memory cost of its vision processing, temporary tensors and serving configuration.
The load path uses trust_remote_code=True. Review the model’s Python code and pin the reviewed repository revision when making a reproducible deployment. SGLang serving uses the project’s custom 0.5.20.dev10+g8d62f5fb9c wheel. A generic installation command shown by a model-directory interface is not evidence that its standard package implements this release’s attention and page scheduling correctly.
Keep the first experiment small: one document, one request and a few representative pages. Save the runtime revision, GPU model, preprocessing mode and peak host/device memory before increasing document length. This gives you an observed configuration rather than a hardware promise inferred from the model name.
Page windows exchange memory for continuity
In the model card’s Transformers interface, infer_multi accepts ordered page-image paths. It uses one global view per page in base mode and is designed to emit one <PAGE> marker for each input page. Single-page infer uses dynamic tiling, called gundam mode, by default. A comparison between those defaults changes both document context and image processing.
If a single-page run reads small text better, therefore, do not immediately conclude that cross-page context reduced accuracy. Compare equivalent rendering and preprocessing first, then isolate the effect of document grouping.
Baidu’s serving instructions set ten-page windows for both preprocessing modes and a 20,000-token per-page output guard. They explicitly warn that smaller windows can hurt merging when content continues across a boundary. That trade-off deserves a real document check: place a table continuation or paragraph transition at pages 10–11, then move the boundary by changing the window size. Compare both outputs with the source pages.
This proposed test asks a specific question: did the memory-saving setting change the document’s meaning? Matching page counts alone cannot catch a table heading attached to the wrong rows or a paragraph resumed under the wrong section.
A streaming response still needs an output budget
The repository’s evaluation client, infer.py, makes practical limits visible. It numerically sorts page_1.jpg filenames, sends the images in one request and records completion tokens, finish reason, elapsed time and output page markers. Its benchmark configurations use different maximum model lengths: 131,072 for MPDocBench and 786,432 for MarathonDocBench.
Without a supplied per-document token table, the client initially reserves 30% of that length for generation. For MPDocBench, that is int(131,072 × 0.3) = 39,321 tokens. A hypothetical 200-page document needing 1,000 output tokens per page would require about 200,000 output tokens. That workload cannot fit that initial allowance. These are calculations about the client configuration, not measurements of OCR speed or accuracy.
The same client can adjust its allowance after a server length error and can fall back from tiled to base processing when benchmark token tables indicate insufficient room. A parser that avoids ever-growing attention still needs an input-and-output plan for the chosen server configuration.
There is also work outside decoding. The repository’s PDF example renders all pages to temporary image files, base64-encodes them into a request and accumulates returned text chunks. Streaming tokens to the caller does not eliminate those input files, request data or retained output. Monitor temporary storage and host memory as well as GPU memory when scaling up.
Verify completeness before feeding a search index
For a useful local trial, choose a document containing ordinary text, small captions, a continued table and repeated headers. Preserve the page-image order in a manifest. Compare the returned marker count with that manifest, inspect the final page and check whether the server reports a length-limited finish. Then inspect the cross-page table and a sample of small text against the originals.
Record time for PDF rendering, model processing and output conversion separately. Otherwise a change in rendering resolution or image compression can look like a model speed change. Repeat with a longer document and one altered page-window setting, keeping other conditions fixed.
Unlimited OCR 2 is worth evaluating when document continuity matters and you can operate its published CUDA stack. The evidence needed for adoption is a complete, correctly ordered parse on your documents within measured memory and time budgets. A stable decoding working set is useful, but a missing final page still makes the resulting search index incomplete.
Reporting note: Prepared with AI assistance from primary sources checked October 28, 2026. Budget examples are EyesTech calculations; proposed validation steps are not reported test results. No model weights were downloaded or inference run. The cover is an original AI-generated editorial illustration.
