cheap-ocr 是一个高吞吐量、基于 VLM 的 OCR 工具,能将复杂布局的 PDF 转换为 Markdown 和 JSON,在单张 L40S GPU 上达到每秒 14 页以上的处理速度。

Stars

62

7 天增长

暂无数据

Fork 数

4

开放 Issue

1

开源协议

Apache-2.0

最近更新

2026-07-07

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它结合了版面检测(PP-DocLayoutV3)和 VLM 文本识别(GLM-OCR),在批量 OCR 中实现领先的速度和成本效率,同时内置云存储支持,并可通过 Modal 一键部署。

适合谁使用

  • 需要为大量 PDF 文档提供快速、低价 OCR 的开发者
  • 处理来自云存储的复杂商业文档的数据工程师
  • 从事基于 VLM 的文档理解的研究人员
  • 需要可扩展 OCR 管道且基础设施投入最少的企业

典型使用场景

  • 将监管类 PDF(例如 EMA 文档)批量转换为结构化的 Markdown/JSON
  • 从 S3、Azure 或 GCS 存储桶到云端目标的可恢复 OCR
  • 通过 Python API 集成到数据流水线,支持流式或内存处理

项目优势

  • 实测吞吐量 14.26 页/秒,对比 GLM-OCR SDK 的 5.29 页/秒(单张 L40S)
  • 通过专用版面检测支持复杂布局(标题、表格、图片)
  • 一行命令部署到 Modal(无需本地 GPU)以及裸机 Docker 支持
  • 云原生:支持从/向 S3、Azure、GCS 读写,支持分离运行

使用前须知

  • 需要高性能 NVIDIA GPU(如 L40S)才能达到最佳性能
  • 依赖特定模型版本(PP-DocLayoutV3、GLM-OCR),可能随更新而变化
  • 不适合仅含简单文本的文档,轻量级 OCR 方案可能更合适

README 快速开始

cheap-ocr

cheap-ocr was born from the need to OCR a large corpus of PDF documents with complex layouts quickly and at low cost. It converts PDF documents to markdown and json, including documents with complex layouts and tables. It uses pp-doclayout-v3 for layout detection and GLM-OCR to recognize text. We measured throughput at more than 14 pages per second on our benchmark. For other datasets, we reached up to 20 pages per second. It runs on a single L40S GPU (or similar).

Read our blog to learn all about the optimizations that we apply.

Benchmarks

We use 100 PDF documents from the European Medicines Agency to benchmark throughput. The documents are typical business documents with a mix of tables, text, and some figures. All metrics are reported end-to-end including download and upload. Warm-up (model loading and initialization) is excluded from our measurements. We compare cheap-ocr against the official GLM-OCR SDK. The benchmarks ran on a single L40S for both solutions.

MetricGLM-OCR SDKcheap-ocr
Pages/sec5.2914.26
Output tokens/sec4,31611,801
Page regions/sec75205.4

Features

FeatureDescription
Fast & cheapFastest and cheapest VLM-based OCR that we know of.
VLM-based OCRState-of-the-art text recognition that handles difficult text extraction well.
Layout detectionRecognizes bounding boxes for headings, paragraphs, images, tables, and more.
OCR from cloud storageProcesses PDFs from and writes outputs to S3 buckets, Azure storage containers, or Google Cloud buckets.
One-line deploymentRuns the full pipeline on Modal with a single CLI command.
Bare-metal deploymentRuns on any machine with an NVIDIA GPU.

Use on Modal (easiest, no local GPU required)

Log into Modal or register a new account. If you are already logged in, skip this step.

uvx --python 3.12 modal login

Then run cheap-ocr directly with uvx; no project files or persistent install are needed. The local command only needs the modal extra. The GPU stack is installed in the remote Modal image.

# run with local files
# startup takes a few minutes because models need to be loaded and CUDA graphs c

项目描述

OCR with VLMs running on a single GPU with high throughput

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
littledivy
精选
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI 与机器学习
1,482