DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to serve Unlimited OCR 2 with SGLang for hundred-page PDFs with Unlimited OCR

Set up the customized SGLang build and run a server tuned for very long documents.

Short answer: Run uv venv --python 3.10 and source .venv/bin/activate; then install the customized SGLang wheel from the repo, then uv pip install pymupdf==1.27.2.2 and uv pip install fastokens==0.3.2; set the page-window variables, for example SGLANG_UOCR_EANABLE_DOC_LIMIT=1 and SGLANG_UOCR_DOC_GUNDAM_PAGE_WINDOW=10. All steps.

Who it is forA platform team that needs a document parsing service for long PDFs.

The problemServing OCR for hundred-page documents runs out of memory or context with standard settings.

The outcomeAn SGLang server for Unlimited-OCR-2 with page-window scheduling for very long documents.

What you need first

  • An NVIDIA GPU (tested on an A800 80GB) with CUDA
  • Python 3.10 with torch 2.13.0 and transformers 4.52.1, or uv for the SGLang setup
  • PyMuPDF to convert PDFs to page images

Steps

  1. Run uv venv --python 3.10 and source .venv/bin/activate
  2. Install the customized SGLang wheel from the repo, then uv pip install pymupdf==1.27.2.2 and uv pip install fastokens==0.3.2
  3. Set the page-window variables, for example SGLANG_UOCR_EANABLE_DOC_LIMIT=1 and SGLANG_UOCR_DOC_GUNDAM_PAGE_WINDOW=10
  4. Start it with python -m sglang.launch_server and --model-path baidu/Unlimited-OCR-2 plus the README flags
  5. Send PDFs converted with PyMuPDF and check memory on the first long document

Prompt for your agent

Set up baidu/Unlimited-OCR's SGLang server following the README exactly, with page windows of 10, then parse <long.pdf> through it and tell me peak GPU memory and time per page.

Caveat.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for baidu/Unlimited-OCR and "Serve Unlimited OCR 2 with SGLang for hundred-page PDFs"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer