/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
transformers
Опубликована
11 июн 2026

Qianfan-OCR-GGUF

Изображение и текст → текст15 профессий

Qianfan-OCR — мультимодальная vision-language модель для анализа документов, разработанная командой Baidu Qianfan.

998скачиваний за 30 дней3лайкавеса обновлены11 июн 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Это end-to-end модель с 4 млрд параметров, предназначенная для преобразования изображений документов в Markdown и выполнения задач OCR, анализа структуры и расположения элементов, извлечения таблиц, понимания графиков, ответов на вопросы по документам и извлечения ключевой информации. Представленная версия распространяется в формате GGUF и была создана с использованием llama.cpp.

Архитектура включает vision-энкодер Qianfan-ViT с 24 Transformer-слоями и поддержкой изображений разрешением до 4K, языковую модель Qwen3-4B с контекстом 32K токенов, расширяемым до 131K, а также двухслойный cross-modal adapter. Модель поддерживает OCR на 192 языках. Опциональный режим Layout-as-Thought позволяет сначала сформировать структурированное описание макета с ограничивающими рамками, типами элементов и порядком чтения, что полезно для сложных и неоднородных страниц; для простых документов этот режим можно отключать ради снижения задержки.

Сильными сторонами модели являются единый подход к распознаванию и пониманию документов, поддержка сложной структуры, таблиц и многоязычного OCR. В заявленных результатах она получила 93,12 на OmniDocBench v1.5, 79,8 на OlmOCR Bench и 880 баллов на OCRBench; производительность достигает 1,024 страницы в секунду при W8A8-квантизации на одной GPU A100. Ограничения включают зависимость качества и скорости от разрешения изображений, сложности макета и выбранного режима обработки; конкретные требования к оборудованию для GGUF-версии в карточке не указаны. Модель распространяется по лицензии Apache-2.0.

Для каких профессий подходит15

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qianfan-OCR GGUF Models

Model Generation Details

This model was generated using llama.cpp at commit 7c158fbb4.



🤖 Demo | 📄 Technical Report | 🖥️ Qianfan Platform | 💻 GitHub | 🧩 Skill

Introduction

Qianfan-OCR is a 4B-parameter end-to-end document intelligence model developed by the Baidu Qianfan Team. It unifies document parsing, layout analysis, and document understanding within a single vision-language architecture.

Unlike traditional multi-stage OCR pipelines that chain separate layout detection, text recognition, and language comprehension modules, Qianfan-OCR performs direct image-to-Markdown conversion and supports a broad range of prompt-driven tasks — from structured document parsing and table extraction to chart understanding, document question answering, and key information extraction — all within one model.

Key Highlights

  • 🏆 #1 End-to-End Model on OmniDocBench v1.5 — Achieves 93.12 overall score, surpassing DeepSeek-OCR-v2 (91.09), Gemini-3 Pro (90.33), and all other end-to-end models
  • 🏆 #1 End-to-End Model on OlmOCR Bench — Scores 79.8
  • 🏆 #1 on Key Information Extraction — Overall mean score of 87.9 across five public KIE benchmarks, surpassing Gemini-3.1-Pro, Gemini-3-Pro, Seed-2.0, and Qwen3-VL-235B-A22B
  • 🧠 Layout-as-Thought — An innovative optional thinking phase that recovers explicit layout analysis within the end-to-end paradigm via ⟨think⟩ tokens
  • 🌍 192 Languages — Multilingual OCR support across diverse scripts
  • ⚡ Efficient Deployment — Achieves 1.024 PPS (pages per second) with W8A8 quantization on a single A100 GPU

Architecture

Qianfan-OCR adopts the multimodal bridging architecture from Qianfan-VL, consisting of three core components:

ComponentDetails
Vision EncoderQianfan-ViT, 24 Transformer layers, AnyResolution design (up to 4K), 256 visual tokens per 448×448 tile, max 4,096 tokens per image
Language ModelQwen3-4B (3.6B non-embedding), 36 layers, 2560 hidden dim, GQA (32 query / 8 KV heads), 32K context (extendable to 131K)
Cross-Modal Adapter2-layer MLP with GELU activation, projecting from 1024-dim to 2560-dim

Layout-as-Thought

A key innovation is Layout-as-Thought: an optional thinking phase triggered by ⟨think⟩ tokens, where the model generates structured layout representations (bounding boxes, element types, reading order) before producing final outputs.

This mechanism serves two purposes:

  1. Functional: Recovers layout analysis capability within the end-to-end paradigm — users obtain structured layout results directly
  2. Enhancement: Provides targeted accuracy improvements on documents with complex layouts, cluttered elements, or non-standard reading orders

When to use: Enable thinking for heterogeneous pages with mixed element types (exam papers, technical reports, newspapers). Disable for homogeneous documents (single-column text, simple forms) for better results and lower latency.

Benchmark Results

OmniDocBench v1.5 (Document Parsing)

ModelTypeOverall ↑TextEdit ↓FormulaCDM ↑TableTEDs ↑TableTEDss ↑R-orderEdit ↓
Qianfan-OCR (Ours)End-to-end93.120.04192.4391.0293.850.049
DeepSeek-OCR-v2End-to-end91.090.04890.3187.7592.060.057
Gemini-3 ProEnd-to-end90.330.06589.1888.2890.290.071
Qwen3-VL-235BEnd-to-end89.150.06988.1486.2190.550.068
dots.ocrEnd-to-end88.410.04883.2286.7890.620.053
PaddleOCR-VL 1.5Pipeline94.500.03594.2192.7695.790.042

General OCR Benchmarks

ModelOCRBenchOCRBenchv2 (en/zh)CCOCR-multilanCCOCR-overall
Qianfan-OCR (Ours)88056.0 / 60.7776.779.3
Qwen3-VL-4B87360.68 / 59.1374.276.5
MonkeyOCR65521.78 / 38.9143.835.2
DeepSeek-OCR45915.98 / 38.3132.527.6

Document Understanding

BenchmarkQianfan-OCRQwen3-VL-4BQwen3-VL-2B
DocVQA92.894.992.7
CharXiv_DQ94.081.869.7
CharXiv_RQ85.248.541.3
ChartQA88.183.378.3
ChartQAPro42.936.224.5
ChartBench85.974.973.2
TextVQA80.081.879.9
OCRVQA66.864.759.3

💡 Two-stage OCR+LLM systems score 0.0 on CharXiv (both DQ and RQ), demonstrating that chart structures discarded during text extraction are essential for reasoning.

Key Information Extraction (KIE)

ModelOverallOCRBench KIEOCRBenchv2 KIE (en)OCRBenchv2 KIE (zh)CCOCR KIENanonets KIE (F1)
Qianfan-OCR (Ours)87.995.082.882.392.886.5
Qwen3-VL-235B-A22B84.294.085.662.995.183.8
Qwen3-4B-VL83.589.082.171.391.683.3
Gemini-3.1-Pro79.296.087.863.472.576.1

Inference Throughput

ModelPPS (pages/sec)
Qianfan-OCR (W8A8)1.024
Qianfan-OCR (W16A16)0.503
MinerU 2.51.057
MonkeyOCR-pro-1.2B0.673
Dots OCR0.352

All benchmarks on a single NVIDIA A100 GPU with vLLM 0.10.2.

Supported Tasks

Qianfan-OCR supports a comprehensive set of document intelligence tasks through prompt-driven control:

Task CategorySpecific Tasks
Document ParsingImage-to-Markdown conversion, multi-page parsing, structured output (JSON/HTML)
Layout AnalysisBounding box detection, element type classification (25 categories), reading order
Table RecognitionComplex table extraction (merged cells, rotated tables), HTML output
Formula RecognitionInline and display math formulas, LaTeX output
Chart UnderstandingChart QA, trend analysis, data extraction from various chart types
Key Information ExtractionReceipts, invoices, certificates, medical records, ID cards
Handwriting RecognitionChinese and English handwritten text
Scene Text RecognitionStreet signs, product labels, natural scene text
Multilingual OCR192 languages including Latin, Cyrillic, Arabic, South/Southeast Asian, CJK scripts

Quick Start

Basic Usage

from transformers import AutoModelForImageTextToText, AutoProcessor
import torch
from PIL import Image

MODEL_PATH = "baidu/Qianfan-OCR"
model = AutoModelForImageTextToText.from_pretrained(
    MODEL_PATH,
    torch_dtype=torch.bfloat16,
    device_map="auto",
).eval()
processor = AutoProcessor.from_pretrained(MODEL_PATH)

image = Image.open("./examples/document.png").convert("RGB")
prompt = "Parse this document to Markdown."
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": image},
            {"type": "text", "text": prompt},
        ],
    },
]

inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(model.device)

with torch.no_grad():
    output_ids = model.generate(
        **inputs,
        max_new_tokens=512,
        do_sample=False,
    )

generated_ids = output_ids[:, inputs["input_ids"].shape[1]:]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

With Layout-as-Thought (Thinking Mode)

Enable thinking mode by passing enable_thinking=True to apply_chat_template. The model will first generate structured layout analysis (bounding boxes, element types, reading order), then produce the final output.

image = Image.open("./examples/complex_document.jpg").convert("RGB")
prompt = "Parse this document to Markdown."
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": image},
            {"type": "text", "text": prompt},
        ],
    },
]

inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
    enable_thinking=True,
).to(model.device)

with torch.no_grad():
    output_ids = model.generate(
        **inputs,
        max_new_tokens=16384,
        do_sample=False,
    )

generated_ids = output_ids[:, inputs["input_ids"].shape[1]:]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

Key Information Extraction

image = Image.open("./examples/invoice.jpg").convert("RGB")
prompt = "请从图片中提取以下字段信息:姓名、日期、总金额。使用标准JSON格式输出。"
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": image},
            {"type": "text", "text": prompt},
        ],
    },
]

inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(model.device)

with torch.no_grad():
    output_ids = model.generate(
        **inputs,
        max_new_tokens=16384,
        do_sample=False,
    )

generated_ids = output_ids[:, inputs["input_ids"].shape[1]:]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

vLLM Deployment

# Serve with vLLM for high-throughput inference
vllm serve baidu/Qianfan-OCR --trust-remote-code --hf-overrides '{"architectures": ["InternVLChatModel"]}'

Skill

We provide a Qianfan OCR Document Intelligence skill for image and PDF understanding workflows.

It can be used by users of OpenClaw, Claude Code, Codex, and other assistants that support this skill format. This skill packages reusable instructions, scripts, and references so the agent can automatically apply Qianfan-powered document intelligence to tasks such as:

  • document parsing to Markdown
  • layout analysis
  • element recognition
  • general OCR
  • key information extraction
  • chart understanding
  • document VQA

The skill is designed for visual understanding tasks over images and PDFs, and includes the execution flow needed to prepare inputs, choose the right analysis mode, and call the bundled CLI tools.

Citation

@misc{dong2026qianfanocrunifiedendtoendmodel,
  title={Qianfan-OCR: A Unified End-to-End Model for Document Intelligence},
  author={Daxiang Dong and Mingming Zheng and Dong Xu and Chunhua Luo and Bairong Zhuang and Yuxuan Li and Ruoyun He and Haoran Wang and Wenyu Zhang and Wenbo Wang and Yicheng Wang and Xue Xiong and Ayong Zheng and Xiaoying Zuo and Ziwei Ou and Jingnan Gu and Quanhao Guo and Jianmin Wu and Dawei Yin and Dou Shen},
  year={2026},
  eprint={2603.13398},
  archivePrefix={arXiv},
  primaryClass={cs.CV},
  url={https://arxiv.org/abs/2603.13398},
}

Acknowledgments

We thank the Baidu AI Cloud team for infrastructure support, the Baige and Kunlun teams for AI infrastructure assistance, and all contributors to the Qianfan platform.

License

This project is licensed under the Apache License 2.0. See LICENSE for the full license text.

Some bundled third-party source files are licensed under the MIT License. See NOTICE for the file list and corresponding attribution details.


🚀 If you find these models useful

Help me test my AI-Powered Quantum Network Monitor Assistant with quantum-ready security checks:

👉 Quantum Network Monitor

The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : Source Code Quantum Network Monitor. You will also find the code I use to quantize the models if you want to do it yourself GGUFModelBuilder

💬 How to test:
Choose an AI assistant type:

  • TurboLLM (GPT-4.1-mini)
  • HugLLM (Hugginface Open-source models)
  • TestLLM (Experimental CPU-only)

What I’m Testing

I’m pushing the limits of small open-source models for AI network monitoring, specifically:

  • Function calling against live network services
  • How small can a model go while still handling:
    • Automated Nmap security scans
    • Quantum-readiness checks
    • Network Monitoring tasks

🟡 TestLLM – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):

  • ✅ Zero-configuration setup
  • ⏳ 30s load time (slow inference but no API costs) . No token limited as the cost is low.
  • 🔧 Help wanted! If you’re into edge-device AI, let’s collaborate!

Other Assistants

🟢 TurboLLM – Uses gpt-4.1-mini :

  • **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
  • Create custom cmd processors to run .net code on Quantum Network Monitor Agents
  • Real-time network diagnostics and monitoring
  • Security Audits
  • Penetration testing (Nmap/Metasploit)

🔵 HugLLM – Latest Open-source models:

  • 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.

💡 Example commands you could test:

  1. "Give me info on my websites SSL certificate"
  2. "Check if my server is using quantum safe encyption for communication"
  3. "Run a comprehensive security audit on my server"
  4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a Quantum Network Monitor Agent to run the .net code on. This is a very flexible and powerful feature. Use with caution!

Final Word

I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is open source. Feel free to use whatever you find helpful.

If you appreciate the work, please consider buying me a coffee ☕. Your support helps cover service costs and allows me to raise token limits for everyone.

I'm also open to job opportunities or sponsorship.

Thank you! 😊

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

GGUF-веса поддерживаются только для текстовых LLM (llama.cpp).

Ревизия весов
c186476

0 моделей