Unlimited-OCR-2 Vision-Language Model: 8GB+ VRAM

Unlimited-OCR-2 Vision-Language Model: 8GB+ VRAM

At a Glance

Item Value
Repository baidu/Unlimited-OCR-2
Family guide Unlimited-OCR-2 guide (1 articles)
Published 2026-10-26
License mit
Formats safetensors
Paper arXiv:2606.23050
Source type Primary source (the publisher itself)

Values determined by this site’s code when the information was collected. Dates are JST.

Overview

Baidu has released “Unlimited-OCR-2," a vision-language model specialized in analyzing ultra-long documents. It is developed to build upon the design of the previous version, “Unlimited-OCR," aiming to parse extremely long documents without increasing computational load or memory consumption.

According to the abstract of the paper explaining the underlying technology of this model, “Unlimited OCR Works" (https://arxiv.org/abs/2606.23050), recent end-to-end OCR models achieve high accuracy by adopting LLMs as decoders, but they face challenges where KV cache accumulates as the output sequence grows longer, leading to a sudden surge in memory consumption and a drop in generation speed. Focusing on the fact that humans do not drop efficiency even during lengthy transcription tasks, the authors proposed introducing “Reference Sliding Window Attention (R-SWA)" to mimic human working memory, keeping the KV cache constant throughout the entire decoding process. With this latest Unlimited-OCR-2, this mechanism is further evolved to achieve “Unlimited-Horizon Parsing" of entire documents within a finite context window.

Specifications

  • Architecture: UnlimitedOCRForCausalLM

Performance

While the model card does not include a comparison table with detailed score figures, qualitative evaluation results reported by the creators have been shared.

According to the creators, Unlimited-OCR-2 has achieved state-of-the-art (SOTA) performance on both “MPDocBench," a benchmark evaluating documents on the scale of dozens of pages, and “MarathonDocBench," targeting extreme long-form documents spanning hundreds of pages.

Making this long-form processing possible is the newly introduced “Sparse Reference Sliding Window Attention (SR-SWA)" in this version. According to the creators’ explanation, it compresses the attention interaction between text and visual information in ultra-long sequences into a set of fixed-size working references, such as 512 tokens. This confines computational complexity within fixed boundaries, allowing the decoding latency and memory consumption per step to be maintained almost constant regardless of document length.

In conventional standard attention mechanisms, computational costs tend to increase quadratically as inputs and outputs grow longer, easily causing out-of-memory (OOM) errors due to bloated KV caches. Unlimited-OCR-2 is reported to eliminate this quadratic scaling and memory bottleneck through SR-SWA, enabling virtually unlimited document analysis while maintaining a finite context length. The model card also demonstrates text analysis of an entire book executed in a single request from start to finish.

However, it should be noted that these evaluation results and the SOTA positioning are claims reported by the model creators themselves, and detailed verification scores or numerical comparison tables with other models by independent third-party institutions are not provided.

Strengths and Use Cases

Unlimited-OCR-2 excels at bulk OCR (optical character recognition) and text extraction tasks for ultra-long documents ranging from dozens to hundreds of pages.

As seen in the model card description and function tags (ocr, vision-language, multilingual), this model specializes in image-text-to-text conversion for multilingual documents. In particular, it features two encoding methods that can be used depending on the application: “gundam mode" (dynamic tiling), which reads a single page by dividing it into fine segments, and “base mode," which captures the entire page globally. By feeding multi-page documents in bulk, analysis can proceed while taking cross-page context into account.

Additionally, as mentioned in the paper’s abstract, it adopts a sliding window attention design that mimics working memory, suppressing drops in decoding speed and bloating of the KV cache even as the page count increases. This makes it suitable for integration into pipelines that convert extremely long materials—such as academic papers, technical specifications, manuals, and books—into text in a single inference request, without needing to split them page by page and send individual requests.

Hardware Requirements

Estimated requirements (calculated by Local Model Watch) — 3.3B parameters

Your VRAM Quantization File size Est. memory needed
8GB (RTX 4060 / 3060 Ti, etc.) I64 6.2GB 7.5GB

Inference engine support (architecture name matched against each project’s own model registry in its source code, checked 2026-11-17): llama.cpp: registered, vLLM: registered, MLX (mlx-lm): not registered. “Not registered" means the name is absent from that registry today, not that the model cannot run.

Memory estimates add a 20% runtime overhead (KV cache, etc.) to the actual size of the distributed files. Actual usage varies with context length, batch size and inference engine. These figures are computed by this site from file sizes, not published by the model’s authors. Compare with other models in our VRAM quick reference. What the quantization names mean: glossary.

Can You Run It Locally?

Not usable in Ollama, LM Studio and llama.cpp yet — we have found no GGUF build.

The publisher ships safetensors only. However, llama.cpp’s registry does list this architecture, so conversion to GGUF is possible and the model will run once someone publishes a converted build. 14 converted build(s) from other uploaders exist. Today it can be run with transformers, vLLM or MLX (Apple Silicon), using the memory figures in the table above.

License — mit (Commercial use allowed): Permits commercial use, modification and redistribution, provided the copyright notice and license text are retained.

Compiled by this site’s code from the published formats, converted builds we have found, and each engine’s own model registry. “Not found" means we have not seen such a build, not that none exists. License summaries are not legal advice — check the publisher’s original terms before relying on them.

Recent Models in the Same Size Class

Models with up to 4B parameters that Local Model Watch covered recently, listed by code from our article log for comparison. VRAM tiers are this site’s estimates; licenses are as stated on the model cards.

→ Scroll horizontally to see all columns

Model Parameters Smallest VRAM tier License Our article
LiquidAI/d1-omni-600M 587M 4GB lfm1.0 d1-omni-600M Multimodal Decision Model: 4GB+ VRAM, GGUF Builds (2026-11-17)
LiquidAI/d1-3B 3.1B 4GB lfm1.0 d1-3B Vision-Language Model: 4GB+ VRAM, GGUF Builds (2026-11-17)
openbmb/MiniCPM-OCR-1.0-DSpark 297M 4GB apache-2.0 MiniCPM-OCR-1.0-DSpark OCR Acceleration Draft Model: 4GB+ VRAM (2026-11-17)
openbmb/MiniCPM-OCR-Jev-GPTQ 2.2B 4GB apache-2.0 OpenBMB Releases Quantized Versions of MiniCPM-OCR-Jev (2026-11-17)
LiquidAI/d1-2B-GGUF 1.9B 4GB lfm1.0 d1-2B-GGUF Text, Image, and Video Decision-Making Model: 4GB+ VRAM (2026-11-17)

How to Get It

Unlimited-OCR-2 is available on Hugging Face, distributing weight files in safetensors format. It has no gating restrictions and can be freely downloaded and used under the MIT license.

For lightweight verification, the model card provides Python code using the Transformers library, while SGLang, a high-speed inference framework, is recommended for production deployment and server use.

When using Transformers, install the necessary libraries, then load the model and tokenizer with custom code permitted as follows:

import torch
from transformers import AutoModel, AutoTokenizer

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

When analyzing multi-page documents together, pass a list of page images and call the infer_multi method.

pages = [f"your_doc/page_{i}.jpg" for i in range(1, 8)]
text, num_tokens = model.infer_multi(
    tokenizer,
    image_files=pages,
    output_path="output/multi",
    save_results=True
)

For single-page images, use the infer method. This enables dynamic tiling processing (gundam mode) by default.

text = model.infer(
    tokenizer,
    image_file="your_doc/page_1.jpg",
    output_path="output/single",
    save_results=True
)

To launch an inference server using SGLang, install the custom build wheels and related packages (PyMuPDF, fastokens, etc.) noted in the model card, then run the python -m sglang.launch_server command. Environment variables allow adjustments tailored to long document processing, such as page-window-based scheduling (e.g., SGLANG_UOCR_DOC_GUNDAM_PAGE_WINDOW) and output token limits per page (SGLANG_UOCR_MAX_PAGE_TOKENS). Once the server is running, text analysis can be executed by sending image data via the OpenAI-compatible chat completions API (/v1/chat/completions).

Quantized and Converted Variants

→ Scroll horizontally to see all columns

Added Publisher Format Repository Smallest VRAM tier (build, est. memory)
2026-11-17 mlx-community MLX mlx-community/Unlimited-OCR-2-8bit MLX 8bit 4.4GB (fits in 8GB VRAM)
2026-11-17 mlx-community MLX mlx-community/Unlimited-OCR-2-4bit MLX 4bit 2.7GB (fits in 4GB VRAM)

File sizes of each build:

  • Available builds in mlx-community/Unlimited-OCR-2-8bit: MLX 8bit 3.7GB
  • Available builds in mlx-community/Unlimited-OCR-2-4bit: MLX 4bit 2.3GB

In addition, 14 converted build(s) from other uploaders exist on Hugging Face; this site lists only builds from the model’s publisher or established quantization maintainers.

This section is appended automatically by Local Model Watch when a converted build of this model appears after publication. Memory figures are estimated from the size of the distributed files. What the quantization names mean: glossary.

Other Models for the Same Task

Recent vision-language models covered by Local Model Watch, newest first. Grouped by the task each publisher declares on Hugging Face (pipeline_tag); the smallest VRAM tier is this site’s estimate.

See all vision-language models →

What to Read Next

Sources

Update History

  • 2026-11-17: Added converted builds to “Quantized and Converted Variants”: mlx-community/Unlimited-OCR-2-8bit, mlx-community/Unlimited-OCR-2-4bit