Qianfan-OCR
by baidu
4B unified document intelligence model with Layout-as-Thought reasoning
baidu/Qianfan-OCRmixpeek://image_extractor@v1/baidu_qianfan_ocr_4b_v1Overview
Qianfan-OCR is Baidu's 4B-parameter end-to-end model that unifies document parsing, layout analysis, and document understanding within a single vision-language architecture. Its key innovation is Layout-as-Thought: an optional thinking phase where the model generates structured layout representations (bounding boxes, element types, reading order) before producing final text output, recovering layout grounding capabilities lost by pure end-to-end approaches.
On Mixpeek, Qianfan-OCR extracts text with layout awareness from complex documents including multi-column pages, tables, and forms, powering structured document search where reading order and spatial relationships matter.
Architecture
Three-component VLM: Qianfan-ViT vision encoder (24 Transformer layers, AnyResolution up to 4K, 256 visual tokens per 448x448 tile), 2-layer MLP cross-modal adapter (1024-dim to 2560-dim with GELU), and Qwen3-4B language model backbone (36 layers, GQA 32/8, 32K context extendable to 131K). Layout-as-Thought via think tokens for structured layout prediction.
Mixpeek SDK Integration
// No extractor parameter takes a Hugging Face model id (checked against
// GET /v1/discovery/extractors, which returns 13), so Qianfan-OCR runs
// on your side and the output is upserted through POST
// /v1/namespaces/{namespace_id}/documents/upsert. On Enterprise the other
// path is to upload the weights instead: POST /v1/namespaces/{id}/models
// accepts the huggingface format and a custom plugin loads them.
const res = await fetch(
"https://api.mixpeek.com/v1/namespaces/ns_your_namespace/documents/upsert",
{
method: "POST",
headers: {
Authorization: "Bearer API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
collection_id: "col_your_collection",
documents: [
{
document_id: "asset-00412",
// The model produces text, so it lands in payload. Give the
// collection a text vector index and embed that text to make it
// searchable rather than only filterable.
payload: { extracted_text: modelOutput, source_key: "archive/2026/asset-00412" },
vectors: { "text-embedding": embeddingOfModelOutput },
},
],
}),
},
);
// Managed alternative, if this exact model is not the requirement:
// universal_extractor@v1 runs google/gemini-embedding-2
// (3072-d) over a bucket, with no inference of your own.Capabilities
- Top score on OmniDocBench v1.5 (93.12) among end-to-end models
- Layout-as-Thought reasoning for structured document understanding
- AnyResolution processing up to 4K images
- OCRBench score of 880 (ahead of Qwen3-VL-4B at 873)
- Apache 2.0 open-source
Use Cases on Mixpeek
Benchmarks
| Dataset | Metric | Score | Source |
|---|---|---|---|
| OmniDocBench v1.5 | Score | 93.12 | Baidu, March 2026: Qianfan-OCR paper |
| OCRBench | Score | 880 | Baidu, March 2026: Qianfan-OCR paper |
| DocVQA | Accuracy | 92.8% | Baidu, March 2026: Qianfan-OCR paper |
Performance
Common Pipeline Companions
Explore on Mixpeek
Compare alternatives in this category
Hand-picked tools & platforms compared
Deep-dive technical guide
See how Mixpeek runs models as extractors
Store & search embeddings at scale
Usage-based pricing for pipelines
Compare models, APIs & infrastructure
Specification
Research Paper
Qianfan-OCR: A Unified End-to-End Model for Document Intelligence
arxiv.orgBuild a pipeline with Qianfan-OCR
Add this model to a processing pipeline alongside other extractors. Combine with retrieval stages for end-to-end search.
Run it on your own data, free