[Feature Request] Add Agent skill/tool integration interface for OCR capability
Motivation
Unlimited-OCR provides powerful document parsing capabilities (single image, multi-page, PDF) through Transformers, vLLM, and SGLang. However, there is currently no standardized way for Agent frameworks (e.g., LangChain, DuMate, AutoGPT, CrewAI) to integrate and invoke Unlimited-OCR as a callable skill/tool.
As LLM-based agents become increasingly popular for document processing workflows (RAG pipelines, automated document analysis, intelligent assistants), the ability to call Unlimited-OCR as a structured tool — rather than wrapping the Python API manually — would significantly broaden adoption and ease of integration.
Current State
- Python API:
model.infer()/model.infer_multi()— requires importing the model directly - vLLM deployment: OpenAI-compatible server, but OCR-specific parameters (crop_mode, ngram settings, output format) are not exposed as a standard tool interface
- SGLang deployment: similar server-based approach
- No MCP (Model Context Protocol) or function-calling tool definition is provided
Proposed Feature
Add a standardized skill/tool interface that allows Agent frameworks to invoke Unlimited-OCR as a tool. Suggested approaches (any or all):
Option A: MCP Server
Provide an MCP (Model Context Protocol) server that exposes OCR capabilities as tools:
ocr_parse_image— parse a single image (supportsgundamandbasemodes)ocr_parse_multi— parse multiple images / pagesocr_parse_pdf— parse a PDF document (auto-convert pages to images)
Each tool should accept standard parameters (image path/URL, output format, crop mode, etc.) and return structured results (parsed text, layout info, confidence scores).
Option B: Tool/Function Definition
Provide an OpenAI-compatible function/tool definition (JSON schema) that can be registered in Agent frameworks:
{
"name": "unlimited_ocr",
"description": "Parse documents (images, PDFs) using Unlimited-OCR. Supports single image, multi-page, and PDF parsing with configurable crop modes.",
"parameters": {
"type": "object",
"properties": {
"input_type": {"type": "string", "enum": ["image", "multi_image", "pdf"]},
"input_path": {"type": "string", "description": "Path or URL to the input file(s)"},
"crop_mode": {"type": "boolean", "default": true, "description": "Enable gundam crop mode for single images"},
"output_format": {"type": "string", "enum": ["text", "markdown", "json"], "default": "markdown"}
},
"required": ["input_type", "input_path"]
}
}Option C: REST API Wrapper
A lightweight HTTP API (FastAPI or similar) that wraps the existing Python API with standardized endpoints:
POST /ocr/parse— accept image/PDF input, return structured OCR output- Support for both file upload and URL-based input
- Configurable parameters via request body
Benefits
- Ecosystem integration — enables plug-and-play usage in LangChain, DuMate, AutoGPT, and other agent frameworks
- Standardized interface — no need for each user to write custom wrapper code
- Structured output — returns machine-readable results (JSON/Markdown) instead of raw model output
- Wider adoption — lowers the barrier for agent-based document processing workflows
Additional Context
- The existing
model.infer()andmodel.infer_multi()APIs are well-designed but tightly coupled to the Python runtime - vLLM/SGLang server deployments already provide HTTP interfaces, but lack tool/function definitions for agent integration
- MCP is becoming the de facto standard for tool integration in AI agents
Would the maintainers be open to this? I'm happy to contribute to the implementation.
Source: baidu/Unlimited-OCR