Xiaomi-OCR-0 is a unified 0.8B vision-language model for document parsing and OCR-centric understanding. Starting from Qwen3.5-0.8B, it is trained on an approximately 170M-sample OCR-centric corpus with Q-Mask text anchoring, continued pretraining (CPT), and mixed-task reinforcement learning (Mix-RL).
## 🏆 Benchmark highlights
- 🥇 **95.24** on Real5-OmniDocBench, ranked **#1** in the comparison on this page.
- 🥈 **96.83** on OmniDocBench v1.6 and **87.94** on Wild-OmniDocBench, both ranked **#2** in the comparisons on this page.
- 📐 **97.84** on UniMER-Test (formula recognition) and **92.27 TEDS** on PubTabNet (table recognition).
- ✍️ Historical handwriting and calligraphy: **73** on Chronicles-OCR Mature Scripts (Clerical, Cursive, Running, and Regular scripts), on par with Seed 2.0 Pro(72).
- 🧠 Mean score of **83.2** across five OCR-centric VQA benchmarks, exceeding Qwen3.5-2B (**80.9**) with **0.8B** parameters.
The document parsing benchmark results above (Real5-OmniDocBench, OmniDocBench v1.6, and Wild-OmniDocBench) all use the two-stage method. See [evaluation_pipeline](evaluation_pipeline/README.md) for the evaluation procedure.
see [Key Performance](#key-performance) for the comparison tables and scope.
## 📰 News
- **2026-10-08:** Thanks to the community for supporting Xiaomi-OCR-0 and sharing new formats: [prithivMLmods’ GGUF](https://huggingface.co/prithivMLmods/Xiaomi-OCR-0-GGUF), [xzl01’s GGUF](https://github.com/xzl01/Xiaomi-OCR-0-GGUF), and [ByronLeeee’s BF16 NInfer conversion](https://huggingface.co/ByronLeeee/Xiaomi-OCR-0-Ninfer).
- **2026-09-30:** Technical report published and model weights released.
## What it does
- **Document parsing:** reads document pages and produces structured Markdown, with OTSL model outputs converted to HTML tables in Markdown and formulas in LaTeX.
- **Key information extraction (KIE):** extracts requested fields as JSON.
- **OCR-centric visual question answering (VQA):** answers questions about text and content in document images.
- **Local agent tools:** an MCP service handles prompts, PDF/image preparation, optional region detection, parallel crop inference, and output assembly.
- **Browser demo:** try page and region parsing through a local web interface.
For printed, regular documents, region parsing can detect and process regions concurrently. For scene text, handwriting, calligraphy, historical books, and irregular layouts, use whole-page parsing because incorrect region boundaries can lose context.
## Repository contents
| Path | Contents |
|:--|:--|
| [`skills/xiaomi-ocr/`](skills/xiaomi-ocr/) | Agent Skill and MCP service for OCR, PDF parsing, KIE, and VQA |
| [`demo/`](demo/) | Local browser demo and sample cases |
| [`example_pics/`](example_pics/) | Example inputs, reference Markdown, and demo animations mirrored from the Hugging Face model repository |
| [`evaluation_pipeline/`](evaluation_pipeline/) | Reproducible e2e / two-stage inference and evaluation |
| [`postprocess/`](postprocess/) | Shared table conversion, formula/text assembly and repetition handling |
| [Hugging Face model](https://huggingface.co/SeerRay-Lab/Xiaomi-OCR-0) | Model card, examples, and benchmark assets |
| [ModelScope model](https://www.modelscope.cn/models/SeerRay-Lab/Xiaomi-OCR-0) | Model card, examples, and benchmark assets |
| [Hugging Face Space](https://huggingface.co/spaces/SeerRay-Lab/Xiaomi-OCR-0/tree/main) | Space assets and project-page source |
| [`examples/`](examples/) | MCP configuration example |
## Installation
Choose one of two setup paths:
- [Try it with an agent](#try-it-with-an-agent): let your agent install the local model and configure the MCP service.
- [Manual installation](#manual-installation): get the code, choose an inference runtime, and run the browser demo yourself.
### Try it with an agent
> ⚠️ **Notice:** With your authorization, this Skill may create a Python environment, install dependencies, download model weights, install and configure the selected inference runtime (SGLang, vLLM, or Ollama), and register an MCP server. Model and layout downloads can be large. If you do not agree to this setup flow, do not execute the command below.
Copy and send this to your agent:
```text
Read and execute https://raw.githubusercontent.com/SeerRay-Lab/Xiaomi-OCR-0/main/SKILL.md
```
The model will run on your machine. For a complete setup, the agent also installs the
region-mode dependencies (PaddlePaddle, PaddleX and PP-DocLayoutV3) under your setup
authorization and verifies region parsing. You can request page-only setup. If your
platform does not support the layout runtime, the agent will explain the limitation.
### Manual installation
Python 3.10 or newer is required. Get the repository first, then choose **one** runtime: [SGLang / vLLM](#sglang--vllm) or [Ollama](#ollama-experimental). To use region parsing, also install the [optional layout dependencies](#optional-region-mode-dependencies).
For manual MCP setup, see [INSTALL.md](INSTALL.md); Ollama-specific setup is covered in [OLLAMA.md](OLLAMA.md).
#### Get the repository
```bash
git clone https://github.com/SeerRay-Lab/Xiaomi-OCR-0.git
cd Xiaomi-OCR-0
```
#### SGLang / vLLM
You can run the browser demo without installing the Agent Skill or MCP server. The demo sends requests to a local SGLang or vLLM inference server at `http://127.0.0.1:8000/v1`.
##### 1. Install an inference runtime
If a compatible local server is already running at the address above, skip to step 3. Otherwise, choose **one** runtime and follow its installation guide for your operating system, GPU, and driver. These runtimes have hardware-specific requirements; the linked guides list supported platforms and installation options:
- [SGLang installation guide](https://docs.sglang.ai/get_started/install.html) · [supported models](https://docs.sglang.io/docs/supported-models/multimodal_language_models.md)
- [vLLM GPU installation guide](https://docs.vllm.ai/en/latest/getting_started/installation/gpu/) · [Qwen3.5 model support](https://docs.vllm.ai/en/latest/api/vllm/model_executor/models/qwen3_5/)
Use a release that supports the checkpoint architecture `Qwen3_5ForConditionalGeneration`. For macOS and non-NVIDIA hardware, check the runtime's platform-specific support before installing; the default commands below are for a compatible GPU installation.
##### 2. Start Xiaomi-OCR-0
Run **one** of the following commands in a terminal. On first launch, the runtime downloads the checkpoint from Hugging Face if it is not already cached. Keep this terminal open while using the demo.
SGLang:
```bash
python -m sglang.launch_server --model-path SeerRay-Lab/Xiaomi-OCR-0 \
--host 127.0.0.1 --port 8000 --context-length 16384
```
vLLM:
```bash
vllm serve SeerRay-Lab/Xiaomi-OCR-0 \
--host 127.0.0.1 --port 8000 --max-model-len 16384
```
Wait for the server to finish loading the model before continuing.
##### 3. Start the browser demo
Open a second terminal in the repository directory and run:
```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python demo/server.py --port 8787
```
Open