explaingit

blue-guardrails/cheap-ocr

Analysis updated 2026-05-18

56PythonAudience · developerComplexity · 4/5Setup · hard

TLDR

A fast GPU-based tool that converts large batches of PDFs into markdown and JSON, using layout detection plus a vision language model for OCR.

Mindmap

mindmap
  root((repo))
    What it does
      Layout detection
      VLM OCR
      Batch processing
    Tech stack
      Python
      GLM-OCR
      vLLM
    Use cases
      PDF to markdown
      Cloud storage OCR
      High throughput OCR
    Audience
      Developers
      Data teams

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Convert a large batch of complex PDFs into markdown and structured JSON.

USE CASE 2

Extract tables and layout regions from business documents at high throughput.

USE CASE 3

Run OCR on PDFs stored in S3, Azure, or Google Cloud without downloading them first.

USE CASE 4

Call the OCR engine directly from Python code to process documents in memory.

What is it built with?

PythonGLM-OCRvLLMDockerCUDA

How does it compare?

blue-guardrails/cheap-ocreadmin2/jarvis_aigreatvishal27-rc/ai-resume_analyzer
Stars565656
LanguagePythonPythonPython
Setup difficultyhardhardmoderate
Complexity4/54/52/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Needs an NVIDIA GPU (or a Modal account) plus Docker or a Python environment with GPU extras.

In plain English

cheap-ocr is a tool for turning large batches of PDF documents into clean markdown and JSON, even when those PDFs have complicated layouts full of tables and mixed content. It was built for the specific problem of processing a big collection of PDFs quickly and cheaply. Under the hood it uses one model to detect the layout of a page, such as where headings, paragraphs, tables, and images are, and a separate vision language model called GLM-OCR to actually read the text out of each region. The project's main selling point is speed on a single GPU. Using 100 real business documents from the European Medicines Agency as a benchmark, the authors measured about 14 pages processed per second on one L40S graphics card, and up to 20 pages per second on other datasets. They compare this against the official GLM-OCR software development kit doing the same job, where cheap-ocr comes out several times faster on pages per second, output tokens per second, and detected page regions per second. There are three main ways to run it. The simplest is through a service called Modal, which needs no GPU of your own, using a single command line call that can read PDFs from a local folder or from cloud storage like S3, Azure, or Google Cloud, and write results back there too. The second way is running it yourself on any machine with an NVIDIA GPU, either through Docker or by installing it into a Python virtual environment. The third way is calling it directly from Python code, where you start an engine object, then process a single PDF in memory, stream through many documents as they finish, or run a full folder or cloud bucket to another one. For every PDF it processes, cheap-ocr writes out a markdown file, a JSON file describing the page layout, and a stats file with timing and token usage, plus an overall summary file for the whole run. Almost every setting, such as image quality, how many pages are processed at once, and GPU memory use, can be set through command line flags, environment variables, or code, and this project is aimed at developers who need to process large PDF collections at scale rather than casual users.

Copy-paste prompts

Prompt 1
Walk me through running cheap-ocr on Modal without owning a GPU myself.
Prompt 2
Show me how to call cheap-ocr's DocumentEngine from Python to OCR a single PDF in memory.
Prompt 3
Explain how cheap-ocr's throughput compares to the official GLM-OCR SDK on the same GPU.
Prompt 4
Help me configure cheap-ocr's page-chunk-size and GPU memory settings for a bare metal server.

Frequently asked questions

What is cheap-ocr?

A fast GPU-based tool that converts large batches of PDFs into markdown and JSON, using layout detection plus a vision language model for OCR.

What language is cheap-ocr written in?

Mainly Python. The stack also includes Python, GLM-OCR, vLLM.

How hard is cheap-ocr to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cheap-ocr for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.