Instructions to use moonbox-dev/dots.mocr-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use moonbox-dev/dots.mocr-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf moonbox-dev/dots.mocr-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf moonbox-dev/dots.mocr-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf moonbox-dev/dots.mocr-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf moonbox-dev/dots.mocr-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf moonbox-dev/dots.mocr-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf moonbox-dev/dots.mocr-GGUF:Q4_K_M
Use Docker
docker model run hf.co/moonbox-dev/dots.mocr-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use moonbox-dev/dots.mocr-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "moonbox-dev/dots.mocr-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "moonbox-dev/dots.mocr-GGUF", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/moonbox-dev/dots.mocr-GGUF:Q4_K_M
- Ollama
How to use moonbox-dev/dots.mocr-GGUF with Ollama:
ollama run hf.co/moonbox-dev/dots.mocr-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use moonbox-dev/dots.mocr-GGUF with Docker Model Runner:
docker model run hf.co/moonbox-dev/dots.mocr-GGUF:Q4_K_M
- Lemonade
How to use moonbox-dev/dots.mocr-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull moonbox-dev/dots.mocr-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.dots.mocr-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Download README.md from moonbox-dev/dots.mocr-GGUF: direct link, hf CLI and curl.
- Browser
- Download file 29.8 kB
-
https://huggingface.co/moonbox-dev/dots.mocr-GGUF/resolve/main/README.md
- Command line
-
hf download hf://moonbox-dev/dots.mocr-GGUF/README.md
-
curl -L -o README.md https://huggingface.co/moonbox-dev/dots.mocr-GGUF/resolve/main/README.md
base_model: dots-studio/dots.mocr
base_model_relation: quantized
license: mit
pipeline_tag: image-text-to-text
library_name: gguf
tags:
- gguf
- moonbox
- llama.cpp
- dots-ocr
- dots-mocr
- ocr
- document-parsing
- vision-language
dots.mocr GGUF
GGUF builds of dots.mocr, made by Moonbox for on-device use with llama.cpp
(Metal, CUDA, Vulkan, CPU). Every file is at the root of this repository: one model file per precision, plus the
mmproj-*.gguf file that holds the model's encoder (audio, vision or codec) when it has one. That file is shared by
every precision. Pick a precision by the memory you have.
Files
The last column is the benchmark: the task score of each file on Moonbox's evaluation set for this kind of model (details under How to run), and how often it gives exactly the same output as the BF16 file. The BF16 file holds the original weights unchanged.
| Precision | File | Size | sha256 | Benchmark |
|---|---|---|---|---|
| F16 | dots-mocr-F16.gguf |
3.56 GB | 22d054aaf76e |
CER 0.0 % / 0.0 %; same text as BF16 on 6 + 6 of 12 pages; 0.37 s per page (CUDA) |
| all | mmproj-dots-mocr-F16.gguf |
2.52 GB | f496f64f4e5d |
encoder file, used with every precision |
| BF16 | dots-mocr-BF16.gguf |
3.56 GB | b7856050b98c |
CER 0.0 % / 0.0 % (original 0.0 / 0.0); 0.38 s per page (CUDA) |
| Q8_0 | dots-mocr-Q8_0.gguf |
1.89 GB | 30e7eeb14480 |
CER 0.0 % / 0.0 %; same text as BF16 on 6 + 6 of 12 pages; 0.30 s per page (CUDA) |
| Q6_K | dots-mocr-Q6_K.gguf |
1.46 GB | cba95088307f |
CER 0.0 % / 0.0 %; same text as BF16 on 6 + 6 of 12 pages; 0.29 s per page (CUDA) |
| Q5_K_M | dots-mocr-Q5_K_M.gguf |
1.29 GB | 9869753e30e6 |
CER 0.0 % / 0.0 %; same text as BF16 on 6 + 6 of 12 pages; 0.28 s per page (CUDA) |
| Q4_K_M | dots-mocr-Q4_K_M.gguf |
1.12 GB | 2f0b8138e750 |
CER 0.0 % / 0.0 %; same text as BF16 on 6 + 6 of 12 pages; 0.28 s per page (CUDA) |
How to run
The model file holds the Qwen2 decoder. mmproj-dots-mocr-F16.gguf holds the dots vision transformer and its merger,
kept in F16 for every precision. Both files are needed. With llama.cpp b12621 or newer:
llama-mtmd-cli -m dots-mocr-Q8_0.gguf --mmproj mmproj-dots-mocr-F16.gguf -ngl 99 \
--image page.png -p "Extract the text content from this image." --temp 0
llama-server serves it through /v1/chat/completions: send the page as an image_url part, followed by the
prompt. dots.mocr's other prompts (layout parsing to JSON, grounding) work the same way; they are listed in the
original's dots_mocr/utils/prompts.py.
All 643 tensors of the original checkpoint are byte-identical in the BF16 model file and the mmproj.
Benchmark.
- Set: 12 synthetic pages: 6 English and 6 Chinese sentences of our own, rendered with Windows fonts, so the ground truth is exact.
- Task: the original's text prompt (
prompt_ocr), with greedy decoding. - Run:
llama-server/v1/chat/completionson CUDA (RTX 3080 Laptop). - Score: character error rate per language, whitespace ignored. The original in bf16 (its checkpoint dtype) read all 12 pages exactly (CER 0.0 % / 0.0 %).
- Pass mark: at most the original's CER plus 1 point.
- Same text as BF16: pages where the output is character-for-character the same as the BF16 file's.
How these were made
From dots.mocr at revision 7c53434cd4, with llama.cpp b12621:
convert_hf_to_gguf.pywrote the BF16 model file and themmprojfile.llama-quantizemade the other precisions from the BF16 file, with its standard mixes.- No importance matrix was used.
Before upload, every tensor of the original checkpoint was found with the same values in the BF16 model file and the
mmproj file. The sha256 column above is what the files must hash to.
License
mit. These files are a derivative of the original model and carry its license. The license is copied in this repository, and it governs your use of these files. The original model card follows unchanged.
Introduction
We present dots.mocr. Beyond achieving state-of-the-art (SOTA) performance in standard multilingual document parsing among models of comparable size, dots.mocr excels at converting structured graphics (e.g., charts, UI layouts, scientific figures and etc.) directly into SVG code. Its core capabilities encompass grounding, recognition, semantic understanding, and interactive dialogue.
Simultaneously, we are releasing dots.mocr-svg, a variant specifically optimized for robust image-to-SVG parsing tasks.
More information can be found in the paper.
Evaluation
1. Document Parsing
1.1 Elo Score of different bench between latest models
| models | olmOCR-Bench | OmniDocBench (v1.5) | XDocParse | Average |
|---|---|---|---|---|
| MonkeyOCR-pro-3B | 895.0 | 811.3 | 637.1 | 781.1 |
| GLM-OCR | 884.2 | 972.6 | 820.7 | 892.5 |
| PaddleOCR-VL-1.5 | 897.3 | 997.9 | 866.4 | 920.5 |
| HuanyuanOCR | 997.6 | 1003.9 | 951.1 | 984.2 |
| dots.ocr | 1041.1 | 1027.2 | 1190.3 | 1086.2 |
| dots.mocr | 1104.4 | 1059.0 | 1210.7 | 1124.7 |
| Gemini 3 Pro | 1180.4 | 1128.0 | 1323.7 | 1210.7 |
Notes:
- Results for Gemini 3 Pro, PaddleOCR-VL-1.5, and GLM-OCR were obtained via APIs, while HuanyuanOCR results were generated using local inference.
- The Elo score evaluation was conducted using Gemini 3 Flash. The prompt can be found at: Elo Score Prompt. These results are consistent with the findings on ocrarena.
1.2 olmOCR-bench
| Model | ArXiv | Old scans math | Tables | Old scans | Headers & footers | Multi column | Long tiny text | Base | Overall |
|---|---|---|---|---|---|---|---|---|---|
| Mistral OCR API | 77.2 | 67.5 | 60.6 | 29.3 | 93.6 | 71.3 | 77.1 | 99.4 | 72.0±1.1 |
| Marker 1.10.1 | 83.8 | 66.8 | 72.9 | 33.5 | 86.6 | 80.0 | 85.7 | 99.3 | 76.1±1.1 |
| MinerU 2.5.4* | 76.6 | 54.6 | 84.9 | 33.7 | 96.6 | 78.2 | 83.5 | 93.7 | 75.2±1.1 |
| DeepSeek-OCR | 77.2 | 73.6 | 80.2 | 33.3 | 96.1 | 66.4 | 79.4 | 99.8 | 75.7±1.0 |
| Nanonets-OCR2-3B | 75.4 | 46.1 | 86.8 | 40.9 | 32.1 | 81.9 | 93.0 | 99.6 | 69.5±1.1 |
| PaddleOCR-VL* | 85.7 | 71.0 | 84.1 | 37.8 | 97.0 | 79.9 | 85.7 | 98.5 | 80.0±1.0 |
| Infinity-Parser 7B* | 84.4 | 83.8 | 85.0 | 47.9 | 88.7 | 84.2 | 86.4 | 99.8 | 82.5±? |
| olmOCR v0.4.0 | 83.0 | 82.3 | 84.9 | 47.7 | 96.1 | 83.7 | 81.9 | 99.7 | 82.4±1.1 |
| Chandra OCR 0.1.0* | 82.2 | 80.3 | 88.0 | 50.4 | 90.8 | 81.2 | 92.3 | 99.9 | 83.1±0.9 |
| dots.ocr | 82.1 | 64.2 | 88.3 | 40.9 | 94.1 | 82.4 | 81.2 | 99.5 | 79.1±1.0 |
| dots.mocr | 85.9 | 85.5 | 90.7 | 48.2 | 94.0 | 85.3 | 81.6 | 99.7 | 83.9±0.9 |
Note:
- The metrics are from olmocr, and our own internal evaluations.
- We delete the Page-header and Page-footer cells in the result markdown.
1.3 Other Benchmarks
| Model Type | Methods | Size | OmniDocBench(v1.5) TextEdit↓ |
OmniDocBench(v1.5) Read OrderEdit↓ |
pdf-parse-bench |
|---|---|---|---|---|---|
| GeneralVLMs | Gemini-2.5 Pro | - | 0.075 | 0.097 | 9.06 |
| Qwen3-VL-235B-A22B-Instruct | 235B | 0.069 | 0.068 | 9.71 | |
| gemini3pro | - | 0.066 | 0.079 | 9.68 | |
| SpecializedVLMs | Mistral OCR | - | 0.164 | 0.144 | 8.84 |
| Deepseek-OCR | 3B | 0.073 | 0.086 | 8.26 | |
| MonkeyOCR-3B | 3B | 0.075 | 0.129 | 9.27 | |
| OCRVerse | 4B | 0.058 | 0.071 | -- | |
| MonkeyOCR-pro-3B | 3B | 0.075 | 0.128 | - | |
| MinerU2.5 | 1.2B | 0.047 | 0.044 | - | |
| PaddleOCR-VL | 0.9B | 0.035 | 0.043 | 9.51 | |
| HunyuanOCR | 0.9B | 0.042 | - | - | |
| PaddleOCR-VL1.5 | 0.9B | 0.035 | 0.042 | - | |
| GLMOCR | 0.9B | 0.04 | 0.043 | - | |
| dots.ocr | 3B | 0.048 | 0.053 | 9.29 | |
| dots.mocr | 3B | 0.031 | 0.029 | 9.54 |
Note:
- Metrics are sourced from OmniDocBench and other model publications. pdf-parse-bench results are reproduced by Qwen3-VL-235B-A22B-Instruct.
- Formula and Table metrics for OmniDocBench1.5 are omitted due to their high sensitivity to detection and matching protocols.
2. Structured Graphics Parsing
Visual languages (e.g., charts, graphics, chemical formulas, logos) encapsulate dense human knowledge. dots.mocr unifies the interpretation of these elements by parsing them directly into SVG code.
| Methods | Unisvg | Chartmimic | Design2Code | Genexam | SciGen | ChemDraw | ||
|---|---|---|---|---|---|---|---|---|
| Low-Level | High-Level | Score | ||||||
| OCRVerse | 0.632 | 0.852 | 0.763 | 0.799 | - | - | - | 0.881 |
| Gemini 3 Pro | 0.563 | 0.850 | 0.735 | 0.788 | 0.760 | 0.756 | 0.783 | 0.839 |
| dots.mocr | 0.850 | 0.923 | 0.894 | 0.772 | 0.801 | 0.664 | 0.660 | 0.790 |
| dots.mocr-svg | 0.860 | 0.931 | 0.902 | 0.905 | 0.834 | 0.8 | 0.797 | 0.901 |
Note:
- We use the ISVGEN metric from UniSVG to evaluate the parsing result. For benchmarks that do not natively support image parsing, we use the original images as input, and calculate the ISVGEN score between the rendered output and the original image.
- OCRVerse results are derived from various code formats (e.g., SVG, Python), whereas results for Gemini 3 Pro and dots.mocr are based specifically on SVG code.
- Due to the capacity constraints of a 3B-parameter VLM, dots.mocr may not excel in all tasks yet like svg. To complement this, we are simultaneously releasing dots.mocr-svg. We plan to further address these limitations in future updates.
3. General Vision Tasks
| Model | CharXiv_descriptive | CharXiv_reasoning | OCR_Reasoning | infovqa | docvqa | ChartQA | OCRBench | AI2D | CountBenchQA | refcoco |
|---|---|---|---|---|---|---|---|---|---|---|
| Qwen3vl-2b-instruct | 62.3 | 26.8 | - | 72.4 | 93.3 | - | 85.8 | 76.9 | 88.4 | - |
| Qwen3vl-4b-instruct | 76.2 | 39.7 | - | 80.3 | 95.3 | - | 88.1 | 84.1 | 84.9 | - |
| dots.mocr | 77.4 | 55.3 | 22.85 | 73.76 | 91.85 | 83.2 | 86.0 | 82.16 | 94.46 | 80.03 |
Quick Start
1. Installation
Install dots.mocr
conda create -n dots_mocr python=3.12
conda activate dots_mocr
git clone https://github.com/rednote-hilab/dots.mocr.git
cd dots.mocr
# Install pytorch, see https://pytorch.org/get-started/previous-versions/ for your cuda version
# pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cu128
# install flash-attn==2.8.0.post2 for faster inference
pip install -e .
If you have trouble with the installation, try our Docker Image for an easier setup, and follow these steps:
Download Model Weights
💡Note: Please use a directory name without periods (e.g.,
DotsMOCRinstead ofdots.mocr) for the model save path. This is a temporary workaround pending our integration with Transformers.
python3 tools/download_model.py
# with modelscope
python3 tools/download_model.py --type modelscope
2. Deployment
vLLM inference
We highly recommend using vLLM for deployment and inference. Since vLLM version 0.11.0, Dots OCR has been officially integrated into vLLM with verified performance and you can use vLLM docker image directly (e.g, vllm/vllm-openai:v0.11.0) to deploy the model server.
# Launch vLLM model server
## dots.mocr
CUDA_VISIBLE_DEVICES=0 vllm serve rednote-hilab/dots.mocr --tensor-parallel-size 1 --gpu-memory-utilization 0.9 --chat-template-content-format string --served-model-name model --trust-remote-code
## dots.mocr-svg
CUDA_VISIBLE_DEVICES=0 vllm serve rednote-hilab/dots.mocr-svg --tensor-parallel-size 1 --gpu-memory-utilization 0.9 --chat-template-content-format string --served-model-name model --trust-remote-code
# vLLM API Demo
# See dots_mocr/model/inference.py and dots_mocr/utils/prompts.py for details on parameter and prompt settings
# that help achieve the best output quality.
## document parsing
python3 ./demo/demo_vllm.py --prompt_mode prompt_layout_all_en
## web parsing
python3 ./demo/demo_vllm.py --prompt_mode prompt_web_parsing --image_path ./assets/showcase/origin/webpage_1.png
## scene spoting
python3 ./demo/demo_vllm.py --prompt_mode prompt_scene_spotting --image_path ./assets/showcase/origin/scene_1.jpg
## image parsing with svg code
python3 ./demo/demo_vllm_svg.py --prompt_mode prompt_image_to_svg
## general qa
python3 ./demo/demo_vllm_general.py
Hugginface inference
python3 demo/demo_hf.py
Hugginface inference details
import torch
from transformers import AutoModelForCausalLM, AutoProcessor, AutoTokenizer
from qwen_vl_utils import process_vision_info
from dots_mocr.utils import dict_promptmode_to_prompt
model_path = "./weights/DotsMOCR"
model = AutoModelForCausalLM.from_pretrained(
model_path,
attn_implementation="flash_attention_2",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
image_path = "demo/demo_image1.jpg"
prompt = """Please output the layout information from the PDF image, including each layout element's bbox, its category, and the corresponding text content within the bbox.
1. Bbox format: [x1, y1, x2, y2]
2. Layout Categories: The possible categories are ['Caption', 'Footnote', 'Formula', 'List-item', 'Page-footer', 'Page-header', 'Picture', 'Section-header', 'Table', 'Text', 'Title'].
3. Text Extraction & Formatting Rules:
- Picture: For the 'Picture' category, the text field should be omitted.
- Formula: Format its text as LaTeX.
- Table: Format its text as HTML.
- All Others (Text, Title, etc.): Format their text as Markdown.
4. Constraints:
- The output text must be the original text from the image, with no translation.
- All layout elements must be sorted according to human reading order.
5. Final Output: The entire output must be a single JSON object.
"""
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"image": image_path
},
{"type": "text", "text": prompt}
]
}
]
# Preparation for inference
text = processor.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
padding=True,
return_tensors="pt",
)
inputs = inputs.to("cuda")
# Inference: Generation of the output
generated_ids = model.generate(**inputs, max_new_tokens=24000)
generated_ids_trimmed = [
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)
Hugginface inference with CPU
Please refer to CPU inference
3. Document Parse
Based on vLLM server, you can parse an image or a pdf file using the following commands:
# Parse all layout info, both detection and recognition
# Parse a single image
python3 dots_mocr/parser.py demo/demo_image1.jpg
# Parse a single PDF
python3 dots_mocr/parser.py demo/demo_pdf1.pdf --num_thread 64 # try bigger num_threads for pdf with a large number of pages
# Layout detection only
python3 dots_mocr/parser.py demo/demo_image1.jpg --prompt prompt_layout_only_en
# Parse text only, except Page-header and Page-footer
python3 dots_mocr/parser.py demo/demo_image1.jpg --prompt prompt_ocr
Based on Transformers, you can parse an image or a pdf file using the same commands above, just add --use_hf true.
Notice: transformers is slower than vllm, if you want to use demo/* with transformers,just add
use_hf=TrueinDotsMOCRParser(..,use_hf=True)
Output Results
- Structured Layout Data (
demo_image1.json): A JSON file containing the detected layout elements, including their bounding boxes, categories, and extracted text. - Processed Markdown File (
demo_image1.md): A Markdown file generated from the concatenated text of all detected cells.- An additional version,
demo_image1_nohf.md, is also provided, which excludes page headers and footers for compatibility with benchmarks like Omnidocbench and olmOCR-bench.
- An additional version,
- Layout Visualization (
demo_image1.jpg): The original image with the detected layout bounding boxes drawn on it.
4. Demo
Have fun with the live demo.
Examples for document parsing
Examples for image parsing
Note:
- Inferenced by dots.mocr-svg
Example for web parsing
Examples for scene spotting
Limitation & Future Work
Complex Document Elements:
- Table&Formula: The extraction of complex tables and mathematical formulas persists as a difficult task given the model's compact architecture.
- Picture: We have adopted an SVG code representation for parsing structured graphics; however, the performance has yet to achieve the desired level of robustness.
Parsing Failures: While we have reduced the rate of parsing failures compared to the previous version, these issues may still occur occasionally. We remain committed to further resolving these edge cases in future updates.
Citation
@misc{zheng2026multimodalocrparsedocuments,
title={Multimodal OCR: Parse Anything from Documents},
author={Handong Zheng and Yumeng Li and Kaile Zhang and Liang Xin and Guangwei Zhao and Hao Liu and Jiayu Chen and Jie Lou and Jiyu Qiu and Qi Fu and Rui Yang and Shuo Jiang and Weijian Luo and Weijie Su and Weijun Zhang and Xingyu Zhu and Yabin Li and Yiwei ma and Yu Chen and Zhaohui Yu and Guang Yang and Colin Zhang and Lei Zhang and Yuliang Liu and Xiang Bai},
year={2026},
eprint={2603.13032},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2603.13032},
}