[KongchangAI]
· 3 min read· 1,630 words

Run Multiple Open-Source OCR Models via a Unified API: 100K Pages for Just $60

Run Multiple Open-Source OCR Models via a Unified API: 100K Pages for Just $60

VLM.run unifies open-source OCR models behind one API: 100K pages for $60 with structured output.

VLM.run consolidates five open-source OCR models — DeepSeek-OCR-2, GLM-OCR, dots.mocr, PaddleOCR-VL, and PP-OCRv6 — behind a single OpenAI-compatible API, enabling developers to parse 100K document pages for just $60. The solution supports JSON mode with strongly typed output contracts for production workflows and includes an MCP server for native Agent integration with long documents, dramatically reducing both cost and engineering complexity.

Open-Source OCR Models Are Disrupting Document Parsing

For a long time, when tackling document parsing tasks, developers defaulted to calling commercial APIs from leading AI companies. But something is changing: open-weight OCR vision-language models (VLMs) have matured to the point where, in many document parsing scenarios, expensive closed-source APIs are actually the wrong default choice.

It's worth clarifying two key concepts here: "open-weight" and "OCR VLM." Open-weight models are those whose parameter weights are publicly available — developers can download, deploy, and even fine-tune them, though the training data and full training pipeline may not be disclosed (hence the distinction from strictly "open-source"). OCR vision-language models (VLMs) are a class of multimodal models that have emerged over the past two years. Unlike traditional OCR, which relies on hand-designed text detection + recognition pipelines, these models take an entire document image as visual input and combine it with a large language model's generative capabilities to directly output structured text. This end-to-end paradigm enables models to understand complex structures that traditional OCR struggles with — page layouts, table relationships, formula semantics, and more.

Recently, the VLM.run team launched a solution that wraps multiple mainstream open-source OCR models behind a single OpenAI-compatible API, allowing developers to perform large-scale document parsing at extremely low cost. According to their published figures, processing approximately 100,000 pages costs as little as $60 — a significant advantage over traditional commercial OCR services.

VLM.run unified API running GLM-OCR, DeepSeek-OCR-2, and other open-source OCR models

One Interface, Multiple Open-Source OCR Models at Your Fingertips

The core value of this solution lies in its unified model abstraction layer. The team has consolidated the following five open-source OCR models behind a single endpoint:

  • DeepSeekAd-OCR-2
  • GLM-OCR
  • dots.mocr
  • PaddleOCR-VL
  • PP-OCRv6

Each model has its own strengths: DeepSeek-OCR-2, from the DeepSeek team, is built on their multimodal architecture and excels at mixed Chinese-English documents and complex layouts. GLM-OCR comes from Zhipu AI's GLM family and inherits ChatGLM's strong Chinese comprehension capabilities. dots.mocr is a lightweight VLM solution focused on document understanding. PaddleOCR-VL and PP-OCRv6 are from Baidu's PaddlePaddle ecosystem — PaddleOCR has long been a benchmark project for industrial-grade OCR, and PP-OCRv6 is its latest-generation ultra-lightweight model, striking an excellent balance between speed and accuracy, making it particularly suitable for large-scale batch processing. Together, these five models span the full spectrum from heavyweight VLMs to lightweight recognition engines, offering differentiated choices for different scenarios.

Thanks to the OpenAI-compatible API design, developers only need to change a single line of code (switching the model name) to quickly switch between models and directly compare the cost vs. accuracy tradeoffs on their own real document data. An OpenAI-compatible interface means it follows the Chat Completions API specification defined by OpenAI — including the model and messages field formats in the request body, as well as the data structures for streaming/non-streaming responses. Since OpenAI's SDK has become the de facto industry standard, a vast number of development tools, orchestration frameworks (such as LangChain and LlamaIndex), and monitoring platforms already have built-in support for this interface. When a service claims to be "OpenAI-compatible," it means developers don't need to learn a new SDK or refactor existing code — they simply swap out the base_url and model name to connect, dramatically reducing migration and integration costs.

Why Unified API Design Matters So Much

In real-world document processing engineering, no single OCR model is the optimal solution across all scenarios. Handwritten text, tables, multilingual content, scanned documents, formulas — different document types impose vastly different demands on model capabilities. Traditionally, evaluating and switching between models required rewriting extensive adapter code, which was costly.

A unified interface eliminates this friction — developers can conduct horizontal evaluations on their specific business documents with minimal engineering overhead, ultimately selecting the most cost-effective model combination. This "pluggable" architectural approach is becoming a major trend in AI application engineering.

Three Access Paths for Different Scenarios

The solution provides three clear access paths tailored to different use cases.

1. Quick Start: One-Click OCR Testing with Colab

For users who want to quickly validate results, the team provides a Colab notebook where you can directly upload PDF files for testing without setting up any local environment. This dramatically lowers the barrier to entry.

2. Workflow Integration: JSON Mode with Strongly Typed Output Contracts

For teams that need to embed OCR capabilities into production workflows, the official recommendation is to use JSON mode combined with strongly typed output contracts.

This deserves further explanation. JSON mode means the model is constrained to output only valid JSON-formatted data, rather than free-form text. Strongly typed output contracts go a step further: developers pre-define the field names, data types, and nested structures of the output using JSON Schema or Pydantic models, and the model's output must strictly conform to that schema. This mechanism essentially transforms the uncertainty of "prompt engineering" into the certainty of "interface contracts." In production environments, downstream systems (database writes, ERP integrations, audit processes) depend on stable data structures — any format deviation can trigger pipeline failures. Strongly typed contracts minimize this risk while also enabling OCR results to directly participate in automated decision-making, rather than being consumed only by humans.

Traditional OCR typically returns plain text, requiring extensive regex parsing and data cleaning downstream to achieve structured output. With strongly typed output contracts, developers can pre-define the expected data structure (e.g., invoice amount, date, and line-item fields), and the model directly returns structured JSON that conforms to the schema. This dramatically reduces downstream processing complexity while improving data reliability and predictability.

3. Agent Integration: Built-in MCP Server for Long Documents

For today's booming AI Agent scenarios, the solution also provides an MCP (Model Context Protocol) server with a read_document tool that can parse documents at the same low cost, with particular strength in handling long documents.

MCP is an open protocol proposed by Anthropic in late 2024, designed to standardize the interaction between AI models (especially Agents) and external tools and data sources. It defines a set of specifications for tool registration, invocation, and permission management — similar to how REST APIs standardized HTTP communication in the web world. Under the MCP architecture, an "MCP server" exposes a set of tools (such as read_document), and Agents discover and invoke these tools through a standard protocol without needing custom integration code for each tool. This means document parsing capabilities can be plugged into any MCP-compatible Agent framework like a plugin, significantly reducing fragmentation in the Agent ecosystem.

Any MCP-compatible client — including Claude Code, Codex, OpenCode, and others — can now natively and economically consume long document content. This means when your coding assistant or AI Agent needs to read a multi-hundred-page technical manual or contract, you no longer need to stuff the entire document into an expensive context window — instead, you parse it efficiently on demand through this tool.

This touches on an important "context window economics" issue. While mainstream LLMs' context windows continue to expand (e.g., Claude supports 200K tokens, Gemini supports 1M tokens), the computational cost of long contexts grows super-linearly with token count — the more input tokens, the higher the memory and compute costs for attention calculations, and API pricing scales accordingly. A 300-page technical document might contain 500K–1M tokens; feeding it directly into the context window could cost tens of dollars per call. Through on-demand parsing via an MCP tool, an Agent can extract only the specific pages or sections needed for the current reasoning step, compressing actual token consumption to a small fraction of the original document. This achieves fine-grained cost control — "parse only what you need."

Deep Dive: Cost and Engineering Value

From an industry perspective, this solution's significance goes well beyond just being "cheap."

On cost: 100,000 pages for $60 means roughly $0.0006 per page. For enterprises that need to process massive document volumes (legal, finance, insurance, medical records digitization), this can reduce OCR costs by one to two orders of magnitude. For comparison, mainstream commercial OCR APIs (such as Azure Document Intelligence and Google Document AI) typically price at $0.01–$0.05 per page, while general-purpose multimodal models like GPT-4o cost even more for document processing. At $0.0006/page, even small and medium-sized businesses can afford million-page digitization projects.

On engineering: It validates an important thesis — as teams behind DeepSeek, GLM, Paddle, and others continue to open-source high-quality OCR VLMs, the moat of closed-source APIs in the document parsing niche is narrowing. Developers gain greater autonomy — they can self-host deployments or use gateway services like this one for managed convenience, while avoiding vendor lock-in.

The introduction of the MCP protocol represents a forward-looking direction. As Agents gradually become the dominant interaction paradigm, how to enable Agents to process external documents at low cost and high efficiency will be critical to their practical utility. Packaging document parsing capabilities as a standard MCP tool and making long document processing a native Agent capability — this design philosophy is highly instructive. It foreshadows a future AI tool ecosystem that increasingly resembles a "microservices architecture" — each capability is standardized and encapsulated, with Agents serving as the orchestration layer that invokes them on demand, rather than cramming all functionality into a single giant model's context window.

Conclusion

The maturation of open-source OCR models, combined with unified API and MCP protocol packaging, is reshaping the technology selection logic for document parsing — a traditional AI task. For developers, the key changes worth paying attention to are: models are pluggable, costs are controllable, outputs are structurable, and Agents can consume them natively. When expensive frontier APIs are no longer the only option, the ability to make fine-grained cost-accuracy tradeoffs based on your specific document characteristics is becoming an increasingly important engineering skill.

#open-source OCR#VLM.run#OpenAI-compatible API#DeepSeek-OCR-2#document parsing#MCP server#structured OCR output
Share:

Related articles