Model reference · open weights
MonkeyOCR-B-Parsing is an open-weight language model from zenosai. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | zenosai |
|---|---|
| Type | Language models |
| Task | Vision + text |
| Parameters (lead) | 878M |
| Context | 40k tokens |
| Runs with | transformers |
| Released | 2026-07-11 |
| Popularity | 1k downloads / month |
| Licence | Open weights |
About
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)
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys monkeyocr-b-parsing for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (monkeyocr-b-parsing below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/chat/completions \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"monkeyocr-b-parsing","messages":[{"role":"user","content":"Hello"}]}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.