OCRZero

Guide · Xiaomi-OCR-0

How to use Xiaomi-OCR-0

Xiaomi-OCR-0 is an open-source document OCR model from Xiaomi with 0.8B parameters, released under the Apache-2.0 license. You can use it in three ways: in the browser, through an OCR API, or on your own GPU server.

Try Xiaomi-OCR-0 online

In short

  • Xiaomi-OCR-0 reads a document image and writes Markdown, with tables in OTSL and formulas in LaTeX.
  • The same model extracts named fields as JSON and answers short questions about a document.
  • It is small (0.8B parameters) and runs on vLLM or SGLang; the license is Apache-2.0.
  • On OCRZero you can try it online or call POST /api/v1/ocr for 1 credit per page.

Option 1: use Xiaomi-OCR-0 online

The quickest way is the online demo on the OCRZero homepage. Nothing to install, and the output is the same Markdown or JSON the API returns.

  1. Choose a task. Page OCR to Markdown, PDF batch, invoice or form fields to JSON, or document Q&A.
  2. Upload the document. A PNG, JPEG or WebP image up to 10 MB, or a PDF of up to 20 pages.
  3. Copy the result. Markdown with HTML tables and LaTeX formulas, a JSON object, or a short answer.

Option 2: call the Xiaomi-OCR-0 API

Create an API key in your OCRZero account and send the file as a base64 data URL to POST /api/v1/ocr with a mode: page, pdf, kie or vqa. Each page uses 1 credit, and failed pages are refunded in the same response.

For invoices and forms, send mode kie with the field names you want, for example invoice_number, invoice_date and total_amount. Fields the model cannot find come back as empty strings.

Option 3: self-host the model

The weights are on Hugging Face. The official instructions serve them with vLLM or SGLang as an OpenAI-compatible server with a 16,384-token context, then send the image together with a fixed prompt. Use the official prompts unchanged: the model was trained on them.

  • Page prompt: extract the main body as Markdown, tables in OTSL, formulas in LaTeX, in reading order.
  • Decoding: temperature 0, top_p 0.8, thinking disabled.
  • Postprocess: convert OTSL tables to HTML and normalise math delimiters with the official postprocess code.

Frequently asked questions

Is Xiaomi-OCR-0 free to use?

The model is free and open source under Apache-2.0, including commercial use. Running it needs a GPU; on OCRZero new eligible accounts get 20 free pages, then $5 per 1,000 pages.

What languages and documents does Xiaomi-OCR-0 read?

It is built for printed documents, scans, screenshots and photos, including tables and formulas. Test your own documents in the online demo before you rely on it for a language or layout.

Is OCRZero made by Xiaomi?

No. OCRZero is an independent service that runs the open-source Xiaomi-OCR-0 model under its Apache-2.0 license. It is not affiliated with or endorsed by Xiaomi.

Sources

Updated 2026-10-31. OCRZero is an independent service running the open-source Xiaomi-OCR-0 model (Apache-2.0, by Xiaomi). Not affiliated with or endorsed by Xiaomi.