---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

[Models](/models)/[Text Extraction](/models?category=text_extraction)/baidu/Qianfan-OCR

HFOCRApache-2.0

# Qianfan-OCR

by baidu

4B unified document intelligence model with Layout-as-Thought reasoning

482Kdl/month

4Bparams

[HuggingFace](https://huggingface.co/baidu/Qianfan-OCR)[Run it on your own data, free](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=model_page&utm_campaign=mvs_onramp)

Identifiers

Model ID

`baidu/Qianfan-OCR`

## Deploy Qianfan-OCR

Single-tenant

Mixpeek has no managed extractor for this model. On a single-tenant deployment you upload the weights and a custom plugin serves them next to the rest of your pipeline.

[Read the customer-hosted guide](https://mixpeek.com/docs/customer-hosted/overview) [Talk to us about single-tenant](/demo)

## Overview

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

IngestRetrieve

// 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

Complex document parsing where layout and reading order matter

Table extraction and structured data output from scanned forms

Enterprise document search with layout-aware text extraction

## 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

Input SizeUp to 4K resolution (AnyResolution, max 4096 visual tokens)

GPU Latency~1s / page (A100, W8A8 quantized)

GPU Throughput~1 page/sec (A100, vLLM W8A8)

GPU Memory~9 GB

## Common Pipeline Companions

[

BAAI/bge-m3

Embed extracted text for multilingual search

](/model/BAAI/bge-m3)[

microsoft/layoutlmv3-base

Complementary layout analysis

](/model/microsoft/layoutlmv3-base)

## Explore on Mixpeek

[

More Text Extraction models

Compare alternatives in this category

](/models?category=text_extraction)[

Best Document AI Platforms

Hand-picked tools & platforms compared

](/curated-lists/best-document-ai-platforms)[

OCR & Document AI Internals

Deep-dive technical guide

](/guides/ocr-document-ai-internals)[

Feature Extractors

See how Mixpeek runs models as extractors

](/extractors)[

Mixpeek Vector Store

Store & search embeddings at scale

](/mvs)[

Pricing

Usage-based pricing for pipelines

](/pricing)[

All Curated Lists

Compare models, APIs & infrastructure

](/curated-lists)

### Specification

FrameworkHF

Organizationbaidu

FeatureOCR

Outputtext + bbox

Modalitiesvideo, image, document

RetrieverText-in-Image

Parameters4B

LicenseApache-2.0

Downloads/mo482K

[

### Research Paper

Qianfan-OCR: A Unified End-to-End Model for Document Intelligence

arxiv.org](https://arxiv.org/abs/2603.13398)

### Build 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](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=model_page&utm_campaign=mvs_onramp)

### Alternative Models

[

microsoft/trocr-large-printed

OCR

](/model/microsoft/trocr-large-printed)[

PaddlePaddle/paddleocr

OCR

](/model/PaddlePaddle/paddleocr)[

zai-org/GLM-OCR

OCR

](/model/zai-org/GLM-OCR)[

lightonai/LightOnOCR-2-1B

OCR

](/model/lightonai/LightOnOCR-2-1B)

### Related in Text Extraction

[

microsoft/codebert-base

Code Extraction

](/model/microsoft/codebert-base)[

Salesforce/codet5p-110m-embedding

Code Extraction

](/model/Salesforce/codet5p-110m-embedding)[

nomic-ai/nomic-embed-code

Code Extraction

](/model/nomic-ai/nomic-embed-code)[

Salesforce/SFR-Embedding-Code-2B\_R

Code Extraction

](/model/Salesforce/SFR-Embedding-Code-2B_R)