Open Source Alternatives
  • Alternatives
  • Categories
    Categories by size1,010 projects
    • Developer Tools517
    • AI & Machine Learning446
    • Business & Productivity232
    • Web Development203
    • Security & Monitoring150
    • Communication & Collaboration138
    • IT Management135
    • Cloud & Hosting119
    • LLMOps & AI Tooling116
    • Data & Analytics110
    Browse all 21 categoriesProduct & Project Management, Design & Creative and 9 more
  • Blog
  • Advertise
SearchNotion, Slack, password manager.../
Submit
Open Source Alternatives
  • Alternatives
    • Developer Tools517
    • AI & Machine Learning446
    • Business & Productivity232
    • Web Development203
    • Security & Monitoring150
    • Communication & Collaboration138
    • Browse all 21 categories
  • Blog
  • Advertise
Submit your project

New open source projects by email

The projects we add and every new guide. Free, unsubscribe any time.

Open Source Alternatives LogoOpen Source Alternatives

Handpicked Open Source Alternatives to Paid Softwares

Product

  • Categories
  • Tag
  • Advertise

Resources

  • Blog
  • Collection
  • Submit

Company

  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Sitemap

Alternatives

  • Claude Code
  • Jira
  • Notion
  • Slack
  • Linear
  • Wispr Flow
  • All alternatives
© 2026 Open Source Alternatives. All rights reserved.
Open SourceAlternatives
Home/Categories/AI & Machine Learning/Unlimited-OCR
icon of Unlimited-OCR

Unlimited-OCR

Open source alternative to Google Document AI, Amazon Textract, Mistral OCR and Azure Document Intelligence

  • 30.1K stars
  • MIT
  • Active this week
  • Last commit 2 days ago

Last verified Nov 1, 2026

Parse arbitrarily long documents in a single request using Baidu's open source OCR model with Sparse Reference Sliding Window Attention.

Visit websiteGitHub30.1K starsDeploy on Hostinger
image of Unlimited-OCR
TL;DR

Unlimited-OCR Unlimited OCR 2 is an MIT-licensed document OCR model from Baidu that parses documents of any length in a single inference request, preserving cross-page context throughout. It replaces per-page API calls to paid services like Google Document AI and Amazon Textract with a self-hosted model running on your own GPU server. The key technical differentiator is Sparse Reference Sliding Window Attention (SR-SWA), which keeps memory and latency nearly constant regardless of document length. Best for AI engineers and data teams parsing long-form documents who need full cross-page context and cannot send documents to third-party APIs.

Read the full breakdownHide the full breakdownWho it is for, how it works, trade-offs, the quick start and the FAQ
who it's for

Who Unlimited-OCR is for#

AI engineers building document extraction pipelines

Unlimited-OCR converts multi-page PDFs to structured, page-delimited text in a single call, preserving cross-page context that chunk-based approaches lose. The OpenAI-compatible API through SGLang means you can drop it into a pipeline that already calls a managed OCR API with minimal client changes.

Skip if:

Your documents are under 10 pages and you do not have GPU infrastructure. A lighter model or a managed API service is simpler to operate at that scale.

Organizations with data residency or compliance constraints

Sending legal contracts, financial reports, or patient records to a third-party OCR API creates a compliance exposure. Unlimited-OCR runs entirely on your own servers, so documents never leave your infrastructure. The MIT license permits commercial use without additional agreements.

Skip if:

Your organization already has an approved agreement with a managed API provider and lacks GPU infrastructure. The compliance benefit requires self-hosting, which has real setup and operational costs.

Research teams benchmarking long-document OCR methods

The repository ships two benchmarks: MPDocBench and MarathonDocBench, the latter covering hundred-page documents. Evaluation scripts (`infer.py`) and post-processing utilities are included, making it straightforward to reproduce the leaderboard results or compare against other models on the same test sets.

Skip if:

You need a production-ready out-of-the-box service. The research codebase does not include monitoring, logging, or horizontal scaling tooling.

the problem

The problem it solves#

OCR for long documents requires more than reading text off individual pages. Multi-page financial reports, legal contracts, and technical manuals contain cross-page context: tables that span multiple pages, headers referenced by footnotes, and running text that carries meaning across boundaries. Standard OCR models process one page at a time, so you must chunk the document, extract each piece separately, then stitch the output back together. At every split point, cross-page structure is lost.

The deeper challenge is attention scaling in vision-language models. Models that process a full document in one context window face memory growth that scales quadratically with page count, making anything beyond 20 or 30 pages either prohibitively expensive or technically impossible. This forces teams into chunk-and-merge workflows or per-page payments to managed services that apply their own chunking behind the scenes.

how Unlimited-OCR solves it

How it solves it#

Sparse Reference Sliding Window Attention

SR-SWA compresses text-visual attention to a fixed-size reference set (e.g., 512 tokens), bounding computational complexity so per-step decoding latency and memory stay nearly constant as documents grow past hundreds of pages. The architecture eliminates quadratic attention scaling, which is what forces standard models to cap at 20 to 30 pages.

Single-request multi-page parsing

`infer_multi` processes all pages of a document in one call, so the model uses cross-page context across the full document. Pass a list of page image files; the output contains one text block per page in the same order as the input. The prompt is built automatically, so no manual chunking or output stitching is required.

OpenAI-compatible API via SGLang

Serving with SGLang exposes a `/v1/chat/completions` endpoint, so callers written against OpenAI or other managed OCR APIs can route requests to the self-hosted model with minimal client changes. The served model name is `Unlimited-OCR-2`; the API accepts base64-encoded page images in the standard messages format.

Two inference modes: gundam and base

Gundam mode applies dynamic tiling for single-page inference, dividing the page into crops to capture fine detail in dense layouts. Base mode uses a global view per page and is used by `infer_multi` for multi-page runs. Choosing the right mode for your document type affects output accuracy on pages with small text or complex tables.

State-of-the-art on ultra-long document benchmarks

Achieves top performance on MPDocBench (dozens of pages) and on MarathonDocBench, an ultra-long document benchmark introduced alongside Unlimited OCR 2 that covers hundred-page documents. Evaluation scripts (`infer.py`) and post-processing utilities are included in the repository.

vLLM and ms-swift community integrations

Beyond Transformers and SGLang, the model runs under vLLM for inference and supports training with ms-swift, both through community integrations documented in the release notes. ModelScope also hosts the model for users who prefer that registry.

strengths · trade-offs

Strengths and trade-offs#

Strengths

  • MIT license with no per-page feesThe model and serving code are MIT licensed, so you can run it on your own infrastructure for any commercial or internal use without license fees. Google Document AI and Amazon Textract both charge per page processed; at high document volumes, the compute cost of a self-hosted GPU server is substantially lower than per-page API billing.
  • True unlimited document lengthSR-SWA keeps per-step memory and latency nearly constant regardless of document length. Unlike models that require chunking at 20 to 30 pages, Unlimited OCR 2 parses a full book in one request without losing cross-page context at any boundary. The MarathonDocBench results demonstrate top accuracy on hundred-page documents.
  • 30,000+ GitHub stars in under five monthsThe repository reached 30,124 GitHub stars between its June 2026 launch and November 2026, reflecting broad adoption across the research and engineering community. Active integrations from vLLM, ms-swift, ModelScope, and SGLang communities indicate use well beyond the core project team.
  • Two model releases in four monthsUnlimited OCR 2 launched in October 2026 with the SR-SWA architecture, four months after the initial release. Community integrations arrived within weeks of each version, and Baidu Cloud added the model to its managed OCR service, indicating ongoing production investment in the codebase.

Trade-offs

  • -Requires a high-VRAM GPU serverThe README tests on an NVIDIA A800-80GB. Running long multi-page documents at scale requires a GPU with sufficient VRAM to hold model weights plus the working KV cache. The model is not CPU-runnable and will not work on lightweight VPS deployments. Organizations without existing GPU infrastructure will need to provision dedicated hardware before deploying.
  • -SGLang production serving requires manual setupThe production-grade SGLang path requires installing a custom development wheel, setting eight or more environment variables, and tuning CUDA graph parameters. The README documents the process in detail, but it is not a one-command deploy and requires familiarity with GPU serving infrastructure and CUDA memory management.
  • -62 open issues on a fast-moving codebaseThe repository had 62 open issues as of November 2026, which is expected for a project launched four months earlier. Not all edge cases are documented yet. Users parsing atypical document layouts or formats outside the benchmark test sets should expect some debugging.
versus alternatives

Unlimited-OCR vs alternatives#

Unlimited-OCR vs Google Document AI

Both tools convert document images to text, but they serve different deployment models. Unlimited-OCR is MIT-licensed and runs on your own GPU servers; Google Document AI is a managed API with per-page pricing and no self-hosting option.

FeatureUnlimited-OCRGoogle Document AI
LicenseMITProprietary
Self-hostingYesNo
Pricing modelCompute onlyPer page processed
Page length limitUnlimited (SR-SWA)Varies by processor
Data residencyOn your serversGoogle Cloud only

Unlimited-OCR is the better fit when documents must stay on your own infrastructure for compliance reasons, when page volumes make per-page fees significant, or when cross-page context across hundreds of pages is required. Google Document AI is worth considering for teams without GPU infrastructure who need a production-ready API with SLA guarantees and no operational overhead.

Unlimited-OCR vs Amazon Textract

Amazon Textract is a managed AWS service that extracts text and structured data from scanned documents. Like Google Document AI, it has no self-hosting option and charges per page processed.

FeatureUnlimited-OCRAmazon Textract
LicenseMITProprietary
Self-hostingYesNo
Pricing modelCompute onlyPer page processed
Structured forms and tablesText outputKey-value pairs, table cells
Page limitUnlimitedFixed job-level limit

Amazon Textract's built-in form and table extraction returns structured key-value pairs and table cells without additional post-processing. Unlimited-OCR produces text output per page; extracting structured data from forms requires the caller to parse the model output. Textract is the stronger option when forms, tables, or key-value pairs from standard document types are the primary goal. Unlimited-OCR is the better fit when page length, data residency, or cost at high document volumes is the deciding factor.

install · quick start

Quick start#

bash
Install the required Python packages on Python 3.10 before loading model weights from Hugging Face.
```bash
pip install torch==2.13.0 torchvision pillow transformers==4.52.1 huggingface-hub==0.36.0 tokenizers==0.21.4 addict==2.4.0 einops==0.8.2 easydict==1.13
```
tech stack · detected from GitHub

What it's built on#

Languages
Python
frequently asked

FAQ#

Is Unlimited-OCR free to use commercially?

Yes. The model is MIT licensed, so you can run it on your own servers for any commercial use without license fees. You pay only for GPU time and storage. There is no managed cloud tier from the project itself; all usage is self-hosted.

What GPU hardware does Unlimited-OCR 2 require?

The README tests on an NVIDIA A800-80GB. You need a GPU with enough VRAM to hold the model weights plus a working KV cache. For production serving, the SGLang configuration uses --mem-fraction-static 0.7 to reserve headroom at 32 or more concurrent requests; 0.75 leaves too little headroom and causes failures on longer documents.

Does Unlimited-OCR support PDFs directly?

Yes, through PyMuPDF. The SGLang inference example in the README converts a PDF to per-page PNG images at 300 DPI using the fitz library, then passes the image list to the model. The model itself processes images rather than raw PDFs; the conversion step is included in the example code and requires pip install pymupdf==1.27.2.2.

How does Unlimited-OCR relate to DeepSeek-OCR?

Unlimited OCR was designed to push DeepSeek-OCR further, as stated in the project's release notes from June 2026. The Baidu team acknowledges both DeepSeek-OCR and DeepSeek-OCR-2 in the README. The key addition in Unlimited-OCR is SR-SWA, which removes the hard page limit and achieves top performance on MarathonDocBench, a hundred-page benchmark where DeepSeek-OCR targets shorter documents.

Can Unlimited-OCR 2 be fine-tuned or retrained?

Yes. The ms-swift community integration, announced in October 2026, supports training of Unlimited OCR 2. The ModelScope community also hosts the model. Training details are in the ms-swift project documentation; the integration is a community contribution acknowledged in the Unlimited-OCR release notes.

also worth a look

Similar open-source tools#

PaddleOCR

Alternative toGoogle Document AI

Self-hosted OCR toolkit turning PDFs and images into LLM-ready data

  • 92,046 GitHub stars
  • Apache-2.0Licence Apache-2.0

pdf-inspector

Alternative toAdobe PDF Extract API

Rust-powered PDF parser with smart OCR routing for AI pipelines

  • 19,772 GitHub stars
  • MITLicence MIT

MarkItDown

Alternative toUnstructured.io

Convert PDFs, Office files, and images to Markdown, free

  • 192,884 GitHub stars
  • MITLicence MIT

Unstructured

Alternative toLlamaParse

Document parsing and ETL for LLMs, RAG pipelines, and AI agents.

  • 15,640 GitHub stars
  • Apache-2.0Licence Apache-2.0

Marker

Alternative toUnstructured.io

Convert documents to clean markdown and JSON with open source AI.

  • 40,704 GitHub stars
  • Apache-2.0Licence Apache-2.0

Chat2DB

Alternative toDataGrip

AI text-to-SQL client for 40+ databases; local-first, self-hosted

  • 28,348 GitHub stars
  • CustomLicence Apache-2.0 with additional commercial restrictions (LicenseRef-Chat2DB)
by category

Open source tools in these categories#

446

AI & Machine Learning

freeCodeCamp, REA (Reverse Engineer Anything), OpenClaw
517

Developer Tools

REA (Reverse Engineer Anything), superpowers, Skills for Real Engineers
110

Data & Analytics

Firecrawl, ragflow, Worldmonitor
Hostinger

Self-host Unlimited-OCR on a Hostinger VPS

Keep it running 24/7, even when your laptop is off. A Hostinger VPS gives it a server of its own.

  1. 01

    Choose a plan

    Starts from $6.49/mo

  2. 02

    Apply

    Extra 10% off yearly plans

  3. 03

    Install Unlimited-OCR

    On a server that stays on

  4. 04

    Start building

    Focus on the app, not the server

Deploy on Hostinger

Sponsors

Inbox Zero

Alternative toSuperhuman

AI email assistant that drafts replies and clears your inbox

  • 12,855 GitHub stars
  • AGPL-3.0Licence AGPL-3.0
  • #Email

rakazo

Alternative toGrok Bot

AI teammates you own: your keys, your model, your machine.

  • 6,242 GitHub stars
  • Apache-2.0Licence Apache-2.0
  • #AI Agents

SnitchFeed

Live monitoring on LinkedIn, X, Reddit & more. Agentic social listening for startups.

Marketing & Growth

Advertise your product

New open source projects by email

The projects we add and every new guide. Free, unsubscribe any time.

Find open source alternatives to paid software

/
  • Claude Code to OpenCode
  • Jira to Windshift
  • Notion to AppFlowy
  • Slack to Mattermost
  • Linear to GitLab
  • Wispr Flow to Handy
  • Arc to Zen Browser
  • CapCut to Concat
  • Grok Bot to rakazo
  • Superhuman to Inbox Zero
  • Airtable to AITable
  • Muse to OpenClaw
  • Railway to Coolify
  • GitHub Copilot to Cline
  • Datadog to Netdata
  • Microsoft Teams to Rocket.Chat
  • Confluence to Docmost
  • Pinecone to Qdrant
  • Zapier to n8n
  • Devin AI to OpenHands
  • Firebase to Supabase
  • 1Password to KeePassXC
  • Contentful to Strapi
  • Adobe Premiere Pro to Shotcut
  • Claude Code to OpenCode
  • Jira to Windshift
  • Notion to AppFlowy
  • Slack to Mattermost
  • Linear to GitLab
  • Wispr Flow to Handy
  • Arc to Zen Browser
  • CapCut to Concat
  • Grok Bot to rakazo
  • Superhuman to Inbox Zero
  • Airtable to AITable
  • Muse to OpenClaw
  • Railway to Coolify
  • GitHub Copilot to Cline
  • Datadog to Netdata
  • Microsoft Teams to Rocket.Chat
  • Confluence to Docmost
  • Pinecone to Qdrant
  • Zapier to n8n
  • Devin AI to OpenHands
  • Firebase to Supabase
  • 1Password to KeePassXC
  • Contentful to Strapi
  • Adobe Premiere Pro to Shotcut