Model or dataset
Yuliang-Liu/MonkeyOCR avatar
Yuliang-Liu/MonkeyOCR

MonkeyOCR: one model for layout, text and reading order, shipped as magic_pdf

A lightweight LMM-based Document Parsing Model

6,653 stars458 forksPythonApache-2.0

At a glance

What is it?
MonkeyOCR parses documents into structured text with a multimodal language model instead of chaining separate detection and recognition tools. Two model sizes are offered, the pip package is called magic_pdf, and the repository has no GitHub releases at all, so versions come from the model hubs instead.
Who is it for?
MonkeyOCR fits a team converting PDFs into Markdown or structured text that wants one model doing layout, text and reading order rather than a chain of tools, and that can host a 1.2B or 3B model on a single workstation GPU. It does not fit a team that needs a stable release stream, because this repository publishes no GitHub releases and the newest work has moved to a separate repository.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 5 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 19, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • Yuliang-Liu/MonkeyOCR6,653 ★ · +4
Star history
Repository2026-09-232026-11-19
Yuliang-Liu/MonkeyOCR6.6k6.7k

4 Stars in the last 57 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Structure, recognition and relation come from one model, not a tool chain

The architectural claim is the interesting part. MonkeyOCR adopts a Structure-Recognition-Relation triplet paradigm, which it says simplifies the multi-tool pipeline that modular approaches require while avoiding the inefficiency of using large multimodal models for full-page document processing.

That is a statement about two failure modes at once. Modular OCR stacks bolt a layout detector, a text recognizer and a reading-order resolver together, and each stage passes an intermediate representation to the next. A page-sized multimodal model instead sees the whole page at once but costs far more to run. The SRR formulation is meant to sit in between: one model, asked for the three things it needs, small enough to be cheap.

The paper behind it is titled MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm, authored by Zhang Li, Yuliang Liu, Qiang Liu, Zhiyin Ma, Ziyang Zhang, Shuo Zhang, Zidun Guo, Jiarui Zhang, Xinyu Wang and Xiang Bai, and accepted by SCIENCE CHINA Information Sciences on 2026-07-12.

The pip package is magic_pdf, and it requires Python 3.9

The distribution name does not match the project name, which is the first thing that trips people up. setup.py declares name="magic_pdf" and pulls the version from magic_pdf.libs.version. The description field inside setup.py is the paper title, so the project and the package identify themselves differently depending on where you look.

The packaging is otherwise conventional: find_packages plus an explicit magic_pdf.resources entry, package data covering everything under that resources directory, include_package_data set, and zip_safe disabled. python_requires is >=3.9.

One detail in setup.py is worth knowing if you hit an install problem. parse_requirements reads requirements.txt line by line and, for any line containing http, strips the URL and keeps only the part before the @ character. That is how URL-style requirements get reduced to a package name.

parse.py sits at the repository root, alongside model_configs.yaml and the magic_pdf/ package.

Every dependency that can move is pinned to an exact version

requirements.txt pins several entries hard, and those pins are the first thing to check when the environment breaks.

transformers is held at 4.51.0 exactly, not a range. PyMuPDF is bounded to >=1.24.9 and <=1.24.14. pdfminer.six is pinned to a dated release, 20231228. doclayout_yolo sits at 0.0.2b1, which is a beta, and gradio at 5.23.3, openai at 2.6.1. numpy is held below 2.0.0.

Two of those pins deserve a second look. qwen_vl_utils appears at 0.0.10, a version scheme that carries no stability promise, and doclayout_yolo at a beta tag sits in the same dependency set as the model code, which means a layout component upstream can change under you.

The rest of the list is unpinned or loosely bounded: boto3 for object storage, Brotli, click, fast-langdetect for language detection, loguru for logging, numpy, pydantic for validation, pycocotools for detection annotations, PyYAML, dill, matplotlib, fastapi and uvicorn for the api/ service, and gradio for the demo interface. numpy being capped below 2.0.0 is the kind of constraint that breaks when a neighbouring package drops 2.x support.

Two model sizes, and the throughput table tells you which one to buy

The README publishes pages per second for both model sizes across four GPUs and five document lengths, from 50 to 1000 pages, in two separate tables for standard inference and for VLM OCR mode.

The pattern is consistent. MonkeyOCR-pro-3B on a 3090 sits around 0.49 pages per second, while MonkeyOCR-pro-1.2B on the same card is around 0.62 to 0.69. On a 4090 the 3B model reaches about 1.0 pages per second and the 1.2B model about 1.19 to 1.44. Moving up the GPU ladder helps both, and the gap between them never closes.

So the practical reading is that the 1.2B model delivers between about 1.05 and 1.46 times the throughput of the 3B one on the same hardware in the inference table; the README reports approximately a 36% speed improvement over MonkeyOCR-pro-3B with approximately a 1.6% drop in performance, and separately says MonkeyOCR-pro-1.2B surpasses the original MonkeyOCR-3B by 7.4% on Chinese documents.

Throughput is also flat across document length. A 1000 page document processes at close to the same pages per second as a 50 page one, which says the pipeline is not dominated by per-document setup. That is what makes batch conversion predictable.

The 3B model is the one benchmarked against closed models

The comparison claims split by model size, and that is not an accident. On OmniDocBench, MonkeyOCR-pro-3B is reported as achieving the best overall performance on both English and Chinese documents, outperforming closed-source and extra-large open-source VLMs including Gemini 2.0-Flash, Gemini 2.5-Pro, Qwen2.5-VL-72B, GPT-4o and InternVL3-78B.

The 1.2B model is compared on a different axis. On olmOCR-Bench it outperforms Nanonets-OCR-3B by 7.3%.

Read together, the claims are narrower than the headline suggests. The strongest comparisons against frontier models belong to the 3B checkpoint, which is also the slower one. The 1.2B checkpoint is positioned as the efficient option and is benchmarked against a peer-sized model rather than against GPT-4o.

The weights are on Hugging Face under the echo840 organisation, with separate repositories for MonkeyOCR, MonkeyOCR-pro-3B and MonkeyOCR-pro-1.2B. There is a ModelScope mirror and a hosted demo reachable through WPS AI Write.

No GitHub releases, so version tracking lives on the model hubs

The repository publishes no GitHub releases. That is the single most surprising fact for a project with a paper, a Hugging Face presence and a 2026 news timeline, and it changes how you pin a deployment.

The dates are carried in the README news block instead, as inline code. MonkeyOCR itself was released on 2025-06-05 as an English and Chinese document parsing model, and trended to number two on Hugging Face on 2025-06-12. MonkeyOCR-pro-1.2B arrived on 2025-07-10 as a leaner and faster version. A v1.5 technical report followed on 2025.11.14. MonkeyDoc, a dataset, was released on 2026-01-30 along with details of the data generation pipeline. dots.mocr came on 2026-03-15, and on 2026-04-01 it was reported as achieving the best open-source score on MDPBench, a 17-language document parsing benchmark.

The repository was last pushed on 2026-07-20 and is not archived. Model versions are therefore pinned by Hugging Face revision rather than by a release tag, which is a workflow difference from most Python dependencies.

MonkeyOCRv2 moved the project to a 0.7B parser in a separate repository

The most recent entry in the news block is an important one for anyone planning around this repository. In July 2026, MonkeyOCRv2 was released with a document-native vision backbone plus a 0.7B parser, described as the new open-source state of the art on multilingual document parsing across 17 languages, and released under Apache-2.0.

It does not live here. It is a separate repository, Yuliang-Liu/MonkeyOCRv2, with its own paper and its own demo. A live demo for the v2 work is served on a non-standard port, and an OpenBayes public tutorial is linked from this README.

The direction of travel is toward smaller parsers on purpose-built vision backbones: 3B, then 1.2B, then 0.7B.

The practical consequence for a team evaluating this code today is that the project structure here, with parse.py, model_configs.yaml, the magic_pdf package and the demo scripts, describes the earlier generation. Anyone starting fresh should read the v2 repository first.

Editorial conclusion

MonkeyOCR fits a team converting PDFs into Markdown or structured text that wants one model doing layout, text and reading order rather than a chain of tools, and that can host a 1.2B or 3B model on a single workstation GPU. It does not fit a team that needs a stable release stream, because this repository publishes no GitHub releases and the newest work has moved to a separate repository. Before committing, check three things: which of the two model sizes your hardware can serve, since the 3B model runs at roughly 68 to 96 percent of the pages per second of the 1.2B on the GPUs listed, and whether MonkeyOCRv2 in the separate repository supersedes what is here, since it arrived in July 2026 under Apache-2.0 with a smaller 0.7B parser.

Frequently asked questions

Is there any open source OCR?

MonkeyOCR is one, released under Apache-2.0, with weights published on Hugging Face under the echo840 organisation and a ModelScope mirror.

Which AI OCR is best?

The README's own comparisons differ by model size: MonkeyOCR-pro-3B is reported as best overall on OmniDocBench for English and Chinese documents, beating models including GPT-4o and Gemini 2.5-Pro, while MonkeyOCR-pro-1.2B outperforms Nanonets-OCR-3B by 7.3% on olmOCR-Bench.

How do I install MonkeyOCR?

The setup.py in the repository declares the package name as magic_pdf and requires Python 3.9 or newer. Dependencies come from requirements.txt, where transformers is pinned to 4.51.0 and numpy is held below 2.0.0.

What is the difference between MonkeyOCR-pro-3B and MonkeyOCR-pro-1.2B?

The README reports MonkeyOCR-pro-1.2B as approximately 36% faster than MonkeyOCR-pro-3B with approximately a 1.6% drop in performance, while its 7.4% gain on Chinese documents is measured against the original MonkeyOCR-3B; in the inference table it runs between about 1.05 and 1.46 times the pages per second of pro-3B on the four GPUs listed.

Does MonkeyOCR have version releases I can pin?

No. The repository has no GitHub releases. Versions are tracked through the Hugging Face model repositories, and the newest work, MonkeyOCRv2 with a 0.7B parser, lives in a separate repository under Apache-2.0.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. Yuliang-Liu/MonkeyOCR on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/yuliang-liu-monkeyocr.svg)](https://hysenlabs.com/projects/yuliang-liu-monkeyocr)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/yuliang-liu-monkeyocr.svg)](https://hysenlabs.com/projects/yuliang-liu-monkeyocr)

Was this useful?