Surya OCR
$ surya_ocr Official Low RiskSurya OCR (surya_ocr, from surya-ocr by Datalab) performs multilingual document OCR, reading-order/layout detection, and table recognition across 90+ languages. Uniquely among deep-learning OCR CLIs, it provides --stdout to stream JSON directly to stdout alongside --page_range, --block_mode, and --keep_server.
pip install surya-ocr surya_ocr --stdout streams OCR JSON directly from local PDFs/images over local GPU/CPU without uploading sensitive images to MCP tools.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Provides --stdout for direct JSON streaming, --page_range bounding, and --keep_server to avoid repeated cold starts.
--stdoutstreams JSON directly to stdout for shell/agent pipelines--page_rangebounds PDF page processing
100% local execution with read-only --stdout mode, though model weights carry a $5M commercial revenue/funding threshold under OpenRAIL-M.
- Zero remote uploads; read-only
--stdoutmode - Modified OpenRAIL-M license threshold on model weights
Installable via pip install surya-ocr, though heavy PyTorch and VLM weight downloads are required.
- Heavy PyTorch + local model weight footprint
Covers 90+ language OCR, block mode layout detection, and persistent local server reuse (--keep_server).
- Supports
--stdout,--block_mode,--recursive, and--keep_server
Official Datalab repository (datalab-to/surya) with active releases.
- Official
datalab-to/suryarepository
Clear README CLI documentation covering every flag including --stdout and --keep_server.
- Documented CLI flags in upstream repository README
Security, Auth & Guardrails
Runs completely locally without API keys; caches model weights under local Hugging Face / Datalab cache directories.
Apache-2.0 code; model weights use Modified AI Pubs OpenRAIL-M (free under $5M revenue/funding).
# Surya OCR CLI (surya_ocr) Agent Rules - Prefer `--stdout` with `--page_range <range>` on large PDFs to get bounded JSON without disk clutter. - Omit `--keep_server` unless running multiple sequential `surya_*` commands that need a warm VLM backend. - Verify commercial eligibility under Datalab's OpenRAIL-M model weight license ($5M revenue/funding cap).
Agent-Ready Command Recipes
Safe Read-Only Queries
surya_ocr doc.pdf --page_range 0-2 --stdout
Runs OCR on pages 0 to 2 and streams structured JSON directly to stdout without writing disk files.
Controlled Writes & Previews
surya_ocr doc.pdf --output_dir ./surya_res
Processes the full document and saves results.json under ./surya_res.
Strengths for Agents
- +
--stdoutstreams clean OCR JSON directly to stdout without writing intermediate files. - +
--page_rangeand--keep_servermake iterative agent document inspection fast and bounded.
Caveats & Pitfalls
- ! Model weights use Modified AI Pubs OpenRAIL-M (commercial license needed above $5M funding/revenue).
- ! First run downloads multi-GB weights and requires PyTorch.