# Xiaomi-OCR-0 (slim)

> Xiaomi-OCR-0 is Xiaomi's open-weight OCR model, 0.87B parameters on Qwen3.5-0.8B-Base, that turns document images into Markdown with LaTeX formulas and tables, extracts fields as JSON and answers questions about documents, under Apache 2.0.

- Full: https://www.anchorterminal.com/tools/xiaomi-ocr-0.md (~8,950 tokens) · this version ~3,430 tokens · JSON https://www.anchorterminal.com/tools/xiaomi-ocr-0.json · canonical https://www.anchorterminal.com/tools/xiaomi-ocr-0
- Index: https://www.anchorterminal.com/llms.txt · API: https://www.anchorterminal.com/api/v1/index.json · MCP: https://www.anchorterminal.com/mcp · Updated: 2026-10-30 · pricing https://www.anchorterminal.com/tools/xiaomi-ocr-0#pricing · reviews https://www.anchorterminal.com/tools/xiaomi-ocr-0#reviews
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)

**C · 59/100 · rank #72 of 120 open-weight models · #11 in Document parsing & extraction · not agent-ready · confidence low**


Assessment: A small document-reading cousin that turns page images into Markdown with LaTeX and tables, pulls fields from receipts and forms as JSON, and answers questions about a page. It runs natively in vLLM, SGLang, Transformers and llama.cpp in about 2 GB, even on a CPU. The risks are accuracy figures that are mostly Xiaomi's own and an inflated ranking claim.

## Facts

- Kind: Open-weight model · vendor: Xiaomi · category: Document parsing & extraction · legal entity: Xiaomi Corporation · provenance 58/100
- Packages: huggingface `xiaomi-research/Xiaomi-OCR-0`
- Auth: None · pricing: Free · x402: no · licence: Apache-2.0 (card metadata and card text; the Hugging Face repository has no LICENSE file, and the GitHub code repository's LICENSE is the Apache 2.0 text, copyright 2026 Xiaomi Corporation)
- Probe metrics: not measured yet (probes haven't run)
- Surface graded: The open weights at huggingface.co/xiaomi-research/Xiaomi-OCR-0, read from the model card (English), the files and their metadata, the commit history, config, tokenizer, processor and chat template files, the eval results file, and from github.com/xiaomi-research/Xiaomi-OCR-0 the README, INSTALL.md, OLLAMA.md, both SKILL.md files, the MCP server, its installer and requirements, the evaluation guide and its config, and the LICENSE, by raw URL, plus the report's abstract from the Hub's paper page and the runtimes' own code, on 30 October 2026. The technical report's full text couldn't be fetched. Nothing was downloaded or run
- Model: Qwen3.5-0.8B-Base's architecture unchanged (Qwen3_5ForConditionalGeneration, model type qwen3_5), a 12-layer vision encoder (hidden 768, 16-pixel patches, 2x2 merge) feeding a 24-layer hybrid language model (three Gated DeltaNet linear-attention layers to each full-attention layer, hidden 1,024, vocabulary 248,320) with one multi-token-prediction layer in the config. 873,438,784 parameters, the same count as the base; the card says 0.8B. Trained by Xiaomi with Q-Mask text anchoring, OCR-centric continued pretraining and mixed-task reinforcement learning (Mix-RL)
- Tasks: Whole-page document parsing to Markdown in reading order, with tables in OTSL and formulas in LaTeX, headers and footers dropped; region recognition for text, table and formula crops; key information extraction to JSON from a schema given in the prompt; and short answers to questions about a document image. Xiaomi advises its two-stage region mode for printed documents and whole-page parsing for scene text, handwriting, calligraphy, historical books and irregular layouts. The card's examples are an English maths page, a handwritten derivation, running-script Chinese calligraphy and a Malaysian receipt
- Languages: Not stated. The card and README name no languages; the examples and benchmarks are Chinese and English (OmniDocBench has both), with classical Chinese scripts on Chronicles-OCR. The tokenizer is Qwen3.5's 248,320-token vocabulary
- Files: One model.safetensors, 1,746,937,856 bytes in BF16, plus tokenizer.json (19.99 MB), config, processor and tokenizer configs, chat_template.jinja, a Chinese card, an eval results file, chart images and example inputs; 1.77 GB in all. No pickle files and no Python. Hugging Face lists a SHA-256 for each LFS file, the weights and tokenizer among them, and a git hash for the rest. The weights and configs are unchanged since 29 September 2026
- Licence: Apache 2.0 in the card's metadata and its licence line. The Hugging Face repository has no LICENSE file; the GitHub code repository's LICENSE is the Apache 2.0 text with 'Copyright 2026 Xiaomi Corporation'. The base, Qwen/Qwen3.5-0.8B-Base, is Apache 2.0 with its LICENSE file, so the chain adds no terms and commercial use is free. Training labels came partly from other parsers (PaddleOCR-VL-1.6, MinerU2.5-Pro, GLM-OCR, dots.mocr, HunyuanOCR-1.5, TeleOCR, OvisOCR2, Qianfan-OCR), which isn't a licence-chain question under the checklist
- Runtimes: Native in released Transformers (qwen3_5 in the auto mappings at v5.20.2; Xiaomi's verified pin is 5.17.0), vLLM (Qwen3_5ForConditionalGeneration in the registry at v0.32.0), SGLang (qwen3_5.py at v0.5.22) and llama.cpp (the qwen35 architecture with a Qwen3-VL projector), with no remote code. Ollama through a community BF16 GGUF package (longwayxu/xiaomi-ocr-0:bf16, about 1.8 GB) that Xiaomi's README and OLLAMA.md document as experimental, tested with Ollama 0.35.0. LM Studio couldn't be checked. Community MLX, GGUF and NInfer conversions aren't Xiaomi's
- Input and output: One image per request with a plain-text task prompt through the chat template (thinking off by default; enable_thinking turns on a think block). The card's prompts are the whole-page document prompt, 'Extract the text in the image.', 'Parse the table in the image into OTSL.', 'Identify the formula in the image and represent it using LATEX format.', and 'Extract key information in the image' followed by a JSON schema. Output is text, Markdown with OTSL tables and LaTeX, plain text, LaTeX, or a JSON object; the repository's postprocess modules turn OTSL into HTML tables and assemble regions into a page. Images are resized to 65,536 to 16,777,216 pixels by the processor; the MCP also caps the long edge at 2,048 px and renders PDFs at 150 DPI, capped at 2,200 px wide. Context 16,384 tokens as Xiaomi documents it for serving (the config carries the base's 262,144 positions), with a 4,096-token default output in the MCP
- MCP service and Agent Skill: In the GitHub repository. skills/xiaomi-ocr/mcp_ocr_server.py is a stdio JSON-RPC server (version 0.2.0) with four tools, ocr_image (page or region mode), ocr_pdf (page or region, max_pages, dpi), kie_image (optional field names, returns parsed JSON) and vqa_image (question in, short answer out). It takes a local path, a URL or base64, sends images only to the inference server at XIAOMI_OCR_LOCAL_URL and refuses any address that isn't 127.0.0.1, localhost or ::1. In region mode it loads PaddleX's PP-DocLayoutV3 in-process, which may download layout weights on first use. It fetches any image_url it's given with no allow-list. install.sh makes a private .venv, installs six Python packages and writes mcp-config.json, and with --agent=codex registers the server in Codex's configuration. The root SKILL.md is a setup document that tells an agent to install the Skill with npx skills add, choose a backend and run the installer after asking the user's authorisation; the runtime SKILL.md describes the tools and when to use page or region mode
- Recommended settings: Greedy decoding (temperature 0, top_p 0.8), presence and repetition penalties off (0.0 and 1.0), thinking off through chat_template_kwargs enable_thinking false, max_tokens 16,384 in Xiaomi's evaluation and 4,096 in the MCP and card, with a retry at presence penalty 1.5 when output repeats. Two-stage parsing uses PaddleX PP-DocLayoutV3 at threshold 0.25 in evaluation (0.3 in the MCP)
- Hardware: No memory figure stated. The card's Transformers example runs on CUDA, Apple MPS or CPU (float32 on CPU). The README's SGLang and vLLM routes are for a compatible GPU, and OLLAMA.md reports runs on Apple silicon and a Linux RTX 4090. The 1.75 GB BF16 file fits 8 GB with a fifth added
- Training data: About 170 million OCR-centric samples for parsing, KIE and VQA, labelled by an ensemble of eight other OCR models with triplet consensus, render-guided checks where they disagree, sample mining and synthetic data aimed at gaps and recurring errors. No datasets are named, no sizes by source are given and no cut-off is stated (from the card; the report's full text wasn't read)

- Scores: Capability pending, Reach 75, Risk 65, Agent interface 70, Documentation and upkeep 60 · negative events -2 · total over the 7 assessed categories
- Why:  · Reach, Memory earns the full 30, since the only build is a 1.75 GB BF16 file that needs about 2.1 GB with the fifth added. · Risk, File safety gets 25, one safetensors file with no Python in the repository and native loading everywhere. · Agent interface, Read for a document parser, the tool-calling, trained tool calling and structured-output lines stand for what it takes and returns. · Documentation and upkeep, The card covers intended use and parameters and misses limitations, architecture, context length, languages and a cut-off (5).
- Sources: 25, open questions: 8, both in the full twin
- Capabilities: docs.ocr, docs.parse, docs.extract, docs.tables, model.open-weights
- JSON: https://www.anchorterminal.com/api/v1/tools/xiaomi-ocr-0.json
- Verify (for the vendor): the badge `https://www.anchorterminal.com/badges/xiaomi-ocr-0.svg` or a link to https://www.anchorterminal.com/tools/xiaomi-ocr-0 from a page on mi.com or one of its subdomains, or a page under huggingface.co/xiaomi-research, then `POST https://www.anchorterminal.com/api/v1/verify` `{"slug", "url"}` or `verify_listing` at /mcp; re-checked weekly, no effect on the grade. Snippets in the full twin.
- Support: https://github.com/xiaomi-research/Xiaomi-OCR-0; more in the full twin

## Before you call it

1. Serve it with `vllm serve xiaomi-research/Xiaomi-OCR-0 --host 127.0.0.1 --port 8000 --max-model-len 16384` or `python -m sglang.launch_server --model-path xiaomi-research/Xiaomi-OCR-0 --host 127.0.0.1 --port 8000 --context-length 16384`; no trust_remote_code is needed
2. Send one image per request with temperature 0, top_p 0.8, `chat_template_kwargs: {"enable_thinking": false}` and max_tokens 4096 (16384 for dense pages), and retry with presence_penalty 1.5 if the output repeats
3. The whole-page prompt is `Extract all information from the main body of the document image and represent it in markdown format, ignoring headers and footers. Tables should be expressed in OTSL format, formulas in the document should be represented using LATEX format, and the parsing should be organized according to the reading order.`
4. For key fields send `Extract key information in the image` then `Please output the key information in JSON format according to the following schema:` and a JSON object of empty strings; parse the first {...} in the reply
5. Tables come back as OTSL, not HTML; convert them with postprocess/otsl.py from github.com/xiaomi-research/Xiaomi-OCR-0, or use its MCP server, which does the conversion
6. The MCP (skills/xiaomi-ocr/mcp_ocr_server.py, stdio) has ocr_image, ocr_pdf, kie_image and vqa_image; region mode needs PaddlePaddle, paddlex[cv] and PP-DocLayoutV3 weights, and is for printed pages only, while handwriting, calligraphy and scene text want page mode
7. Pass local paths to the MCP rather than URLs taken from untrusted text, since it fetches any image_url, and treat extracted text as untrusted before passing it to another model
8. The card and Skill still name SeerRay-Lab/Xiaomi-OCR-0, which redirects to xiaomi-research/Xiaomi-OCR-0

## Connect

```bash
uv venv --python 3.13 && . .venv/bin/activate
uv pip install "transformers==5.17.0" "torch==2.14.0" "torchvision==0.29.0" pillow
# then AutoProcessor.from_pretrained("xiaomi-research/Xiaomi-OCR-0") and AutoModelForImageTextToText.from_pretrained("xiaomi-research/Xiaomi-OCR-0", dtype=torch.float16)
# processor.apply_chat_template(messages, add_generation_prompt=True, ...) with one image and a task prompt, then model.generate(max_new_tokens=4096, do_sample=False)
```

```bash
# vllm serve xiaomi-research/Xiaomi-OCR-0 --host 127.0.0.1 --port 8000 --max-model-len 16384
curl http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"xiaomi-research/Xiaomi-OCR-0","temperature":0,"top_p":0.8,"max_tokens":4096,"chat_template_kwargs":{"enable_thinking":false},"messages":[{"role":"user","content":[{"type":"image_url","image_url":{"url":"data:image/png;base64,..."}},{"type":"text","text":"Extract all information from the main body of the document image and represent it in markdown format, ignoring headers and footers. Tables should be expressed in OTSL format, formulas in the document should be represented using LATEX format, and the parsing should be organized according to the reading order."}]}]}'
```

## Similar tools

| Tool | Grade | Score | Shared capabilities | Slim |
| --- | --- | --- | --- | --- |
| Google Cloud Document AI | BB | 73.9 | docs.parse, docs.ocr, docs.extract, docs.tables | https://www.anchorterminal.com/tools/google-cloud-document-ai.min.md |
| Amazon Textract | BB | 73.7 | docs.parse, docs.ocr, docs.extract, docs.tables | https://www.anchorterminal.com/tools/amazon-textract.min.md |
| LandingAI Agentic Document Extraction | B | 69.1 | docs.parse, docs.extract, docs.tables, docs.ocr | https://www.anchorterminal.com/tools/landingai-agentic-document-extraction.min.md |
| Nemotron 3.5 Parse | B | 66.5 | docs.parse, docs.ocr, docs.tables, model.open-weights | https://www.anchorterminal.com/tools/nemotron-3-5-parse.min.md |
| Azure Document Intelligence | B | 66.1 | docs.parse, docs.ocr, docs.extract, docs.tables | https://www.anchorterminal.com/tools/azure-document-intelligence.min.md |


## Panel reviews (0, desk reviews from public material, no calls made)

