Usage Guide
|
🚀 Free API Try it online for free, then call the API from your own code. Playground (CN / Global) API docs (CN / Global) |
🤖 Agent Skill One prompt: the agent installs it and parses your first document. SKILL.md |
💻 Self-hosting vLLM / SGLang / llama.cpp / Ollama, plus an official Docker image. Data stays on your side. Deployment guide |
📱 Mobile App On-device and offline. Document parsing is iOS-only for now. iOS Demo |
Demo (CN / Global) · GitHub · SDK usage · DSpark · Discord | 中文
This repository hosts the DSpark draft (speculative decoding) head for MiniCPM-OCR 1.0. It is a draft model, not a standalone OCR model — it must be paired with the matching main checkpoint.
DSpark speeds up decoding with a small draft model that proposes tokens the main model then verifies in one pass. With this head, MiniCPM-OCR 1.0 improves end-to-end processing efficiency by 55%; throughput reaches about 1.49× PaddleOCR-VL-1.6 and 3.62× MinerU2.5 Pro.
| Property | Value |
|---|---|
| Target model | MiniCPM-OCR 1.0 (1.3B) |
| Draft parameters | 296,837,889 |
| Draft layers | 5 |
| Draft tokens per forward pass | 15 |
| Target hidden-state layers | [3, 7, 11, 15, 19] |
| Checkpoint precision | BF16 |
| Input vocabulary | 248,100 |
| Draft output vocabulary | 114,688 |
The output LM head and the Markov output rows are cropped to 114,688 tokens. The checkpoint keeps
its d2t offset mapping and the full input vocabulary; local-to-target.json holds the
corresponding absolute target token IDs.
Note on
d2t: in this checkpoint the tensor is delta-encoded (target_id - draft_id). It must be converted to absolute IDs (d2t[i] + i) before use — the GGUF build already does this, andlocal-to-target.jsonis the ground truth to verify against.
MiniCPM-OCR 1.0 parses full documents as a two-stage pipeline orchestrated by the minicpm-ocr SDK. The two stages use separate models, run in separate environments, and may run on different machines:
See the model guide for more on architecture, parsing workflow, deployment options, and benchmark breakdowns.
vllm serve openbmb/MiniCPM-OCR-1.0 \
--served-model-name MiniCPM-OCR \
--trust-remote-code \
--max-model-len 40960 \
--max-num-batched-tokens 40960 \
--max-num-seqs 1 \
--trust-request-mm-kwargs \
--mm-processor-kwargs '{"downsample_mode":"4x","max_slice_nums":9}' \
--speculative-config '{"method":"dspark",
"model":"openbmb/MiniCPM-OCR-1.0-DSpark",
"num_speculative_tokens":15,
"enable_adaptive_verification":false}' \
--default-chat-template-kwargs '{"enable_thinking":false}'Selection and tuning: DSpark acceleration.
| Format | Hugging Face | ModelScope |
|---|---|---|
| BF16 (original) | 🤗 | ModelScope |
| GGUF (llama.cpp) | 🤗 | ModelScope |
| AWQ W4A16 | 🤗 | ModelScope |
| GPTQ W4A16 | 🤗 | ModelScope |
| DSpark draft (BF16) (this repo) | 🤗 | ModelScope |
| DSpark draft (GGUF) | 🤗 | ModelScope |
DSpark requires a matching main and draft model from the same release; do not pair this draft with a different main checkpoint.
Installation, model downloads, GPU memory, input formats, and unexpected outputs: FAQ.
Model weights, code, and documentation are released under the Apache License 2.0.