Views
No views yet


mineru-vl-utils, a Python package that simplifies the process of sending requests and handling responses from MinerU2.5 Vision-Language Model. Here we give some examples to use MinerU2.5. For more information and usages, please refer to mineru-vl-utils.vllm-async-engine can achieve a concurrent inference speed of 2.12 fps on one A100.1# For `transformers` backend
2pip install "mineru-vl-utils[transformers]"
3# For `vllm-engine` and `vllm-async-engine` backend
4pip install "mineru-vl-utils[vllm]"| Track | Requirement | Best for |
|---|---|---|
| 🖥️ Self-hosted | GPU (A100 recommended) | Research, private deployment |
| ☁️ Cloud API | API token (free tier available) | Production use, no GPU needed |
1pip install "mineru-vl-utils[transformers]"
2from transformers import AutoProcessor, Qwen2VLForConditionalGeneration
3from PIL import Image
4from mineru_vl_utils import MinerUClient
5
6model = Qwen2VLForConditionalGeneration.from_pretrained(
7 "opendatalab/MinerU2.5-2509-1.2B", dtype="auto", device_map="auto"
8)
9processor = AutoProcessor.from_pretrained(
10 "opendatalab/MinerU2.5-2509-1.2B", use_fast=True
11)
12client = MinerUClient(backend="transformers", model=model, processor=processor)
13print(client.two_step_extract(Image.open("/path/to/page.png")))1# pip install "mineru-vl-utils[vllm]"
2from vllm import LLM
3from PIL import Image
4from mineru_vl_utils import MinerUClient, MinerULogitsProcessor
5
6client = MinerUClient(
7 backend="vllm-engine",
8 vllm_llm=LLM(model="opendatalab/MinerU2.5-2509-1.2B",
9 logits_processors=[MinerULogitsProcessor])
10)
11print(client.two_step_extract(Image.open("/path/to/page.png")))1# pip install "mineru-vl-utils[vllm]"
2import asyncio, io, aiofiles
3from vllm.v1.engine.async_llm import AsyncLLM
4from vllm.engine.arg_utils import AsyncEngineArgs
5from PIL import Image
6from mineru_vl_utils import MinerUClient, MinerULogitsProcessor
7
8async_llm = AsyncLLM.from_engine_args(
9 AsyncEngineArgs(model="opendatalab/MinerU2.5-2509-1.2B",
10 logits_processors=[MinerULogitsProcessor])
11)
12client = MinerUClient(backend="vllm-async-engine", vllm_async_llm=async_llm)
13
14async def main():
15 async with aiofiles.open("/path/to/page.png", "rb") as f:
16 image = Image.open(io.BytesIO(await f.read()))
17 print(await client.aio_two_step_extract(image))
18
19asyncio.run(main())
20async_llm.shutdown()1# Windows (PowerShell)
2irm https://cdn-mineru.openxlab.org.cn/open-api-cli/install.ps1 | iex
3
4# macOS / Linux
5curl -fsSL https://cdn-mineru.openxlab.org.cn/open-api-cli/install.sh | sh
6
7# Flash extract — no login, Markdown only
8mineru-open-api flash-extract report.pdf
9
10# Precision extract — token required
11mineru-open-api auth
12mineru-open-api extract report.pdf -o ./output/1# pip install mineru-open-sdk
2from mineru import MinerU
3
4# Flash mode — free, no token
5result = MinerU().flash_extract("report.pdf")
6print(result.markdown)
7
8# Precision mode — tables, formulas, large files
9client = MinerU("your-token") # https://mineru.net/apiManage/token
10result = client.extract("report.pdf")
11print(result.markdown)1# pip install langchain-mineru
2from langchain_mineru import MinerULoader
3
4# Flash mode — free, no token
5docs = MinerULoader(source="report.pdf").load()
6print(docs[0].page_content)
7
8# Precision mode — full RAG pipeline
9from langchain_text_splitters import RecursiveCharacterTextSplitter
10from langchain_openai import OpenAIEmbeddings
11from langchain_community.vectorstores import FAISS
12
13docs = MinerULoader(source="manual.pdf", mode="precision", token="your-token",
14 formula=True, table=True).load()
15chunks = RecursiveCharacterTextSplitter(chunk_size=1200, chunk_overlap=200).split_documents(docs)
16vectorstore = FAISS.from_documents(chunks, OpenAIEmbeddings())
17results = vectorstore.similarity_search("key requirements", k=3)1# pip install llama-index-readers-mineru
2from llama_index.readers.mineru import MinerUReader
3
4# Flash mode — free, no token
5docs = MinerUReader().load_data("report.pdf")
6print(docs[0].text)
7
8# Precision mode — OCR, formula, table
9docs = MinerUReader(mode="precision", token="your-token",
10 ocr=True, formula=True, table=True).load_data("paper.pdf")
11
12# Full RAG pipeline
13from llama_index.core import VectorStoreIndex
14index = VectorStoreIndex.from_documents(docs)
15response = index.as_query_engine().query("Summarize the key findings")
16print(response)1{
2 "mcpServers": {
3 "mineru": {
4 "command": "uvx",
5 "args": ["mineru-open-mcp"],
6 "env": { "MINERU_API_TOKEN": "your-token" }
7 }
8 }
9}









1@misc{niu2025mineru25decoupledvisionlanguagemodel,
2 title={MinerU2.5: A Decoupled Vision-Language Model for Efficient High-Resolution Document Parsing},
3 author={Junbo Niu and Zheng Liu and Zhuangcheng Gu and Bin Wang and Linke Ouyang and Zhiyuan Zhao and Tao Chu and Tianyao He and Fan Wu and Qintong Zhang and Zhenjiang Jin and others},
4 year={2025},
5 eprint={2509.22186},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2509.22186},
9}