Model reference · open weights
MonkeyOCRv2-B-Parsing is an open-weight language model from zenosai. MonkeyOCRv2-B-Parsing (BF16) weighs 2.0 GB; the smallest configuration that runs it is RTX 3060 12 GB.
What it is
| Released by | zenosai |
|---|---|
| Type | Language models |
| Task | Vision + text |
| Parameters (lead) | 878M |
| Context | 40,960 tokens |
| Runs with | transformers |
| Released | 2026-07-11 |
| Popularity | 1k downloads / month |
| Weights | 2.0 GB (MonkeyOCRv2-B-Parsing (BF16), file size) |
| Licence | Open weights |
What it runs on
Weights 2.0 GB (file size) · KV cache 115 MB per 1,000 tokens of context, at 16 bits (vLLM's default for this build; an 8-bit cache halves it) · runtime overhead from 1.9 GB on a small card · context up to 40,960 tokens.
| Card | Requests at once 8K tokens each | Requests at once 32K tokens each | Longest single request | Counted memory |
|---|---|---|---|---|
| RTX 3060 12 GB | 8 | 2 | all 40K | 11.6 GB |
| RTX 4060 Ti 16 GB | 12 | 3 | all 40K | 15.4 GB |
| RTX 3090 24 GB | 20 | 5 | all 40K | 23.4 GB |
| RTX 4090 24 GB | 20 | 5 | all 40K | 23.4 GB |
| RTX 5090 32 GB | 28 | 7 | all 40K | 31.0 GB |
| L40S 48 GB | 42 | 10 | all 40K | 44.0 GB |
| A100 80 GB | 79 | 19 | all 40K | 78.2 GB |
| H100 80 GB | 74 | 18 | all 40K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 91 | 22 | all 40K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 105 | 26 | all 40K | 107 GB |
| H200 141 GB | 138 | 34 | all 40K | 138 GB |
| B200 180 GB | 178 | 44 | all 40K | 176 GB |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 4.9 GB | 7.7 GB |
| 5 | 8.7 GB | 22.8 GB |
| 8 | 11.5 GB | 34.0 GB |
| 16 | 19.0 GB | 64.1 GB |
| 32 | 34.0 GB | 124 GB |
| 64 | 64.1 GB | 244 GB |
On one card, with vLLM's small-card settings (2,048 tokens a step). Cards of 70 GB and more reserve more per request and more overhead — each row above uses its own card's settings.
Estimates, not measurements, checked against published vLLM startup logs. The weights are the build's file size; the cache is calculated from its config (grouped-query attention); the overhead is an estimate of vLLM's own memory with that card's default settings. "Requests at once" is how many requests of that length vLLM admits — its reservation at full length, with --max-model-len set to that length; requests that stay shorter fit more. "Longest single request" is the most one request can hold there: below the model's maximum, vLLM starts only with --max-model-len set at or under it. "Counted memory" is vLLM's default 92 % of what CUDA reports for the card (the DGX Spark: about 100 GiB of its shared 128 GB). Assumes vLLM 0.10 or later.
From the model card
2026.09.07 🚀 MonkeyOCRv2-Parsing is now supported by RAGFlow as a PDF parser. Thanks to the RAGFlow team and community for the support!2026.08.22 🖥️ We now support running MonkeyOCRv2-Parsing on CPU. See the CPU support instructions.2026.08.17 ⚡ Releasing training and evaluation instructions for Recognition, Detection, Overlapping Text Segmentation and Formula.2026.07.24 ⚡ We released MonkeyOCRv2-B-Parsing-DFlash, enabling vLLM serving with DFlash for up to 2× faster inference.2026.07.22 🏆 MonkeyOCRv2-B-Parsing ranks #1 among evaluated open-source models on the official MDPBench Leaderboard, achieving 83.3 overall across 17 languages, including digital-born and photographed documents.2026.07.21 📦 We release MonkeyDoc v2, an open multilingual corpus for document-oriented pretraining. We hope it can serve as a shared data foundation for more transparent, reproducible, and fair comparisons in Document AI.2026.07.14 🚀 We release MonkeyOCRv2, including MonkeyOCRv2 vision encoder, MonkeyOCRv2-Parsing for multilingual document parsing, MonkeyOCRv2-Und for efficient document understanding.MonkeyOCRv2 is released as a standalone, document-native vision encoder. It can be integrated into different OCR and document AI systems as a visual backbone.
The current release has been evaluated on document parsing, document understanding, text recognition, formula recognition, text detection, document tampering detection, and overlapping-text segmentation.
Beyond these evaluated tasks, the encoder may also be useful for text-rich scenarios such as scientific papers, historical documents, medical reports, charts and tables, and remote-sensing maps or reports. We welcome community exploration of these directions.
from transformers import AutoModel
encoder = AutoModel.from_pretrained(
"zenosai/MonkeyOCRv2-B",
trust_remote_code=True,
dtype="auto",
device_map="auto",
)
See the Vision Encoder Quick Start for installation and feature-extraction examples. If you adapt MonkeyOCRv2 to a new task or domain, feel free to open an issue or pull request and share the results.
MonkeyDoc v2 is currently the largest document image pre-training image-text pair dataset, comprising 113 million document images across 17 languages. The open-sourcing of MonkeyDoc v2 is still underway. So far, we have released 52 million synthetic samples and 52 million real-world samples. You can download the full dataset as follows:
pip install modelscope
modelscope download --dataset zenosai/MonkeyDocv2 --local_dir ./MonkeyDocv2
After processing and compression, downloading the dataset currently requires approximately 10 TB of disk space. We recommend having at least 11 TB of available storage before starting the download to ensure sufficient space throughout the process.
What trust_remote_code=True loads is listed in docs/trust_remote_code.md.
Install transformers and flash attention:
conda create -n MonkeyOCRv2 python=3.11
conda activate MonkeyOCRv2
pip install torch==2.8.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu126
pip install transformers==4.57.1
pip install accelerate==1.11.0
pip install qwen_vl_utils==0.0.14
pip install flash-attn==2.8.3 --no-build-isolation
Download our model from Huggingface.
python download_model.py -n MonkeyOCRv2-B # or MonkeyOCRv2-S / MonkeyOCRv2-AS
You can also download our model from ModelScope.
pip install modelscope
python download_model.py -t modelscope -n MonkeyOCRv2-B # or MonkeyOCRv2-S / MonkeyOCRv2-AS
cd vision
# For MonkeyOCRv2-B and MonkeyOCRv2-S
python extract_feature.py -m ../model_weight/MonkeyOCRv2-B -i ../images_test/ar.JPEG
# For MonkeyOCRv2-AS
python extract_feature_vitae.py -m ../model_weight/MonkeyOCRv2-AS -i ../images_test/ar.JPEG
Install vLLM following its official guide:
conda create -n MonkeyOCRv2Parsing python=3.11
conda activate MonkeyOCRv2Parsing
pip install uv
uv pip install vllm --extra-index-url https://wheels.vllm.ai/0.25.1/cu129 --extra-index-url https://download.pytorch.org/whl/cu129 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r parsing/requirements.txt
To use DFlash for faster inference, vLLM 0.25.1 is required, which depends on CUDA 12.9 or later.
If your system does not support CUDA 12.9, you can instead install vLLM 0.11.2 (without DFlash support)
Quoted from the model card on Hugging Face — the full card is behind the Hugging Face link above.