Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
Update documentation to reflect changes in command names and structure for MinerU 4.0 migration
myhlolida88191f014b
diff --git a/README.md b/README.mdindex c2b00347..2fa3f903 100644--- a/README.md+++ b/README.md@@ -13,9 +13,15 @@ MinerU is not a RAG framework, vector database, or chat-with-doc application.This skill mainly uses the `mineru` command.-## Pre-release Status+## MinerU 4.0-The current MinerU release line is in Beta pre-release. Package installers normally prefer stable releases, so explicitly enable pre-release resolution whenever installing or upgrading MinerU from a package index. The installation commands in this skill already include the required installer-specific options.+This guide targets MinerU 4.0 stable. Four parsing tiers, native document formats, a searchable local library,+and page/block continuation support agent reading. Small-model backends (ONNX/Torch) and VLM engines+(llama.cpp/vLLM/LMDeploy, or explicitly configured MLX) are independent. Python SDK, V1 API, stateless batch+conversion, Router, and WebUI share structured document results.++See [English](README_en.md), [简体中文](README_zh.md), and the [4.0 migration guide](https://opendatalab.github.io/MinerU/reference/migration_4/).+Existing AMD and vendor accelerator adaptations remain on [MinerU <4](https://opendatalab.github.io/MinerU/usage/compatibility/).## Skill Installation@@ -57,8 +63,8 @@ Use MinerU for local document files such as:| OpenDocument | `.odt`, `.ods`, `.odp` || EPUB | `.epub`, parsed as a full document in OPF spine order with source internal links preserved || OFD | `.ofd` |-| HTML | `.html`, `.htm` |-| CSV | `.csv` |+| HTML | `.html`, `.htm`, `.shtml` |+| CSV / TSV | `.csv`, `.tsv` |PDF and images support every quality tier (`flash`, `basic`, `standard`, `advanced`). Office, HTML, CSV, EPUB, and OFD files are parsed locally at the `flash` tier. Plain-text files (`.txt`, `.md`, `.markdown`, `.rst`, `.tex`) are not parsed; read them directly.@@ -129,7 +135,7 @@ mineru read "doc:ab12cd3/tier:standard/page:18" --json## Installation And Setup-This skill requires MinerU `>=4.0.0b1`. Before using any workflow, check whether the CLI is installed:+This skill requires MinerU `>=4.0,<5`. Before using any workflow, check whether the CLI is installed:```bashcommand -v mineru@@ -143,7 +149,7 @@ mineru version --jsonIf `mineru version --json` fails, try `mineru --version` for older CLIs. If the detected version does not meet this requirement, tell the user which version was found and ask before upgrading it. If approved, upgrade with the same installer and environment, then check the version again. If declined, stop and do not run this skill's commands. Never assume compatibility when the version cannot be determined.-MinerU requires Python `>=3.10,<3.14`.+MinerU requires Python `>=3.10,<3.15`. Optional engines also need compatible wheels, drivers, and devices; the package range alone does not guarantee engine availability.### Upgrade An Existing Installation@@ -156,12 +162,12 @@ mineru server stopmineru server status --json```-Use the matching upgrade command only after the user approves the upgrade:+Use the matching upgrade command only after the user approves the upgrade. Preserve any extras and tool options already used by that installation (for example, keep `[full]` when reinstalling with pipx):```bash-uv tool upgrade --prerelease allow mineru-pipx upgrade mineru --pip-args="--pre"-"<environment-python>" -m pip install --upgrade --pre mineru+uv tool upgrade "mineru>=4.0,<5"+pipx install --force "mineru>=4.0,<5"+"<environment-python>" -m pip install --upgrade "mineru>=4.0,<5"```If the owner cannot be determined, multiple installations exist, or MinerU is installed from source or in editable mode, ask the user instead of upgrading. After upgrading, check the resolved executable and its version again.@@ -177,6 +183,7 @@ If no supported interpreter is available, install Python 3.12 with `uv` as a concommand -v uvuv python find 3.12uv python find 3.13+uv python find 3.14uv python find 3.11uv python find 3.10```@@ -190,7 +197,7 @@ uv python install 3.12Then install MinerU with the supported interpreter that was found, or with Python 3.12 if it was installed as the fallback:```bash-uv tool install --python 3.12 --prerelease allow mineru+uv tool install --python 3.12 "mineru>=4.0,<5"```### Install with `pipx`@@ -204,24 +211,24 @@ PIPX_DEFAULT_PYTHON="$(pipx environment --value PIPX_DEFAULT_PYTHON)""$PIPX_DEFAULT_PYTHON" --version```-Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.10,<3.14`, install with `pipx`:+Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.10,<3.15`, install with `pipx`:```bash-pipx install --pip-args="--pre" mineru+pipx install "mineru>=4.0,<5"```-If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.10,<3.14`.+If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.10,<3.15`.```bashcommand -v python3.12python3.12 --version-pipx install --python python3.12 --pip-args="--pre" mineru+pipx install --python python3.12 "mineru>=4.0,<5"```If no supported system interpreter is available and `pipx` supports Python fetching, ask for approval before downloading a standalone Python:```bash-pipx install --python 3.12 --fetch-python=missing --pip-args="--pre" mineru+pipx install --python 3.12 --fetch-python=missing "mineru>=4.0,<5"```### Install with global `pip`@@ -229,19 +236,19 @@ pipx install --python 3.12 --fetch-python=missing --pip-args="--pre" mineruIf neither `uv` nor `pipx` is available, but `pip` or `pip3` is available, check the Python version of the `pip` command, and ask the user before installing into the global python environment:```bash-which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 # find all available pips+which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pipspip --version```-If a `pip` command reports Python `>=3.10,<3.14`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:+If a `pip` command reports Python `>=3.10,<3.15`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:```bash-pip install --pre mineru+pip install "mineru>=4.0,<5"```### If No Supported Installer Is Available-If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.10,<3.14`, recommend that the user install `uv` first.+If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.10,<3.15`, recommend that the user install `uv` first.### After Installation@@ -275,9 +282,7 @@ MinerU may collect anonymous, locally aggregated usage and diagnostic telemetryTelemetry does not collect document contents, extracted text or images, file names, file paths, search queries, prompts, snippets, API keys, usernames, hostnames, raw tracebacks, or exact hardware identifiers.-Telemetry starts in an unset consent state. In this state MinerU may keep local aggregate data but will not upload it. Users can enable or disable telemetry explicitly; disabling telemetry stops new telemetry aggregation and removes unsent local telemetry data.--During the current beta prerelease, the unset state may also upload locally aggregated metrics. The existing interactive prompt and explicit enable/disable commands remain unchanged. This temporary behavior will be reverted for the stable release.+Users can inspect telemetry status and explicitly enable or disable it. To prevent telemetry uploads, disable it explicitly; disabling also stops new aggregation and removes unsent local telemetry data. Check the running version and status rather than inferring consent from installation.Do not prompt for telemetry consent in agent or non-interactive contexts. If the user asks about telemetry, use:@@ -380,9 +385,9 @@ Small Rec, PP-FormulaNet plus-M, seal OCR and shared table models. ONNX Runtimebecause some table models also use ONNX in the Torch backend. All ONNX sessions run on CPU; VLM devicesare selected independently.-The small-model bundles currently support the Hugging Face source. Set `MINERU_MODEL_SOURCE=huggingface`-for automatic downloads during parsing, or `local` after downloading. Existing bundle and VLM cache-paths remain unchanged. See [model assets and validation](docs/next/model-assets.md).+The small-model bundles support both Hugging Face and ModelScope. Use `model.source: auto`, select either+provider explicitly, or select `local` after downloading and verifying the matching models. See+[model downloads and configuration](https://opendatalab.github.io/MinerU/usage/model_source/).## Server Rules@@ -430,41 +435,34 @@ Use available read-only system commands to inspect the OS, architecture, total m- Windows PowerShell: `(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory`, `Get-CimInstance Win32_Processor`, and `nvidia-smi` when available.- Other accelerators: use an already-installed vendor tool if available; do not install software merely to inspect hardware.-### Choose Local Stack--The `light` stack is suitable for most hardwares, including CPU-only machines, Apple Silicon, and low-end iGPU/GPU machines.+### Choose Local Backends-Install and use `full` stack only when you have enough RAM and powerful GPU/accelerator, accept extra installation disk space, and want a higher throughput. Hardware requirements:-- At least 16 GB total memory.-- A Volta-or-newer NVIDIA GPU with at least 8 GB available VRAM, or an `npu`, `gcu`, `musa`, `mlu`, or `sdaa` accelerator.-- Consumes ~5GB more disk space.+The base package supplies ONNX small models and llama.cpp; Apple Silicon also installs Torch.+For Torch small models, use `mineru[torch]>=4.0,<5`. For higher-throughput serving, `mineru[full]>=4.0,<5`+adds vLLM on Linux or LMDeploy on Windows. Configure small models and the VLM independently as described above.+Do not use `model.stack` or `--stack`. Existing vendor accelerator guides stay on MinerU <4.-To use the `full` stack, install the `mineru[full]` extra.--The following examples assume the current install tool is `uv tool`. If `mineru` was installed with another tool or environment, use the equivalent command for that actual tool/environment.--Installing extras with `uv tool install --force --prerelease allow` can replace the active `mineru` environment. Stop the MinerU server first, confirm `running=false`, and start it again after installing dependencies.+The following example assumes the actual installation is managed by `uv tool`; otherwise use the owning installer.+Preserve the current tool options and chosen extras. Stop services before replacing the environment:```bashmineru server stopmineru server status --json-uv tool install --force --prerelease allow "mineru[full]"+uv tool install --force "mineru[full]>=4.0,<5"mineru server startmineru server status --json```### Choose Local Tier-Managed local parsing has two startup tiers: `basic` and `standard`. A Standard server provides `basic`, `standard`, and `advanced` request tiers. Advanced uses the same Standard dependencies, model set, and hardware setup; it differs only by spending more inference compute when the request selects `--tier advanced`.--- `basic` tier with `light` stack, requires at least 4GB total memory.-- `standard` tier with `light` stack, requires at least 8GB total memory, recommended for GPU/Metal.-- `basic` tier with `full` stack, recommended for `npu`, `gcu`, `musa`, `mlu`, or `sdaa`.-- `standard` tier with `full` stack, recommended for high-end nvidia GPU.+Managed local parsing has two startup tiers: `basic` and `standard`. Standard capacity also serves Advanced requests.+Advanced shares Standard models and runtime but spends more inference compute. Basic can run with CPU small models.+For higher-throughput local quality parsing, plan for at least 16 GB system or unified memory and an engine-supported+accelerator with sufficient free memory. Exact requirements depend on documents, engine, and concurrency.### Recommend and Ask-After hardware was inspected, you already know the suitable stack and tier for current machine. Before asking the user to choose a tier/stack, summarize the detected hardware and identify each tier's hardware status.+After hardware was inspected, you already know the suitable backends and tier for current machine. Before asking the user to choose a tier/backends, summarize the detected hardware and identify each tier's hardware status.You should recommend a tier for user when the machine meets such requirements, otherwise offer remote `standard` when privacy rules allow, or use explicit `flash`.diff --git a/README_en.md b/README_en.mdindex e45e5b0b..412d59c8 100644--- a/README_en.md+++ b/README_en.md@@ -44,299 +44,36 @@</div>+# MinerU 4.0-<details>-<summary>MinerU — High-accuracy document parsing engine for LLM · RAG · Agent workflows</summary>-Converts PDF · EPUB · CSV · RTF · DOCX · PPTX · XLSX · ODT · ODS · ODP · Images · Web pages into structured Markdown / JSON · VLM+OCR dual engine · 109 languages <br>-MCP Server · LangChain / Dify / FastGPT native integration · 10+ domestic AI chip support--**🔍 Core Parsing Capabilities**--- Native support for `EPUB`, `CSV`, `RTF`, `DOCX`, `PPTX`, `XLSX`, `ODT`, `ODS`, and `ODP` parsing-- Formulas → LaTeX · Tables → HTML, accurate layout reconstruction-- Supports scanned docs, handwriting, multi-column layouts, cross-page table merging-- Output follows human reading order with automatic header/footer removal-- VLM + OCR dual engine, 109-language OCR recognition+MinerU 4.0 brings document parsing, a local document library, and service tools into one workflow for document conversion, application integration, and agent reading.-**🔌 Integration**+- **Four parsing tiers**: Flash for fast previews and indexing, Basic for OCR and model-based parsing, and Standard / Advanced for more demanding layouts and quality requirements.+- **Multiple input formats**: PDF, images, DOC/DOCX, PPT/PPTX, XLS/XLSX, RTF, ODT/ODS/ODP, EPUB, OFD, HTML, and CSV/TSV. DocVortex provides native document parsing.+- **Document library and agent reading**: discover files, cache results, search content, continue by page or block, and preserve stable citation locators.+- **Independent model configuration**: ONNX or Torch for small models; llama.cpp, vLLM, LMDeploy, or manually installed and explicitly configured MLX for the VLM.+- **Unified tools**: Python SDK, V1 API, stateless batch conversion, multi-service Router, and a Gradio-based WebUI.+- **Structured results and rendering**: one document model supports nine rendering targets: Markdown, HTML, LaTeX, DOCX, EPUB, PDF, Structured Content, and Content List V1/V2. Each CLI/API exposes its own subset of exports.-| Use Case | Solution |-|----------|----------|-| AI Coding Tools | MCP Server — Cursor · Claude Desktop · Windsurf |-| RAG Frameworks | LangChain · LlamaIndex · RAGFlow · RAG-Anything · Flowise · Dify · FastGPT |-| Development | Python / Go / TypeScript SDK · CLI · REST API · Docker |-| No-Code | mineru.net online · Gradio WebUI · Desktop client |+PDF and images support all four tiers. Office, OpenDocument, EPUB, OFD, HTML, and CSV/TSV use local Flash native parsing. Plain text is read directly rather than parsed. Documents are not automatically uploaded to the official service; remote parsing requires explicit configuration.-**🖥️ Deployment (Private · Fully Offline)**+## Quick Start-| Inference Backend | Best For |-|------------------|---------|-| Flash tier | Fast local parsing, no VLM calls, runs on CPU or GPU |-| hybrid-engine | High accuracy, native text extraction, low hallucination, supports VLM acceleration ecosystem |--Domestic AI chips: Ascend · Cambricon · Enflame · MetaX · Moore Threads · Kunlunxin · Iluvatar · Hygon · Biren · T-Head-</details>--# Changelog--- 2026/06/18 3.4 Released-- This release focuses on **OCR capability upgrades for the pipeline backend**, **OCR processing pipeline optimization**, and **model download experience improvements**. The main updates include:-- - OCR model upgrade and processing acceleration- - The OCR model for the `pipeline` backend has been upgraded to `PP-OCRv6`, improving OCR accuracy by about `11%` on OmniDocBench v1.6.- - Removed Japanese, Traditional Chinese, English, and Latin options from OCR language selection. These scenarios are now routed to the `ch` OCR model, simplifying model configuration and language selection.- - Optimized the OCR inference and processing pipeline, increasing OCR processing speed by about `100%` and significantly improving parsing efficiency for batch documents and OCR-intensive documents.-- - Model download logic optimization- - Added automatic model source selection, allowing first-time installations to choose a better model source based on the current network environment.- - Before downloading models, MinerU now prioritizes checking locally downloaded model cache files. Cache hits can be reused directly, reducing repeated downloads and unnecessary remote requests.- - For more details about model source configuration, automatic source selection, and local model usage, see the [Model Source Documentation](https://opendatalab.github.io/MinerU/usage/model_source/).-- With the 3.4 release, MinerU further improves the parsing accuracy and processing efficiency of the `pipeline` backend in OCR scenarios. It also optimizes model downloads, cache reuse, and local configuration write-back, making first-time installation, model updates, and multi-environment deployment more stable and automated.+Python `>=3.10,<3.15`. Install MinerU 4.0 stable in a virtual environment:-- 2026/06/11 3.3 Released-- This release focuses on **Hybrid parsing performance optimization** and **VLM model capability upgrades**. The main updates include:-- - New `effort` parsing-strength parameter for the Hybrid backend- - Added two parsing-strength levels, `medium` and `high`, allowing users to balance parsing speed, parsing accuracy, and feature requirements.- - On OmniDocBench v1.6, `medium` reduces overall accuracy by only `0.13` points compared with `high`, while delivering `35%` ~ `220%` parsing speed improvements across different devices and scenarios.- - The default Hybrid backend now uses `effort=medium`, significantly improving overall parsing efficiency while maintaining high parsing accuracy.- - The `medium` level does not support `image analysis`; for maximum parsing accuracy or `image analysis` support, switch to `effort=high`.-- - VLM model upgraded to `MinerU2.5-Pro-2605-1.2B`- - Fixed multiple model issues found in the `2604` version, further improving parsing stability on complex documents.- - Added native multilingual OCR support, reducing the need for extra language-parameter configuration.--- 2026/04/18 3.1.0 Released-- This release focuses on **licensing openness, parsing accuracy, and full-format native support**. The main updates include:-- - License upgrade- - MinerU has officially moved from `AGPLv3` to the [MinerU Open Source License](https://github.com/opendatalab/MinerU/blob/master/LICENSE.md), a custom license based on `Apache 2.0`.- - This change significantly reduces adoption friction for both community users and commercial deployments, making MinerU easier to integrate into real-world workflows.- - VLM main model upgrade- - The primary VLM model has been upgraded to `MinerU2.5-Pro-2604-1.2B`, bringing overall parsing accuracy to a state-of-the-art level.- - The new model now supports image and chart parsing, truncated paragraph merging, cross-page table merging, and image recognition inside tables, further strengthening performance on complex document layouts.- - Full-format native parsing support- - Native parsing support has now been extended to `PPTX` and `XLSX`.- - MinerU now fully supports parsing across images, `PDF`, `DOCX`, `PPTX`, and `XLSX`, providing a more complete multi-format document understanding workflow.-- With the 3.1.0 release, MinerU becomes more open, more accurate, and easier to adopt in production. The new license lowers the barrier for both community and commercial use, `MinerU2.5-Pro-2604-1.2B` improves parsing quality on complex content, and native `PPTX` / `XLSX` support completes end-to-end coverage of mainstream document formats.--- 2026/03/29 3.0.0 Released-- This release delivers a systematic upgrade centered on **parsing capability, system architecture, and engineering usability**. The main updates include:-- - Native `DOCX` parsing- - Official support for native `DOCX` parsing, delivering high-precision results without hallucinations.- - Compared with the traditional workflow of first converting `DOCX` to `PDF` and then parsing it, end-to-end speed is improved by tens of times, making it better suited for scenarios with high requirements for both accuracy and throughput.- - `pipeline` backend upgrade- - The `pipeline` backend achieves a score of `86.2` on OmniDocBench (v1.5), surpassing the accuracy of the previous-generation mainstream VLM `MinerU2.0-2505-0.9B`.- - Added support for parsing images/formulas inside tables, seal text recognition, vertical text support, and interline formula numbering recognition, continuously improving parsing quality for complex document scenarios.- - While maintaining high accuracy, it keeps resource usage extremely low and continues to support inference in pure CPU environments.- - `API / CLI / Router` orchestration upgrade- - `mineru` now runs as an orchestration client based on `mineru-api`; when `--api-url` is not provided, it will automatically start a local temporary service.- - `mineru-api` adds a new asynchronous task endpoint `POST /tasks`, supporting task submission, status querying, and result retrieval; meanwhile, it retains the synchronous parsing endpoint `POST /file_parse` for compatibility with legacy plugins.- - Added `mineru-router`, designed for unified entry deployment and task routing across multiple services and multiple GPUs; its interfaces are fully compatible with `mineru-api` and support automatic task load balancing.- - Deployment and usability improvements- - Resolved compatibility issues with `torch >= 2.8`; the base image has been upgraded to `vllm0.11.2 + torch2.9.0`, unifying installation paths across different Compute Capabilities.- - Optimized the parsing pipeline with a sliding-window mechanism, significantly reducing peak memory usage in long-document scenarios, so documents with tens of thousands of pages no longer need to be split manually.- - Batch inference in `pipeline` now supports streaming writes to disk, allowing completed parsing results to be written out in time and further improving the experience for long-running tasks.- - Completed thread-safety optimization and now fully supports multi-threaded concurrent inference; together with `mineru-router`, this enables one-click multi-GPU deployment and makes it easy to build high-concurrency, high-throughput parsing systems.- - Completely removed the use of two AGPLv3 models (`doclayoutyolo` and `mfd_yolov8`) and one CC-BY-NC-SA 4.0 model (`layoutreader`).-- This update is not just a set of feature enhancements, but a key leap forward in MinerU's overall system capabilities. We specifically addressed the peak memory usage issue in long-document parsing. Through optimizations such as sliding windows and streaming writes to disk, ultra-long document parsing has moved from “requiring manual splitting and careful handling” to being “stable, scalable, and ready for production workloads.” At the same time, we completed thread-safety optimization and fully enabled multi-threaded concurrent inference, further improving single-machine resource utilization and runtime stability under high-concurrency workloads. On top of this, with `mineru-router` and the new `API / CLI` orchestration framework, MinerU now supports one-click multi-GPU deployment, unified access across multiple services, and automatic task load balancing, significantly reducing the difficulty of large-scale deployment. As a result, MinerU is evolving from a standalone data production tool into a large-scale document parsing foundation for high-concurrency and high-throughput scenarios, providing enterprise-grade document data processing with infrastructure that is more stable, more efficient, and easier to scale.--> 📝 View the complete [Changelog](https://opendatalab.github.io/MinerU/reference/changelog/) for more historical version information--# MinerU--## Project Introduction--MinerU is a document parsing tool that converts `PDF`, `EPUB`, image, `CSV`, `RTF`, `DOCX`, `PPTX`, `XLSX`, `ODT`, `ODS`, and `ODP` inputs into machine-readable formats such as Markdown and JSON for downstream retrieval, extraction, and processing.-MinerU was born during the pre-training process of [InternLM](https://github.com/InternLM/InternLM). We focus on solving symbol conversion issues in scientific literature and hope to contribute to technological development in the era of large models.-Compared to well-known commercial products, MinerU is still young. If you encounter any issues or if the results are not as expected, please submit an issue on [issue](https://github.com/opendatalab/MinerU/issues) and **attach the relevant document or sample file**.--https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c--## Key Features--- Support `PDF`, `EPUB`, image, `CSV`, `RTF`, `DOCX`, `PPTX`, `XLSX`, `ODT`, `ODS`, and `ODP` inputs.-- Remove headers, footers, footnotes, page numbers, etc., to ensure semantic coherence.-- Output text in human-readable order, suitable for single-column, multi-column, and complex layouts.-- Preserve the structure of the original document, including headings, paragraphs, lists, etc.-- Extract images, image descriptions, tables, table titles, and footnotes.-- Automatically recognize and convert formulas in the document to LaTeX format.-- Automatically recognize and convert tables in the document to HTML format.-- Automatically detect scanned PDFs and garbled PDFs and enable OCR functionality.-- OCR supports detection and recognition of 109 languages.-- Supports multiple output formats, such as multimodal and NLP Markdown, JSON sorted by reading order, and rich intermediate formats.-- Supports layout visualization for efficient confirmation of output quality.-- Built-in CLI, FastAPI, Gradio WebUI, for local orchestration and multi-service deployment.-- Supports running in a pure CPU environment, and also supports GPU/MPS acceleration-- Compatible with Windows, Linux, and Mac platforms.--# Quick Start--Document parsing is a difficult and complex task. In scenarios such as complex layouts, scanned pages, and handwritten content, the parsing results may fall short of expectations. We recommend trying the online demo first to evaluate MinerU's parsing quality and suitability before choosing an appropriate deployment method based on your actual needs.-If you have **document** samples with unsatisfactory parsing results, feel free to share them in an [issue](https://github.com/opendatalab/MinerU/issues). We will continue improving the parsing capabilities.-If you encounter any installation issues, please first consult the <a href="#faq">FAQ</a>.--## Online Experience--### Official online web application-The official online version has the same functionality as the client, with a beautiful interface and rich features, requires login to use--- [](https://mineru.net/OpenSourceTools/Extractor?source=github)--### Gradio-based online demo-A WebUI developed based on Gradio, with a simple interface and only core parsing functionality, no login required--- [](https://www.modelscope.cn/studios/OpenDataLab/MinerU)-- [](https://huggingface.co/spaces/opendatalab/MinerU)--## Local Deployment---> [!WARNING]-> **Pre-installation Notice—Hardware and Software Environment Support**->-> To ensure the stability and reliability of the project, we only optimize and test for specific hardware and software environments during development. This ensures that users deploying and running the project on recommended system configurations will get the best performance with the fewest compatibility issues.->-> By focusing resources on the mainline environment, our team can more efficiently resolve potential bugs and develop new features.->-> In non-mainline environments, due to the diversity of hardware and software configurations, as well as third-party dependency compatibility issues, we cannot guarantee 100% project availability. Therefore, for users who wish to use this project in non-recommended environments, we suggest carefully reading the documentation and FAQ first. Most issues already have corresponding solutions in the FAQ. We also encourage community feedback to help us gradually expand support.--<table>- <thead>- <tr>- <th rowspan="2">Parsing Backend</th>- <th rowspan="2">hybrid low</th>- <th colspan="2">*-engine</th>- <th colspan="2">*-http-client</th>- </tr>- <tr>- <th>hybrid</th>- <th>vlm</th>- <th>hybrid</th>- <th>vlm</th>- </tr>- </thead>- <tbody>- <tr>- <th>Backend Features</th>- <td >Good Compatibility</td>- <td colspan="2">High Hardware Requirements</td>- <td colspan="2">For OpenAI Compatible Servers<sup>2</sup></td>- </tr>- <tr>- <th>Accuracy<sup>1</sup></th>- <td style="text-align:center;">86.47</td>- <td style="text-align:center;">95.39 (effort=high)<br>95.26 (effort=medium)</td>- <td style="text-align:center;">95.30</td>- <td style="text-align:center;">95.39 (effort=high)<br>95.26 (effort=medium)</td>- <td style="text-align:center;">95.30</td>- </tr>- <tr>- <th>Operating System</th>- <td colspan="5" style="text-align:center;">Linux<sup>3</sup> / Windows<sup>4</sup> / macOS<sup>5</sup></td>- </tr>- <tr>- <th>Pure CPU Support</th>- <td style="text-align:center;">✅</td>- <td colspan="2" style="text-align:center;">❌</td>- <td colspan="2" style="text-align:center;">✅</td>- </tr>- <tr>- <th>GPU Acceleration</th>- <td colspan="4" style="text-align:center;">Volta and later architecture GPUs or Apple Silicon</td>- <td rowspan="2">Not Required</td>- </tr>- <tr>- <th>Min VRAM</th>- <td style="text-align:center;">4GB</td>- <td colspan="2" style="text-align:center;">8GB</td>- <td style="text-align:center;">2GB</td>- </tr>- <tr>- <th>RAM</th>- <td colspan="3" style="text-align:center;">Min 16GB, Recommended 32GB or more</td>- <td colspan="2" style="text-align:center;">Min 16GB</td>- </tr>- <tr>- <th>Disk Space</th>- <td colspan="3" style="text-align:center;">Min 20GB, SSD Recommended</td>- <td colspan="2" style="text-align:center;">Min 2GB</td>- </tr>- <tr>- <th>Python Version</th>- <td colspan="5" style="text-align:center;">3.10-3.13</td>- </tr>- </tbody>-</table>--<sup>1</sup> Accuracy metrics are the End-to-End Evaluation Overall scores from OmniDocBench (v1.6), based on the latest version of `MinerU`.-<sup>2</sup> Servers compatible with OpenAI API, such as local model servers or remote model services deployed via inference frameworks like `vLLM`/`SGLang`/`LMDeploy`.-<sup>3</sup> Linux only supports distributions from 2019 and later.-<sup>4</sup> Since the key dependency `ray` does not support Python 3.13 on Windows, only versions 3.10~3.12 are supported.-<sup>5</sup> macOS requires version 14.0 or later.---### Install MinerU--#### Install MinerU using pip or uv```bash-pip install --upgrade pip-pip install uv-uv pip install -U "mineru[all]"+uv pip install -U "mineru>=4.0,<5"+mineru-kit parse document.pdf -o document.md --tier standard+mineru-kit webui```-#### Install MinerU from source code-```bash-git clone https://github.com/opendatalab/MinerU.git-cd MinerU-uv pip install -e .[all]-```--> [!TIP]-> - `mineru[all]` includes all core features, compatible with Windows / Linux / macOS systems, suitable for most users.-> - If CUDA acceleration is unavailable after installing on Windows, see the [Windows CUDA acceleration FAQ](https://opendatalab.github.io/MinerU/faq/#windows-cuda-acceleration).-> - If you need to specify the inference framework for the VLM model, or only intend to install a lightweight client on an edge device, please refer to the documentation [Extension Modules Installation Guide](https://opendatalab.github.io/MinerU/quick_start/extension_modules/).-------#### Deploy MinerU using Docker-MinerU provides a convenient Docker deployment method, which helps quickly set up the environment and solve some tricky environment compatibility issues.--> [!TIP]-> - Docker deployment is only supported on Linux and Windows environments with WSL2 support;-> - macOS users should refer to the two installation methods above for installation instead of using Docker deployment.--You can get the [Docker Deployment Instructions](https://opendatalab.github.io/MinerU/quick_start/docker_deployment/) in the documentation.-------### Using MinerU---If your device meets the GPU acceleration requirements in the table above, you can use a simple command line for document parsing:-```bash-mineru -p <input_path> -o <output_path>-```-If your device does not meet the GPU acceleration requirements, you can explicitly use the Flash tier to run without VLM calls:-```bash-mineru parse "<input_path>" --tier flash -o <output_path>-```+Use `mineru[torch]>=4.0,<5` for Torch small models or `mineru[full]>=4.0,<5` for higher-throughput deployment (Linux: vLLM; Windows: LMDeploy). Optional engines have additional Python, device, and driver constraints.-`mineru` currently supports local `PDF`, `EPUB`, image, `CSV`, `RTF`, `DOCX`, `PPTX`, `XLSX`, `ODT`, `ODS`, and `ODP` file or directory inputs through the CLI, API, and `mineru-router`. EPUB, RTF, and OpenDocument use local semantic Flash parsing without external office-suite conversion. Only PDF accepts page-range parsing; every non-PDF input is parsed and cached as one complete file, while slides, sheets, EPUB spine items, and explicit page breaks remain logical pages in structured output. EPUB pages follow OPF spine order and preserve resolvable internal links from authored contents, including list and table layouts. The legacy Gradio WebUI keeps its existing advertised upload formats. For detailed instructions, please refer to the [Usage Guide](https://opendatalab.github.io/MinerU/usage/).+For the document library and agent reading, use `mineru parse document.pdf --json`. It defaults to the first 10 PDF pages; continue with returned locators. Stateless `mineru-kit parse` defaults to all pages.-# FAQ+[Installation](https://opendatalab.github.io/MinerU/quick_start/) · [Tiers and runtimes](https://opendatalab.github.io/MinerU/usage/tiers/) · [SDK and API](https://opendatalab.github.io/MinerU/usage/sdk_api/) · [Docker deployment](https://opendatalab.github.io/MinerU/quick_start/docker_deployment/) · [3.x → 4.0 migration](https://opendatalab.github.io/MinerU/reference/migration_4/) · [Release history](https://opendatalab.github.io/MinerU/reference/changelog/)-- If you encounter any issues during usage, you can first check the [FAQ](https://opendatalab.github.io/MinerU/faq/) for solutions.-- If your issue remains unresolved, you may also use [DeepWiki](https://deepwiki.com/opendatalab/MinerU) to interact with an AI assistant, which can address most common problems.-- If you still cannot resolve the issue, you are welcome to join our community via [Discord](https://discord.gg/Tdedn9GTXq) or [WeChat](https://mineru.net/community-portal/?aliasId=3c430f94) to discuss with other users and developers.+> Existing AMD and vendor accelerator Docker adaptations and guides remain on **MinerU <4**. See the [legacy platform guides](https://opendatalab.github.io/MinerU/usage/compatibility/).# All Thanks To Our Contributorsdiff --git a/README_zh.md b/README_zh.mdindex 6a674c3c..7be6b1ce 100644--- a/README_zh.md+++ b/README_zh.md@@ -44,306 +44,36 @@</div>-<details>-<summary>MinerU — 专为 LLM · RAG · Agent 场景构建的高精度文档解析引擎 </summary>-将 PDF · EPUB · CSV · RTF · DOCX · PPTX · XLSX · ODT · ODS · ODP · 图片 · 网页转为结构化 Markdown / JSON · VLM+OCR 双引擎 · 109 种语言 <br>-MCP Server · LangChain / Dify / FastGPT 原生集成 · 10+ 国产算力适配 <br>--**🔍 核心解析能力**-- 原生支持 `EPUB`、`CSV`、`RTF`、`DOCX`、`PPTX`、`XLSX`、`ODT`、`ODS`、`ODP` 解析-- 公式 → LaTeX · 表格 → HTML,精准还原复杂版面-- 支持扫描件、手写体、多栏布局、跨页表格合并-- 输出符合人类阅读顺序,自动去除页眉页脚-- VLM + OCR 双引擎,支持 109 种语言识别--**🔌 接入方式**+# MinerU 4.0-| 场景 | 方案 |-|------|------|-| AI 编程工具 | MCP Server — Cursor · Claude Desktop · Windsurf |-| RAG 框架 | LangChain · LlamaIndex · RAGFlow · RAG-Anything · Flowise · Dify · FastGPT |-| 开发集成 | Python / Go / TypeScript SDK · CLI · REST API · Docker |-| 零代码 | mineru.net 在线版 · Gradio WebUI · 桌面客户端 |+MinerU 4.0 将多格式文档解析、文档库和服务工具整合到统一工作流,面向文档转换、应用集成和 Agent 阅读。-**🖥️ 部署生态(支持私有化 · 完全离线)**+- **四档解析**:Flash 用于快速预览与索引,Basic 提供基础 OCR/模型解析,Standard 与 Advanced 面向更复杂的版面和更高的质量需求。+- **多格式输入**:PDF、图片,以及 DOC/DOCX、PPT/PPTX、XLS/XLSX、RTF、ODT/ODS/ODP、EPUB、OFD、HTML、CSV/TSV。原生文档由 DocVortex 提供解析能力。+- **文档库与 Agent 阅读**:发现文件、缓存结果、搜索内容,按页或块继续阅读,并保留稳定引用位置。+- **独立模型配置**:小模型选择 ONNX 或 Torch;VLM 独立选择 llama.cpp、vLLM、LMDeploy,或手动安装并显式配置 MLX。+- **统一工具入口**:Python SDK、V1 API、无状态批处理、多服务 Router 和基于 Gradio 的 WebUI。+- **结构化结果与渲染**:统一文档模型支持 Markdown、HTML、LaTeX、DOCX、EPUB、PDF、Structured Content、Content List V1/V2 九种渲染目标;各 CLI/API 的导出范围见输出说明。-| 推理后端 | 适用场景 |-|--------------|-----------------------------|-| Flash tier | 本地快速解析,不调用 VLM,CPU / GPU 均可运行 |-| hybrid-engine| 高精度,原生文本提取,低幻觉,支持 VLM 加速生态 |--国产算力:昇腾 · 寒武纪 · 燧原 · 沐曦 · 摩尔线程 · 昆仑芯 · 天数智芯 · 瀚博 · 太初元碁 · 海光 · 平头哥--</details>--# 更新记录--- 2026/06/18 3.4 发布-- 本次版本更新聚焦于 **pipeline 后端 OCR 能力升级**、**OCR 处理链路优化** 与 **模型下载体验改进**。主要更新内容包括:-- - OCR 模型升级与处理加速- - `pipeline` 后端 OCR 模型更新至 `PP-OCRv6`,在 OmniDocBench v1.6 评测中,OCR 相关指标提升约 `11%`。- - 移除 OCR 语言选择中的日语、繁体中文、英语、拉丁文选项,相关场景统一路由到 `ch` OCR 模型,简化模型配置与语言选择逻辑。- - 优化 OCR 推理与处理链路,OCR 处理速度提升约 `100%`,显著改善批量文档和 OCR 密集型文档的解析效率。-- - 模型下载逻辑优化- - 新增模型源自动选择能力,首次安装时可根据当前网络环境自动选择更合适的模型源。- - 下载模型前会优先检查本地已下载的模型缓存文件,命中缓存时可直接复用,减少重复下载和不必要的远端请求。- - 更多模型源配置、自动选择策略与本地模型使用说明,请参考 [模型源说明](https://opendatalab.github.io/MinerU/zh/usage/model_source/)。-- 在 3.4 版本,MinerU 进一步提升了 `pipeline` 后端在 OCR 场景下的解析精度与处理效率,同时优化了模型下载、缓存复用和本地配置写入流程,让首次安装、模型更新和多环境部署更加稳定、自动化。--- 2026/06/11 3.3 发布-- 本次版本更新聚焦于 **Hybrid 解析性能优化** 与 **VLM 模型能力升级**。主要更新内容包括:+PDF 和图片支持四档解析;Office、OpenDocument、EPUB、OFD、HTML、CSV/TSV 使用本地 Flash 原生解析。纯文本直接读取,不进入解析流程。默认不会自动将文档上传到官网服务,远程解析需要显式配置。- - Hybrid 后端新增 `effort` 解析强度参数- - 新增 `medium` 与 `high` 两档解析强度,用户可根据解析速度、解析精度和功能需求灵活选择。- - 在 OmniDocBench v1.6 评测中,`medium` 相比 `high` 综合精度仅降低 `0.13`,但在不同设备和场景下可获得 `35%` ~ `220%` 的解析速度提升。- - 默认 Hybrid 后端将使用 `effort=medium`,在保持高解析精度的同时显著提升整体解析效率。- - `medium` 档不支持 `image analysis`(图片/图表分析)功能;如需极致解析精度或启用 `image analysis`,可通过 `effort=high` 切换至高强度解析模式。-- - VLM 模型升级至 `MinerU2.5-Pro-2605-1.2B`- - 修复 `2604` 版本中存在的多处模型问题,进一步提升复杂文档场景下的解析稳定性。- - 原生支持多语言 OCR,降低多语言文档解析时对额外语言参数配置的依赖。--- 2026/04/18 3.1.0 发布-- 本次版本更新聚焦于**许可协议开放性、解析精度提升与全格式原生支持**。主要更新内容包括:-- - 许可协议升级- - MinerU 已正式从 `AGPLv3` 切换至基于 `Apache 2.0` 的 [MinerU 开源许可证](https://github.com/opendatalab/MinerU/blob/master/LICENSE.md)。- - 新的许可方式在兼顾开源协作与商业落地的同时,进一步降低了社区使用和商业化接入门槛,让 MinerU 更容易融入真实业务流程。- - VLM 主模型升级- - VLM 主模型正式切换为 `MinerU2.5-Pro-2604-1.2B`,整体解析精度提升至业内领先水平。- - 新模型现已支持子图切分合并、图像与图表解析、截断段落合并、跨页面表格合并以及表格内图像识别,复杂版面场景下的解析能力进一步增强。- - 全格式原生解析支持- - 新增 `PPTX` 与 `XLSX` 原生解析能力。- - 至此,MinerU 已完整支持图片、`PDF`、`DOCX`、`PPTX`、`XLSX` 全格式解析,为多类型文档统一处理提供了更完整的能力闭环。-- 通过 3.1.0 版本,MinerU 在开放性、解析精度和落地能力上进一步提升。新的许可协议降低了社区使用和商业接入门槛,`MinerU2.5-Pro-2604-1.2B` 提升了复杂内容的解析质量,而 `PPTX` 与 `XLSX` 原生解析的补齐,也让 MinerU 完成了主流文档格式的端到端覆盖。--- 2026/03/29 3.0.0 发布-- 本次版本更新围绕**解析能力、系统架构与工程可用性**进行了系统升级。主要更新内容包括:-- - `DOCX` 原生解析- - 正式支持 `DOCX` 原生解析,在无幻觉前提下实现高精度解析。- - 相较于“先将 `DOCX` 转为 `PDF` 再解析”的传统流程,端到端速度提升数十倍以上,更适合对精度与吞吐均有要求的场景。- - `pipeline` 后端升级- - `pipeline` 后端在 OmniDocBench (v1.5) 上取得 `86.2` 分,精度超过上一代主流 VLM `MinerU2.0-2505-0.9B`。- - 新增表格内图片/公式解析、印章文字识别、竖排文本支持、行间公式序号识别等能力,持续提升复杂文档场景下的解析效果。- - 在保持高精度的同时,资源占用极低,并继续支持纯 CPU 环境推理。- - `API / CLI / Router` 编排升级- - `mineru` 现作为基于 `mineru-api` 的编排客户端运行;在未传入 `--api-url` 时,会自动拉起本地临时服务。- - `mineru-api` 新增异步任务接口 `POST /tasks`,支持任务提交、状态查询与结果获取;同时保留同步解析接口 `POST /file_parse`,以兼容老版本插件。- - 新增 `mineru-router`,适用于多服务、多 GPU 的统一入口部署与任务路由;其接口与 `mineru-api` 完全兼容,并支持任务自动负载均衡。- - 部署与使用体验优化- - 解决了 `torch >= 2.8` 的兼容问题,基础镜像升级为 `vllm0.11.2 + torch2.9.0`,统一了不同 Compute Capability 的安装路径。- - 通过滑动窗口优化解析链路,显著降低长文档场景下的内存峰值占用,上万页文档解析不再需要手动拆分。- - `pipeline` 的 batch 推理支持流式落盘,已完成的解析结果可及时写出,进一步提升长任务处理体验。- - 完成线程安全优化,全面支持多线程并发推理;配合 `mineru-router`,可一键实现多卡部署,轻松构建高并发、高吞吐解析系统。- - 完全移除了两个 AGPLv3 模型(`doclayoutyolo` 和 `mfd_yolov8`)以及一个 CC-BY-NC-SA 4.0 模型(`layoutreader`)的使用。-- 本次更新不仅是若干功能点的补强,更是 MinerU 在系统能力上的一次关键跃迁。我们重点解决了长文档解析过程中的内存峰值占用问题,通过滑动窗口、流式落盘等链路优化,让超长文档解析从“需要手动拆分、谨慎处理”走向“稳定可跑、规模可扩展”。同时,我们完成了线程安全优化,全面支持多线程并发推理,进一步提升了单机资源利用率与高并发场景下的运行稳定性。在此基础上,基于 mineru-router 与全新的 API / CLI 编排体系,MinerU 已具备一键多卡部署、多服务统一接入、任务自动负载均衡的能力,显著降低了大规模部署难度。至此,MinerU 正在从单一的数据生产工具,进一步演进为面向高并发、高吞吐场景的大规模文档解析基座,为企业级文档数据处理提供更稳定、更高效、更易扩展的基础设施能力。--> 📝 查看完整的 [更新日志](https://opendatalab.github.io/MinerU/zh/reference/changelog/) 了解更多历史版本信息--# MinerU--## 项目简介--MinerU 是一款文档解析工具,可将 `PDF`、`EPUB`、图片、`CSV`、`RTF`、`DOCX`、`PPTX`、`XLSX`、`ODT`、`ODS`、`ODP` 转化为机器可读格式(如 Markdown、JSON),便于后续检索、抽取与二次处理。-MinerU诞生于[书生-浦语](https://github.com/InternLM/InternLM)的预训练过程中,我们将会集中精力解决科技文献中的符号转化问题,希望在大模型时代为科技发展做出贡献。-相比国内外知名商用产品MinerU还很年轻,如果遇到问题或者结果不及预期请到[issue](https://github.com/opendatalab/MinerU/issues)提交问题,同时**附上相关文档或样例文件**。--https://github.com/user-attachments/assets/4bea02c9-6d54-4cd6-97ed-dff14340982c--## 主要功能--- 支持 `PDF`、`EPUB`、图片、`CSV`、`RTF`、`DOCX`、`PPTX`、`XLSX`、`ODT`、`ODS`、`ODP` 输入-- 删除页眉、页脚、脚注、页码等元素,确保语义连贯-- 输出符合人类阅读顺序的文本,适用于单栏、多栏及复杂排版-- 保留原文档的结构,包括标题、段落、列表等-- 提取图像、图片描述、表格、表格标题及脚注-- 自动识别并转换文档中的公式为LaTeX格式-- 自动识别并转换文档中的表格为HTML格式-- 自动检测扫描版PDF和乱码PDF,并启用OCR功能-- OCR支持109种语言的检测与识别-- 支持多种输出格式,如多模态与NLP的Markdown、按阅读顺序排序的JSON、含有丰富信息的中间格式等-- 支持layout可视化,便于高效确认输出效果与质检-- 内置命令行、FastAPI、Gradio WebUI,支持本地编排和多服务部署-- 支持纯CPU环境运行,并支持 GPU/MPS加速,以及十余款国产算力平台的推理加速-- 兼容Windows、Linux和Mac平台--# 快速开始--文档解析是困难且复杂的任务,尤其是对于复杂版面、扫描件、手写体等场景,解析结果可能不尽如人意。我们建议您先使用在线体验评估 MinerU 的解析效果和适用性,再根据实际需求选择合适的部署方式。-如果您有解析效果不佳的**文档**样例,欢迎提交上传到 [issue](https://github.com/opendatalab/MinerU/issues),我们会持续优化解析能力。-如果安装或使用中遇到任何问题,请先查询 <a href="#faq">FAQ</a>--## 在线体验--### 官网在线应用-官网在线版功能与客户端一致,界面美观,功能丰富,需要登录使用--- [](https://mineru.net/OpenSourceTools/Extractor?source=github)--### 基于Gradio的在线demo-基于gradio开发的webui,界面简洁,仅包含核心解析功能,免登录--- [](https://www.modelscope.cn/studios/OpenDataLab/MinerU)-- [](https://huggingface.co/spaces/opendatalab/MinerU)--## 本地部署--> [!WARNING]-> **安装前必看——软硬件环境支持说明**->-> 为了确保项目的稳定性和可靠性,我们在开发过程中仅对特定的软硬件环境进行优化和测试。这样当用户在推荐的系统配置上部署和运行项目时,能够获得最佳的性能表现和最少的兼容性问题。->-> 通过集中资源和精力于主线环境,我们团队能够更高效地解决潜在的BUG,及时开发新功能。->-> 在非主线环境中,由于硬件、软件配置的多样性,以及第三方依赖项的兼容性问题,我们无法100%保证项目的完全可用性。因此,对于希望在非推荐环境中使用本项目的用户,我们建议先仔细阅读文档以及FAQ,大多数问题已经在FAQ中有对应的解决方案,除此之外我们鼓励社区反馈问题,以便我们能够逐步扩大支持范围。--<table>- <thead>- <tr>- <th rowspan="2">解析后端</th>- <th rowspan="2">hybrid low</th>- <th colspan="2">*-engine</th>- <th colspan="2">*-http-client</th>- </tr>- <tr>- <th>hybrid</th>- <th>vlm</th>- <th>hybrid</th>- <th>vlm</th>- </tr>- </thead>- <tbody>- <tr>- <th>后端特性</th>- <td >兼容性好</td>- <td colspan="2">硬件配置要求较高</td>- <td colspan="2">适用于OpenAI兼容服务器<sup>2</sup></td>- </tr>- <tr>- <th>精度指标<sup>1</sup></th>- <td style="text-align:center;">86.47</td>- <td style="text-align:center;">95.39(effort=high)<br>95.26(effort=medium)</td>- <td style="text-align:center;">95.30</td>- <td style="text-align:center;">95.39(effort=high)<br>95.26(effort=medium)</td>- <td style="text-align:center;">95.30</td>- </tr>- <tr>- <th>操作系统</th>- <td colspan="5" style="text-align:center;">Linux<sup>3</sup> / Windows<sup>4</sup> / macOS<sup>5</sup></td>- </tr>- <tr>- <th>纯CPU平台支持</th>- <td style="text-align:center;">✅</td>- <td colspan="2" style="text-align:center;">❌</td>- <td colspan="2" style="text-align:center;">✅</td>- </tr>- <tr>- <th>GPU加速支持</th>- <td colspan="4" style="text-align:center;">Volta及以后架构GPU或Apple Silicon</td>- <td rowspan="2">不需要</td>- </tr>- <tr>- <th>显存最低要求</th>- <td style="text-align:center;">4GB</td>- <td colspan="2" style="text-align:center;">8GB</td>- <td style="text-align:center;">2GB</td>- </tr>- <tr>- <th>内存要求</th>- <td colspan="3" style="text-align:center;">最低16GB以上,推荐32GB以上</td>- <td colspan="2" style="text-align:center;">最低16GB</td>- </tr>- <tr>- <th>磁盘空间要求</th>- <td colspan="3" style="text-align:center;">20GB以上,推荐使用SSD</td>- <td colspan="2" style="text-align:center;">至少2GB</td>- </tr>- <tr>- <th>python版本</th>- <td colspan="5" style="text-align:center;">3.10-3.13</td>- </tr>- </tbody>-</table>--<sup>1</sup> 精度指标为OmniDocBench (v1.6)的End-to-End Evaluation Overall分数,基于`MinerU`最新版本测试-<sup>2</sup> 兼容OpenAI API的服务器,如通过`vLLM`/`SGLang`/`LMDeploy`等推理框架部署的本地模型服务器或远程模型服务-<sup>3</sup> Linux仅支持2019年及以后发行版-<sup>4</sup> 由于关键依赖`ray`未能在windows平台支持Python 3.13,故仅支持至3.10~3.12版本-<sup>5</sup> macOS 需使用14.0以上版本--> [!TIP]-> - 除以上主流环境与平台外,我们也收录了一些社区用户反馈的其他平台支持情况,详情请参考[其他加速卡适配](https://opendatalab.github.io/MinerU/zh/usage/)。-> - 如果您有意将自己的环境适配经验分享给社区,欢迎通过[show-and-tell](https://github.com/opendatalab/MinerU/discussions/categories/show-and-tell)提交或提交PR至[其他加速卡适配](https://github.com/opendatalab/MinerU/tree/master/docs/zh/usage/acceleration_cards)文档。--### 安装 MinerU--#### 使用pip或uv安装MinerU-```bash-pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple-pip install uv -i https://mirrors.aliyun.com/pypi/simple-uv pip install -U "mineru[all]" -i https://mirrors.aliyun.com/pypi/simple-```--#### 通过源码安装MinerU-```bash-git clone https://github.com/opendatalab/MinerU.git-cd MinerU-uv pip install -e .[all] -i https://mirrors.aliyun.com/pypi/simple-```--> [!TIP]-> - `mineru[all]`包含所有核心功能,兼容Windows / Linux / macOS系统,适合绝大多数用户。-> - 如果您在 Windows 上安装后无法使用 CUDA 加速,请参考 [Windows CUDA 加速 FAQ](https://opendatalab.github.io/MinerU/zh/faq/#windows-cuda-acceleration)。-> - 如果您需要指定vlm模型的推理框架,或是仅准备在边缘设备安装轻量版client端,可以参考文档[扩展模块安装指南](https://opendatalab.github.io/MinerU/zh/quick_start/extension_modules/)。-------#### 使用docker部署Mineru-MinerU提供了便捷的docker部署方式,这有助于快速搭建环境并解决一些棘手的环境兼容问题。+## 快速开始-> [!TIP]-> - Docker 部署仅适用于 Linux,以及支持 WSL2 的 Windows 环境;-> - macOS 用户请直接参考前面两种方式部署安装,不要使用 Docker 部署。+Python `>=3.10,<3.15`,在虚拟环境中安装 4.0 正式版:-您可以在文档中获取[Docker部署说明](https://opendatalab.github.io/MinerU/zh/quick_start/docker_deployment/)。-------### 使用 MinerU-->[!TIP]->默认使用托管在`huggingface`的模型进行解析,首次使用时会自动下载所需模型文件,后续使用将直接加载本地缓存的模型。如果您无法访问`huggingface`,可以通过以下命令切换至国内镜像源:->```bash->export MINERU_MODEL_SOURCE=modelscope->```--如果您的设备满足上表中GPU加速的条件,可以使用简单的命令行进行文档解析:```bash-mineru -p <input_path> -o <output_path>-```-如果您的设备不满足GPU加速条件,可以显式使用 Flash tier,以在不调用 VLM 的模式下运行:-```bash-mineru parse "<input_path>" --tier flash -o <output_path>+uv pip install -U "mineru>=4.0,<5"+mineru-kit parse document.pdf -o document.md --tier standard+mineru-kit webui```-当前 `mineru` 支持本地 `PDF / EPUB / 图片 / CSV / RTF / DOCX / PPTX / XLSX / ODT / ODS / ODP` 文件或目录输入,并可通过命令行、API、`mineru-router` 进行解析。EPUB、RTF 与 OpenDocument 使用本地 Flash 语义解析,不依赖外部 Office 套件转换;只有 PDF 接受页范围解析,其他输入均按一个完整文件解析和缓存,但 slide、sheet、EPUB spine 项及显式分页仍作为结构化输出中的逻辑页保留。EPUB 页面严格遵循 OPF spine 顺序,并保留作者目录中可解析的列表、表格等内部跳转。旧 Gradio WebUI 仍保持原有对外说明。具体使用方法请参考[使用指南](https://opendatalab.github.io/MinerU/zh/usage/)。+Torch 小模型使用 `mineru[torch]>=4.0,<5`;高吞吐部署使用 `mineru[full]>=4.0,<5`(Linux:vLLM,Windows:LMDeploy)。可选引擎还受各自 Python、设备及驱动支持范围约束。++文档库与 Agent 阅读使用 `mineru parse document.pdf --json`;PDF 默认前 10 页,后续按返回的 locator 继续。无状态转换使用 `mineru-kit parse`,默认全部页。+[安装指南](https://opendatalab.github.io/MinerU/zh/quick_start/) · [档位与运行环境](https://opendatalab.github.io/MinerU/zh/usage/tiers/) · [SDK 与 API](https://opendatalab.github.io/MinerU/zh/usage/sdk_api/) · [Docker 部署](https://opendatalab.github.io/MinerU/zh/quick_start/docker_deployment/) · [3.x → 4.0 迁移](https://opendatalab.github.io/MinerU/zh/reference/migration_4/) · [完整更新历史](https://opendatalab.github.io/MinerU/zh/reference/changelog/)-# FAQ--- 如果您在使用过程中遇到问题,可以先查看[常见问题](https://opendatalab.github.io/MinerU/zh/faq/)是否有解答。-- 如果未能解决您的问题,您也可以使用[DeepWiki](https://deepwiki.com/opendatalab/MinerU)与AI助手交流,这可以解决大部分常见问题。-- 如果您仍然无法解决问题,您可通过[Discord](https://discord.gg/Tdedn9GTXq)或[WeChat](https://mineru.net/community-portal/?aliasId=3c430f94)加入社区,与其他用户和开发者交流。+> AMD 与国产加速卡的既有 Docker 和适配指南继续使用 **MinerU <4**,不会随主线自动升级。请查看[旧平台指南](https://opendatalab.github.io/MinerU/zh/usage/compatibility/)。# All Thanks To Our Contributorsdiff --git a/docker/china/Dockerfile b/docker/china/Dockerfileindex 5055b722..d2a1268b 100644--- a/docker/china/Dockerfile+++ b/docker/china/Dockerfile@@ -16,12 +16,16 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest-RUN python3 -m pip install -U 'mineru[core]>=3.4.0' -i https://mirrors.aliyun.com/pypi/simple --break-system-packages && \+# Install MinerU 4 with Torch; reuse vLLM from the base image.+RUN python3 -m pip install -U 'mineru[torch]>=4.0,<5' -i https://mirrors.aliyun.com/pypi/simple --break-system-packages && \python3 -m pip cache purge-# Download models and update the configuration file-RUN /bin/bash -c "mineru-kit models download --tier standard -s modelscope"+# Keep build-time model downloads and runtime selection aligned, including builds without a GPU.+ENV MINERU_MODEL_SMALL_BACKEND=torch \+ MINERU_MODEL_VLM_ENGINE=vllm++# Download the Torch bundle and original VLM weights.+RUN /bin/bash -c "mineru-kit models download --tier standard --small-backend torch --vlm-engine vllm -s modelscope"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/china/corex.Dockerfile b/docker/china/corex.Dockerfileindex 24e1e2fb..f21eb2d5 100644--- a/docker/china/corex.Dockerfile+++ b/docker/china/corex.Dockerfile@@ -12,16 +12,16 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \- python3 -m pip install 'mineru[core]>=3.4.0' \+ python3 -m pip install 'mineru[core]>=3.4.0,<4' \numpy==1.26.4 \opencv-python==4.11.0.86 \-i https://mirrors.aliyun.com/pypi/simple && \python3 -m pip cache purge# Download models and update the configuration file-RUN /bin/bash -c "mineru-kit models download --tier standard -s modelscope"+RUN /bin/bash -c "mineru-models-download -s modelscope -m all"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/china/dcu.Dockerfile b/docker/china/dcu.Dockerfileindex ec1a0954..501b319e 100644--- a/docker/china/dcu.Dockerfile+++ b/docker/china/dcu.Dockerfile@@ -12,9 +12,9 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \- python3 -m pip install "mineru[gradio]>=3.4.0" \+ python3 -m pip install "mineru[gradio]>=3.4.0,<4" \"ftfy>=6.3.1,<7" \"shapely>=2.0.7,<3" \"pyclipper>=1.3.0,<2" \@@ -25,7 +25,7 @@ RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \python3 -m pip cache purge# Download models and update the configuration file-RUN /bin/bash -c "mineru-kit models download --tier standard -s modelscope"+RUN /bin/bash -c "mineru-models-download -s modelscope -m all"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/china/gcu.Dockerfile b/docker/china/gcu.Dockerfileindex 49f2288c..75d506cc 100644--- a/docker/china/gcu.Dockerfile+++ b/docker/china/gcu.Dockerfile@@ -16,15 +16,15 @@ deb http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe muapt-get clean && \rm -rf /var/lib/apt/lists/* /tmp/aliyun-sources.list-# Install mineru latest-RUN python3 -m pip install "mineru[core]>=3.4.0" \+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.+RUN python3 -m pip install "mineru[core]>=3.4.0,<4" \numpy==1.26.4 \opencv-python==4.11.0.86 \-i https://mirrors.aliyun.com/pypi/simple && \python3 -m pip cache purge# Download models and update the configuration file-RUN /bin/bash -c "mineru-kit models download --tier standard -s modelscope"+RUN /bin/bash -c "mineru-models-download -s modelscope -m all"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/china/kxpu.Dockerfile b/docker/china/kxpu.Dockerfileindex 86c4639f..ad01c875 100644--- a/docker/china/kxpu.Dockerfile+++ b/docker/china/kxpu.Dockerfile@@ -12,9 +12,9 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \- python3 -m pip install "mineru[gradio]>=3.4.0" \+ python3 -m pip install "mineru[gradio]>=3.4.0,<4" \"ftfy>=6.3.1,<7" \"shapely>=2.0.7,<3" \"pyclipper>=1.3.0,<2" \@@ -24,7 +24,7 @@ RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \python3 -m pip cache purge# Download models and update the configuration file-RUN /bin/bash -c "mineru-kit models download --tier standard -s modelscope"+RUN /bin/bash -c "mineru-models-download -s modelscope -m all"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/china/maca.Dockerfile b/docker/china/maca.Dockerfileindex 3b1d0ce5..9eba5007 100644--- a/docker/china/maca.Dockerfile+++ b/docker/china/maca.Dockerfile@@ -20,9 +20,9 @@ RUN apt-get update && \RUN sed -i '3s/^Version: 0.15.1+metax3\.1\.0\.4$/Version: 0.21.0+metax3.1.0.4/' /opt/conda/lib/python3.10/site-packages/torchvision-0.15.1+metax3.1.0.4.dist-info/METADATA && \mv /opt/conda/lib/python3.10/site-packages/torchvision-0.15.1+metax3.1.0.4.dist-info /opt/conda/lib/python3.10/site-packages/torchvision-0.21.0+metax3.1.0.4.dist-info-# Install mineru latest+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.RUN /opt/conda/bin/python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \- /opt/conda/bin/python3 -m pip install 'mineru[core]>=3.4.0' \+ /opt/conda/bin/python3 -m pip install 'mineru[core]>=3.4.0,<4' \numpy==1.26.4 \opencv-python==4.11.0.86 \-i https://mirrors.aliyun.com/pypi/simple && \@@ -32,7 +32,7 @@ RUN /opt/conda/bin/python3 -m pip install -U pip -i https://mirrors.aliyun.com/p/opt/conda/bin/python3 -m pip cache purge# Download models and update the configuration file-RUN /bin/bash -c "/opt/conda/bin/mineru-kit models download --tier standard -s modelscope"+RUN /bin/bash -c "/opt/conda/bin/mineru-models-download -s modelscope -m all"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/china/mlu.Dockerfile b/docker/china/mlu.Dockerfileindex 868e94cd..da5c797c 100644--- a/docker/china/mlu.Dockerfile+++ b/docker/china/mlu.Dockerfile@@ -16,13 +16,13 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.RUN /bin/bash -c '\if [ "$BACKEND" = "vllm" ]; then \source /torch/venv3/pytorch_infer/bin/activate; \fi && \python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \- python3 -m pip install "mineru[core]>=3.4.0" \+ python3 -m pip install "mineru[core]>=3.4.0,<4" \numpy==1.26.4 \opencv-python==4.11.0.86 \-i https://mirrors.aliyun.com/pypi/simple && \@@ -36,7 +36,7 @@ RUN /bin/bash -c '\if [ "$BACKEND" = "vllm" ]; then \source /torch/venv3/pytorch_infer/bin/activate; \fi && \- mineru-kit models download --tier standard -s modelscope'+ mineru-models-download -s modelscope -m all'WORKDIR /workspacediff --git a/docker/china/musa.Dockerfile b/docker/china/musa.Dockerfileindex 102dc5db..8907f8d0 100644--- a/docker/china/musa.Dockerfile+++ b/docker/china/musa.Dockerfile@@ -13,12 +13,12 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \git clone https://gitcode.com/gh_mirrors/vi/vision.git -b v0.20.0 --depth 1 && \cd vision && \python3 setup.py install && \- python3 -m pip install "mineru[gradio]>=3.4.0" \+ python3 -m pip install "mineru[gradio]>=3.4.0,<4" \"ftfy>=6.3.1,<7" \"shapely>=2.0.7,<3" \"pyclipper>=1.3.0,<2" \@@ -29,7 +29,7 @@ RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \python3 -m pip cache purge# Download models and update the configuration file-RUN /bin/bash -c "mineru-kit models download --tier standard -s modelscope"+RUN /bin/bash -c "mineru-models-download -s modelscope -m all"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/china/npu.Dockerfile b/docker/china/npu.Dockerfileindex b82ab0d8..f2cfeb02 100644--- a/docker/china/npu.Dockerfile+++ b/docker/china/npu.Dockerfile@@ -17,9 +17,9 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \- python3 -m pip install 'mineru[core]>=3.4.0' \+ python3 -m pip install 'mineru[core]>=3.4.0,<4' \numpy==1.26.4 \opencv-python==4.11.0.86 \-i https://mirrors.aliyun.com/pypi/simple && \@@ -29,7 +29,7 @@ RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \python3 -m pip cache purge# Download models and update the configuration file-RUN TORCH_DEVICE_BACKEND_AUTOLOAD=0 /bin/bash -c "mineru-kit models download --tier standard -s modelscope"+RUN TORCH_DEVICE_BACKEND_AUTOLOAD=0 /bin/bash -c "mineru-models-download -s modelscope -m all"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/china/ppu.Dockerfile b/docker/china/ppu.Dockerfileindex b9160a8b..f6ae9dc7 100644--- a/docker/china/ppu.Dockerfile+++ b/docker/china/ppu.Dockerfile@@ -16,9 +16,9 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest+# Keep this vendor adaptation on MinerU <4; preserve its runtime dependencies.RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \- python3 -m pip install 'mineru[core]>=3.4.0' \+ python3 -m pip install 'mineru[core]>=3.4.0,<4' \numpy==1.26.4 \opencv-python==4.11.0.86 \-i https://mirrors.aliyun.com/pypi/simple && \@@ -28,7 +28,7 @@ RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \python3 -m pip cache purge# Download models and update the configuration file-RUN /bin/bash -c "mineru-kit models download --tier standard -s modelscope"+RUN /bin/bash -c "mineru-models-download -s modelscope -m all"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docker/compose.yaml b/docker/compose.yamlindex fe39b38f..4e815240 100644--- a/docker/compose.yaml+++ b/docker/compose.yaml@@ -1,6 +1,6 @@services:mineru-openai-server:- image: mineru:latest+ image: mineru:4container_name: mineru-openai-serverrestart: alwaysprofiles: ["openai-server"]@@ -31,7 +31,7 @@ services:capabilities: [gpu]mineru-api:- image: mineru:latest+ image: mineru:4container_name: mineru-apirestart: alwaysprofiles: ["api"]@@ -61,7 +61,7 @@ services:capabilities: [gpu]mineru-router:- image: mineru:latest+ image: mineru:4container_name: mineru-routerrestart: alwaysprofiles: ["router"]@@ -101,18 +101,18 @@ services:device_ids: ["0"] # Modify for multiple GPUs: ["0", "1"]capabilities: [gpu]- mineru-gradio:- image: mineru:latest- container_name: mineru-gradio+ mineru-webui:+ image: mineru:4+ container_name: mineru-webuirestart: always- profiles: ["gradio"]+ profiles: ["webui"]ports:- 7860:7860environment:MINERU_MODEL_SOURCE: localentrypoint: ["mineru-kit"]command:- - gradio+ - webui- --server-name- 0.0.0.0- --server-portdiff --git a/docker/global/Dockerfile b/docker/global/Dockerfileindex 8e46f8e8..247e8459 100644--- a/docker/global/Dockerfile+++ b/docker/global/Dockerfile@@ -16,12 +16,16 @@ RUN apt-get update && \apt-get clean && \rm -rf /var/lib/apt/lists/*-# Install mineru latest-RUN python3 -m pip install -U 'mineru[core]>=3.4.0' --break-system-packages && \+# Install MinerU 4 with Torch; reuse vLLM from the base image.+RUN python3 -m pip install -U 'mineru[torch]>=4.0,<5' --break-system-packages && \python3 -m pip cache purge-# Download models and update the configuration file-RUN /bin/bash -c "mineru-kit models download --tier standard -s huggingface"+# Keep build-time model downloads and runtime selection aligned, including builds without a GPU.+ENV MINERU_MODEL_SMALL_BACKEND=torch \+ MINERU_MODEL_VLM_ENGINE=vllm++# Download the Torch bundle and original VLM weights.+RUN /bin/bash -c "mineru-kit models download --tier standard --small-backend torch --vlm-engine vllm -s huggingface"# Set the entry point to activate the virtual environment and run the command line toolENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]diff --git a/docs/en/faq/index.md b/docs/en/faq/index.mdindex 7b7fe4b2..8d3b599f 100644--- a/docs/en/faq/index.md+++ b/docs/en/faq/index.md@@ -4,29 +4,17 @@ If your question is not listed, try using [DeepWiki](https://deepwiki.com/opendaFor unresolved problems, join our [Discord](https://discord.gg/Tdedn9GTXq) or [WeChat](https://mineru.net/community-portal/?aliasId=3c430f94) community for support.-??? question "What should I do if inference is slow after installing directly on Windows?"+??? question "Why is Windows inference slow, or engine installation failing?"- ### What should I do if inference is slow after installing directly on Windows? {#windows-cuda-acceleration}+ ### Windows CUDA acceleration {#windows-cuda-acceleration}- If inference is slow after a direct Windows installation, CUDA acceleration dependencies are usually not installed correctly. Choose the solution based on your GPU architecture:+ The base package can use ONNX / CPU and llama.cpp. For Torch small models and LMDeploy, install `"mineru[full]>=4.0,<5"` in the owning environment, then check Torch CUDA support, GPU drivers, and the Python range of engine wheels.- - Volta / Turing / Ampere / Ada Lovelace GPUs, such as V100, 20 series, T4, 30 series, and 40 series: install CUDA-enabled `torch` and `torchvision` directly. Go to the [PyTorch official website](https://pytorch.org/get-started/locally/) and select the Windows installation command that matches your CUDA version.- - Blackwell GPUs, such as the RTX 50xx series: install the `lmdeploy 0.11.1 + cu128` Windows wheel. Set `PYTHON_VERSION` to your current Python version, for example `310` / `311` / `312` / `313` for Python 3.10 / 3.11 / 3.12 / 3.13.+ 4.0 uses `lmdeploy>=0.17.0,<0.18` and Transformers 5. Do not reuse old LMDeploy 0.11.x wheel recipes or bypass dependency checks. See [extension modules](../quick_start/extension_modules.md) and [tiers](../usage/tiers.md).- ```powershell- $env:LMDEPLOY_VERSION = "0.11.1"- $env:PYTHON_VERSION = "312"-- $wheel = "https://github.com/InternLM/lmdeploy/releases/download/v$($env:LMDEPLOY_VERSION)/lmdeploy-$($env:LMDEPLOY_VERSION)+cu128-cp$($env:PYTHON_VERSION)-cp$($env:PYTHON_VERSION)-win_amd64.whl"- pip install $wheel --extra-index-url https://download.pytorch.org/whl/cu128- ```-- If you are using a Blackwell GPU and have already installed the cu128 version of `torch`, define `$wheel` first and then run the following command to avoid downloading a lower-version `torch` again:-- ```powershell- pip install $wheel --no-dependencies- ```+??? question "What changed in commands, APIs, and configuration?"+ The 4.0 WebUI uses `mineru-kit webui` / `mineru-webui`, parsing APIs use `/v1/*`, and configuration uses `config.yaml`. Old `/file_parse`, `/tasks`, and `model.stack` cannot be reused directly. See [migration](../reference/migration_4.md).??? question "Encountered the error `ImportError: libGL.so.1: cannot open shared object file: No such file or directory` in Ubuntu 22.04 on WSL2"diff --git a/docs/en/index.md b/docs/en/index.mdindex ae6aa267..35af45ca 100644--- a/docs/en/index.md+++ b/docs/en/index.md@@ -1,76 +1,25 @@-<div align="center" xmlns="http://www.w3.org/1999/html">-<!-- logo -->-<p align="center">- <img src="https://opendatalab.github.io/MinerU/images/MinerU-logo.png" width="300px" style="vertical-align:middle;">-</p>-</div>+# MinerU 4.0-<!-- icon -->+{ width="300" }-[](https://github.com/opendatalab/MinerU)-[](https://github.com/opendatalab/MinerU)-[](https://github.com/opendatalab/MinerU/issues)-[](https://github.com/opendatalab/MinerU/issues)-[](https://pypi.org/project/mineru/)-[](https://pypi.org/project/mineru/)-[](https://pepy.tech/project/mineru)-[](https://pepy.tech/project/mineru)-[](https://mineru.net/OpenSourceTools/Extractor?source=github)-[](https://huggingface.co/spaces/opendatalab/MinerU)-[](https://www.modelscope.cn/studios/OpenDataLab/MinerU)-[](https://colab.research.google.com/gist/myhloli/a3cb16570ab3cfeadf9d8f0ac91b4fca/mineru_demo.ipynb)-[](https://arxiv.org/abs/2409.18839)-[](https://arxiv.org/abs/2509.22186)-[](https://arxiv.org/abs/2604.04771)-[](https://deepwiki.com/opendatalab/MinerU)+MinerU 4.0 brings document parsing, a local document library, and service tools into one workflow for document conversion, application integration, and agent reading.-<div align="center">-<a href="https://trendshift.io/repositories/11174" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11174" alt="opendatalab%2FMinerU | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>+- **Four parsing tiers**: Flash for fast previews and indexing, Basic for OCR and model-based parsing, and Standard / Advanced for more demanding layouts and quality requirements.+- **Multiple input formats**: PDF, images, DOC/DOCX, PPT/PPTX, XLS/XLSX, RTF, ODT/ODS/ODP, EPUB, OFD, HTML, and CSV/TSV. DocVortex provides native document parsing.+- **Document library and agent reading**: discover files, cache results, search content, continue by page or block, and preserve stable citation locators.+- **Independent model configuration**: ONNX or Torch for small models; llama.cpp, vLLM, LMDeploy, or manually installed and explicitly configured MLX for the VLM.+- **Unified tools**: Python SDK, V1 API, stateless batch conversion, multi-service Router, and a Gradio-based WebUI.+- **Structured results and rendering**: one document model supports nine rendering targets: Markdown, HTML, LaTeX, DOCX, EPUB, PDF, Structured Content, and Content List V1/V2. Each CLI/API exposes its own subset of exports.-<!-- hot link -->+PDF and images support all four tiers. Office, OpenDocument, EPUB, OFD, HTML, and CSV/TSV use local Flash native parsing. Plain text is read directly rather than parsed. Documents are not automatically uploaded to the official service; remote parsing requires explicit configuration.-<p align="center">-🚀<a href="https://mineru.net/?source=github">MinerU Official Website→✅ Zero-Install Online Version ✅ Full-Featured Client ✅ Developer API Online Access, skip deployment hassles, get all product formats with one click, go fast!</a>-</p>+## Get started-<!-- join us -->+- [Install and get started](quick_start/index.md)+- [Tiers and runtimes](usage/tiers.md)+- [Python SDK and V1 API](usage/sdk_api.md)+- [3.x → 4.0 migration](reference/migration_4.md)+- [Legacy platforms (MinerU <4)](usage/compatibility.md)+- [Release history](reference/changelog.md)-<p align="center">- 👋 join us on <a href="https://discord.gg/Tdedn9GTXq" target="_blank">Discord</a> and <a href="https://mineru.net/community-portal/?aliasId=3c430f94" target="_blank">WeChat</a>-</p>-</div>--## Project Introduction--MinerU is a document parsing tool that converts `PDF`, `EPUB`, static `HTML`, image, `CSV`, `RTF`, `DOCX`, `PPTX`, `XLSX`, `ODT`, `ODS`, and `ODP` inputs into machine-readable formats such as Markdown and JSON for downstream retrieval, extraction, and processing.-MinerU was born during the pre-training process of [InternLM](https://github.com/InternLM/InternLM). We focus on solving symbol conversion issues in scientific literature and hope to contribute to technological development in the era of large models.-Compared to well-known commercial products domestically and internationally, MinerU is still young. If you encounter any issues or if the results are not as expected, please submit an issue on [GitHub Issues](https://github.com/opendatalab/MinerU/issues) and **attach the relevant document or sample file**.----## Key Features--- Support `PDF`, `EPUB`, static `HTML`, image, `CSV`, `RTF`, `DOCX`, `PPTX`, `XLSX`, `ODT`, `ODS`, and `ODP` inputs-- Remove headers, footers, footnotes, page numbers and other elements to ensure semantic coherence-- Output text in human reading order, suitable for single-column, multi-column and complex layouts-- Retain the original document structure, including titles, paragraphs, lists, etc.-- Extract images, image descriptions, tables, table titles and footnotes-- Automatically identify and convert formulas in documents to LaTeX format-- Automatically identify and convert tables in documents to HTML format-- Automatically detect scanned PDFs and garbled PDFs, and enable OCR functionality-- OCR supports detection and recognition of 109 languages-- Support multiple output formats, such as multimodal and NLP Markdown, reading-order-sorted JSON, and information-rich intermediate formats-- Support layout visualization for efficient confirmation of output effects and quality inspection-- Built-in CLI, FastAPI, Gradio WebUI, for local orchestration and multi-service deployment-- Support pure CPU environment operation, and support GPU(CUDA)/NPU(CANN)/MPS acceleration-- Compatible with Windows, Linux and Mac platforms---## User Guide--- [Quick Start Guide](./quick_start/index.md)-- [Detailed Usage Instructions](./usage/index.md)--## License Information--This repository is licensed under the [MinerU Open Source License](https://github.com/opendatalab/MinerU/blob/master/LICENSE.md), based on Apache 2.0 with additional conditions.+[GitHub](https://github.com/opendatalab/MinerU) · [MinerU](https://mineru.net/) · [License](https://github.com/opendatalab/MinerU/blob/master/LICENSE.md)diff --git a/docs/en/quick_start/docker_deployment.md b/docs/en/quick_start/docker_deployment.mdindex 47848515..47738279 100644--- a/docs/en/quick_start/docker_deployment.md+++ b/docs/en/quick_start/docker_deployment.md@@ -1,97 +1,56 @@-# Deploying MinerU with Docker+# Docker Deployment (MinerU 4.0 / NVIDIA)-MinerU provides a convenient Docker deployment method, which helps quickly set up the environment and solve some tricky environment compatibility issues.+The general Docker setup targets Linux with NVIDIA GPUs (WSL2 on Windows). Install directly on macOS for Apple Silicon; this Docker workflow does not provide MPS/MLX acceleration. AMD and vendor accelerators use the [legacy guides](../usage/compatibility.md), whose dedicated Dockerfiles stay on `mineru<4`.-> [!WARNING]-> - Docker deployment is only supported on Linux and Windows environments with WSL2.-> - Do not use Docker to deploy MinerU on macOS. Docker on macOS cannot access MPS or MLX acceleration, so Apple Silicon devices will not get the expected acceleration from this workflow.+## Build the image-## Build Docker Image using Dockerfile+Run from a repository root containing the 4.0 Dockerfile:```bash-wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/global/Dockerfile-docker build -t mineru:latest -f Dockerfile .+docker build -t mineru:4 -f docker/global/Dockerfile .```-## Docker Description+The base image keeps vLLM 0.21.0. The Dockerfile installs `mineru[torch]>=4.0,<5` and reuses the bundled vLLM. The default image uses CUDA 13.0; enable the commented `v0.21.0-cu129` base image for CUDA 12.9 and ensure the host driver supports the selected runtime.-MinerU's Docker uses `vllm/vllm-openai` as the base image, so it includes the `vllm` inference acceleration framework and necessary dependencies by default. The current Dockerfile uses `vllm/vllm-openai:v0.21.0` by default for CUDA 13.0-compatible environments. If your environment requires a CUDA 12.9-compatible image, comment out the default `FROM` line at the top of the Dockerfile and enable the commented `vllm/vllm-openai:v0.21.0-cu129` base image instead. Therefore, on compatible devices, you can directly use `vllm` to accelerate VLM model inference.+Build-time downloads explicitly select Torch small models and original vLLM weights. Runtime selection is also fixed with `MINERU_MODEL_SMALL_BACKEND=torch` and `MINERU_MODEL_VLM_ENGINE=vllm`. A build machine without a GPU can therefore prepare the correct weights, while inference still requires matching GPU hardware. The China Dockerfile uses ModelScope; the global version uses Hugging Face.-> [!NOTE]-> Requirements for using `vllm` to accelerate VLM model inference:->-> - Device must have Volta architecture or later graphics cards with 8GB+ available VRAM.-> - The host machine's graphics driver must support the CUDA runtime used by the selected base image: the default `v0.21.0` image requires a CUDA 13.0-compatible driver, and `v0.21.0-cu129` requires a CUDA 12.9-compatible driver. You can check the driver version using the `nvidia-smi` command.-> - Docker container must have access to the host machine's graphics devices.+## Interactive container-## Start Docker Container+```bash+docker run --gpus all --shm-size 32g --ipc=host \+ -p 7860:7860 -p 8000:8000 -p 8002:8002 -p 30000:30000 \+ -it mineru:4 /bin/bash+```++Start the WebUI inside the container:```bash-docker run --gpus all \- --shm-size 32g \- -p 30000:30000 -p 7860:7860 -p 8000:8000 -p 8002:8002 \- --ipc=host \- -it mineru:latest \- /bin/bash+mineru-kit webui --server-name 0.0.0.0 --server-port 7860```-After executing this command, you will enter the Docker container's interactive terminal with some ports mapped for potential services. You can directly run MinerU-related commands within the container to use MinerU's features.-You can also directly start MinerU services by replacing `/bin/bash` with service startup commands. For detailed instructions, please refer to the [Start the service via command](https://opendatalab.github.io/MinerU/usage/quick_usage/#advanced-usage-via-api-webui-http-clientserver).+## Docker Compose++These commands use the Compose configuration in the same checkout and the locally built `mineru:4` image. Choose a service profile as needed; running multiple model services together requires planning GPU and memory allocation.++```bash+docker compose -f docker/compose.yaml --profile webui up -d+docker compose -f docker/compose.yaml --profile api up -d+docker compose -f docker/compose.yaml --profile router up -d+docker compose -f docker/compose.yaml --profile openai-server up -d+```-## Start Services Directly with Docker Compose+| Profile | Address / health check | Purpose |+| --- | --- | --- |+| `webui` | `http://127.0.0.1:7860` | Document UI; service name `mineru-webui` |+| `api` | `http://127.0.0.1:8000/v1/health` | V1 document parsing API |+| `router` | `http://127.0.0.1:8002/v1/health` | Multi-service / multi-GPU V1 entrypoint |+| `openai-server` | `http://127.0.0.1:30000/health` | OpenAI-compatible VLM inference, not the parsing API |-We provide a [compose.yaml](https://github.com/opendatalab/MinerU/blob/master/docker/compose.yaml) file that you can use to quickly start MinerU services.+Inspect configuration and logs:```bash-# Download compose.yaml file-wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml+docker compose -f docker/compose.yaml --profile webui config+docker compose -f docker/compose.yaml logs mineru-webui```->[!NOTE]->->- The `compose.yaml` file contains configurations for multiple services of MinerU, you can choose to start specific services as needed.->- Different services might have additional parameter configurations, which you can view and edit in the `compose.yaml` file.->- Due to the pre-allocation of GPU memory by the `vllm` inference acceleration framework, you may not be able to run multiple `vllm` services simultaneously on the same machine. Therefore, ensure that other services that might use GPU memory have been stopped before starting the `vlm-openai-server` service or using the `vlm-vllm-engine` backend.-------### Start OpenAI-compatible server service-connect to `openai-server` via `vlm-http-client` backend- ```bash- docker compose -f compose.yaml --profile openai-server up -d- ```- >[!TIP]- >In another terminal, connect to openai server via http client (only requires CPU and network, no vllm environment needed)- > ```bash- > mineru -p <input_path> -o <output_path> -b vlm-http-client -u http://<server_ip>:30000- > ```-------### Start Web API service- ```bash- docker compose -f compose.yaml --profile api up -d- ```- >[!TIP]- >Access `http://<server_ip>:8000/docs` in your browser to view the API documentation.-------### Start MinerU Router service- ```bash- docker compose -f compose.yaml --profile router up -d- ```- >[!TIP]- >- >- The default configuration runs in `--local-gpus auto` mode, automatically starting local workers in the container and exposing the unified entry at `http://<server_ip>:8002/docs`.- >- If you want to aggregate existing `mineru-api` services instead of starting local workers, refer to the commented example under the `mineru-router` service in `compose.yaml` and switch to `--upstream-url`.-------### Start Gradio WebUI service- ```bash- docker compose -f compose.yaml --profile gradio up -d- ```- >[!TIP]- >- >- Access `http://<server_ip>:7860` in your browser to use the Gradio WebUI.+When upgrading from the old Compose file, change the `gradio` profile to `webui` and the service name to `mineru-webui`. Adjust mounts, GPU `device_ids`, and ports for your deployment. See [SDK and API](../usage/sdk_api.md).diff --git a/docs/en/quick_start/extension_modules.md b/docs/en/quick_start/extension_modules.mdindex aa407ec5..6d70d20a 100644--- a/docs/en/quick_start/extension_modules.md+++ b/docs/en/quick_start/extension_modules.md@@ -1,58 +1,38 @@-# MinerU Extension Modules Installation Guide-MinerU supports installing extension modules on demand based on different needs to enhance functionality or support specific model backends.+# Extension Modules-## Common Scenarios+All examples target MinerU 4.x and run inside an activated virtual environment.++| Installation | Includes | Use case |+| --- | --- | --- |+| `mineru>=4.0,<5` | ONNX, llama.cpp, WebUI, SDK/API; Torch is automatic on Apple Silicon | Native documents, CPU small models, llama.cpp, or an existing service |+| `mineru[torch]>=4.0,<5` | Base package + Torch, Torchvision, Transformers, Accelerate | Torch small models with an independently selected VLM engine |+| `mineru[full]>=4.0,<5` | Torch extra + vLLM on Linux / LMDeploy on Windows | Higher-throughput serving on supported devices |-### Core Functionality Installation-The `core` module is the core dependency of MinerU, containing common parsing features but not optional modules such as `vllm`/`lmdeploy`. Installing this module ensures the basic functionality of MinerU works properly.```bash-uv pip install "mineru[core]"+uv pip install -U "mineru[torch]>=4.0,<5"```------### Using `vllm` to Accelerate VLM Model Inference-> [!NOTE]-> `vllm` and `lmdeploy` have nearly identical VLM inference acceleration effects and usage methods. You can choose one of them to install and use based on your actual needs, but it is not recommended to install both modules simultaneously to avoid potential dependency conflicts.--The `vllm` module provides acceleration support for VLM model inference, suitable for graphics cards with Volta architecture and later (8GB+ VRAM). Installing this module can significantly improve model inference speed.+Or install the platform-specific inference engine:```bash-uv pip install "mineru[core,vllm]"+uv pip install -U "mineru[full]>=4.0,<5"```-> [!TIP]-> - Because the `vllm` extra now allows the 0.21 series, the default installation usually resolves to the newer `vllm` version allowed by the current range. Make sure the host GPU driver supports the CUDA runtime required by the installed `vllm` package; the default path requires a CUDA 13.0-compatible driver.-> - If you need a CUDA 12.9-compatible environment, follow the [vllm official documentation](https://docs.vllm.ai/en/latest/getting_started/installation/index.html) to select the matching CUDA installation path, or use the `vllm/vllm-openai:v0.21.0-cu129` base image from the [Docker](./docker_deployment.md) deployment workflow.-> - If exceptions occur during installation of the extra package including vllm, you can also refer to the [vllm official documentation](https://docs.vllm.ai/en/latest/getting_started/installation/index.html) to troubleshoot them.----+`all` composes `full`. `core`, `pipeline`, `vlm`, `vllm`, `lmdeploy`, `gradio`, and `mlx` are no longer MinerU 4.0 extras. Tier names are not extras either.-### Using `lmdeploy` to Accelerate VLM Model Inference-> [!NOTE]-> `vllm` and `lmdeploy` have nearly identical VLM inference acceleration effects and usage methods. You can choose one of them to install and use based on your actual needs, but it is not recommended to install both modules simultaneously to avoid potential dependency conflicts.+## Optional engine constraints-The `lmdeploy` module provides acceleration support for VLM model inference, suitable for graphics cards with Volta architecture and later (8GB+ VRAM). Installing this module can significantly improve model inference speed.+The current 4.0 dependency declarations are `torch>=2.7.0,<3`, `transformers>=5.10.1,<6`, Linux `vllm>=0.19.1,<0.29.0`, and Windows `lmdeploy>=0.17.0,<0.18`. Intersect the package's Python range with the wheels actually available for these dependencies. Check the [legacy platform policy](../usage/compatibility.md) before upgrading a vendor environment.-```bash-uv pip install "mineru[core,lmdeploy]"-```-> [!TIP]-> If exceptions occur during installation of the extra package including lmdeploy, please refer to the [lmdeploy official documentation](https://lmdeploy.readthedocs.io/en/latest/get_started/installation.html) to try to resolve the issue.+Apple Silicon defaults to llama.cpp for the VLM; `full` does not install MLX. Install and select MLX explicitly when needed:------### Installing Lightweight Client to Connect to OpenAI-compatible servers (for vlm-http-client mode)-If you need to install a lightweight client on edge devices to connect to an OpenAI-compatible server for using VLM mode, you can install the basic mineru package, which is very lightweight and suitable for devices with only CPU and network connectivity.```bash-uv pip install mineru-mineru -p <input_path> -o <output_path> -b vlm-http-client -u http://127.0.0.1:30000+uv pip install "mineru>=4.0,<5" "mlx-vlm>=0.7.0,<0.8.0"+mineru config set model.vlm.engine mlx```----+The WebUI uses Gradio 6 and bundled PDF.js preview assets; it does not require `gradio-pdf`. A separate UI environment can use the base package and connect with `mineru-kit webui --api-url http://127.0.0.1:8000`.-### Installing Lightweight Client to Connect to OpenAI-compatible servers (for hybrid-http-client mode)-If you need to install a lightweight client on edge devices to connect to an OpenAI-compatible server for using hybrid mode, you can install the mineru pipeline extension package, which is relatively lightweight and can be used on devices with only CPU and network connectivity, while running faster on devices that support GPU acceleration.-```bash-uv pip install "mineru[pipeline]"-mineru -p <input_path> -o <output_path> -b hybrid-http-client -u http://127.0.0.1:30000-```+## Upgrade an existing environment++Stop that environment's MinerU services before upgrading with the original installer. Preserve the required extras, then check the version, dependencies, and model configuration. Downloads and inference must use the same `model.small_backend` and `model.vlm.engine`; see [Model Source](../usage/model_source.md).diff --git a/docs/en/quick_start/index.md b/docs/en/quick_start/index.mdindex 2a47cb98..8c9522c4 100644--- a/docs/en/quick_start/index.md+++ b/docs/en/quick_start/index.md@@ -1,153 +1,100 @@# Quick Start-Document parsing is a difficult and complex task. In scenarios such as complex layouts, scanned pages, and handwritten content, the parsing results may fall short of expectations. We recommend trying the online demo first to evaluate MinerU's parsing quality and suitability before choosing an appropriate deployment method based on your actual needs.-If you have **document** samples with unsatisfactory parsing results, feel free to share them in an [issue](https://github.com/opendatalab/MinerU/issues). We will continue improving the parsing capabilities.-If you encounter any installation issues, please check the [FAQ](../faq/index.md) first.--## Online Experience--### Official online web application-The official online version has the same functionality as the client, with a beautiful interface and rich features, requires login to use--- [](https://mineru.net/OpenSourceTools/Extractor?source=github)--### Gradio-based online demo-A WebUI developed based on Gradio, with a simple interface and only core parsing functionality, no login required--- [](https://www.modelscope.cn/studios/OpenDataLab/MinerU)-- [](https://huggingface.co/spaces/opendatalab/MinerU)--## Local Deployment--> [!WARNING]-> **Prerequisites - Hardware and Software Environment Support**->-> To ensure the stability and reliability of the project, we have optimized and tested only specific hardware and software environments during development. This ensures that users can achieve optimal performance and encounter the fewest compatibility issues when deploying and running the project on recommended system configurations.->-> By concentrating our resources and efforts on mainstream environments, our team can more efficiently resolve potential bugs and timely develop new features.->-> In non-mainstream environments, due to the diversity of hardware and software configurations, as well as compatibility issues with third-party dependencies, we cannot guarantee 100% usability of the project. Therefore, for users who wish to use this project in non-recommended environments, we suggest carefully reading the documentation and FAQ first, as most issues have corresponding solutions in the FAQ. Additionally, we encourage community feedback on issues so that we can gradually expand our support range.--<table border="1">- <thead>- <tr>- <th rowspan="2" style="text-align:center; vertical-align:middle;">Parsing Backend</th>- <th rowspan="2" style="text-align:center; vertical-align:middle;">hybrid low</th>- <th colspan="2" style="text-align:center;">*-engine</th>- <th colspan="2" style="text-align:center;">*-http-client</th>- </tr>- <tr>- <th>hybrid</th>- <th>vlm</th>- <th>hybrid</th>- <th>vlm</th>- </tr>- </thead>- <tbody>- <tr>- <th>Backend Features</th>- <td >Good Compatibility</td>- <td colspan="2">High Hardware Requirements</td>- <td colspan="2">For OpenAI Compatible Servers<sup>2</sup></td>- </tr>- <tr>- <th>Accuracy<sup>1</sup></th>- <td style="text-align:center;">86.47</td>- <td style="text-align:center;">95.39 (effort=high)<br>95.26 (effort=medium)</td>- <td style="text-align:center;">95.30</td>- <td style="text-align:center;">95.39 (effort=high)<br>95.26 (effort=medium)</td>- <td style="text-align:center;">95.30</td>- </tr>- <tr>- <th>Operating System</th>- <td colspan="5" style="text-align:center;">Linux<sup>3</sup> / Windows<sup>4</sup> / macOS<sup>5</sup></td>- </tr>- <tr>- <th>Pure CPU Support</th>- <td style="text-align:center;">✅</td>- <td colspan="2" style="text-align:center;">❌</td>- <td colspan="2" style="text-align:center;">✅</td>- </tr>- <tr>- <th>GPU Acceleration</th>- <td colspan="4" style="text-align:center;">Volta and later architecture GPUs or Apple Silicon</td>- <td rowspan="2" style="text-align:center; vertical-align:middle;">Not Required</td>- </tr>- <tr>- <th>Min VRAM</th>- <td style="text-align:center;">4GB</td>- <td colspan="2" style="text-align:center;">8GB</td>- <td style="text-align:center;">2GB</td>- </tr>- <tr>- <th>RAM</th>- <td colspan="3" style="text-align:center;">Min 16GB+, Recommended 32GB+</td>- <td colspan="2" style="text-align:center;">16GB</td>- </tr>- <tr>- <th>Disk Space</th>- <td colspan="3" style="text-align:center;">20GB+, SSD Recommended</td>- <td colspan="2" style="text-align:center;">2GB</td>- </tr>- <tr>- <th>Python Version</th>- <td colspan="5" style="text-align:center;">3.10-3.13</td>- </tr>- </tbody>-</table>--<sup>1</sup> Accuracy metrics are the End-to-End Evaluation Overall scores from OmniDocBench (v1.6), based on the latest version of `MinerU`.-<sup>2</sup> Servers compatible with OpenAI API, such as local model servers or remote model services deployed via inference frameworks like `vLLM`/`SGLang`/`LMDeploy`.-<sup>3</sup> Linux only supports distributions from 2019 and later.-<sup>4</sup> Since the key dependency `ray` does not support Python 3.13 on Windows, only versions 3.10~3.12 are supported.-<sup>5</sup> macOS requires version 14.0 or later.---### Install MinerU--#### Install MinerU using pip or uv+This guide targets the **MinerU 4.0 stable release**. Existing AMD and vendor accelerator adaptations remain on `<4`; use the [legacy platform guides](../usage/compatibility.md).++## Install MinerU++The MinerU package supports Python `>=3.10,<3.15`. Python 3.12 is a practical starting point for a new environment. Optional engines such as vLLM, LMDeploy, and Torch have additional wheel, OS, and driver constraints; the package's Python range does not guarantee every engine supports that entire range.+```bash-pip install --upgrade pip-pip install uv-uv pip install -U "mineru[all]"+uv venv --python 3.12 .venv```-#### Install MinerU from source code+Activate on Linux / macOS:+```bash-git clone https://github.com/opendatalab/MinerU.git-cd MinerU-uv pip install -e .[all]+source .venv/bin/activate+```++Activate in Windows PowerShell:++```powershell+.venv\Scripts\Activate.ps1```-> [!TIP]-> - `mineru[all]` includes all core features, compatible with Windows / Linux / macOS systems, suitable for most users.-> - If CUDA acceleration is unavailable after installing on Windows, see the [Windows CUDA acceleration FAQ](../faq/index.md#windows-cuda-acceleration).-> - If you need to specify the inference framework for the VLM model, or only intend to install a lightweight client on an edge device, please refer to the documentation [Extension Modules Installation Guide](https://opendatalab.github.io/MinerU/quick_start/extension_modules/).+Install the base package:------#### Deploy MinerU using Docker-MinerU provides a convenient Docker deployment method, which helps quickly set up the environment and solve some tricky environment compatibility issues.+```bash+uv pip install -U "mineru>=4.0,<5"+```-> [!TIP]-> - Docker deployment is only supported on Linux and Windows environments with WSL2 support;-> - macOS users should refer to the two installation methods above for installation instead of using Docker deployment.+Alternatively, run `python -m pip install -U "mineru>=4.0,<5"` in the activated environment. A package mirror can be selected with the installer's `-i` option.-You can get the [Docker Deployment Instructions](./docker_deployment.md) in the documentation.+The base package includes the WebUI, ONNX small-model runtime, and llama.cpp VLM. Apple Silicon automatically includes Torch dependencies. For Torch small models or higher-throughput VLM serving, see [extension modules](extension_modules.md) for the `torch` and `full` extras. Do not use 3.x extras.----+## First conversion-### Using MinerU+Parse a single file without a document library and write Markdown to a file:-If your device meets the GPU acceleration requirements in the table above, you can use a simple command line for document parsing:```bash-mineru -p <input_path> -o <output_path>+mineru-kit parse document.pdf -o document.md --tier standard```-If your device does not meet the GPU acceleration requirements, you can explicitly use the Flash tier to run without VLM calls:++The first model-backed parse may download weights. For native PDF text extraction without inference models, explicitly select:+```bash-mineru parse "<input_path>" --tier flash -o <output_path>+mineru-kit parse document.pdf -o document.md --tier flash --ocr-mode txt```-`mineru` currently supports local `PDF`, `EPUB`, image, `CSV`, `RTF`, `DOCX`, `PPTX`, `XLSX`, `ODT`, `ODS`, and `ODP` file or directory inputs through modern CLI and API entry points. EPUB, RTF, and OpenDocument are parsed locally with Flash semantics and do not require an external office suite. Only PDF accepts page ranges; every non-PDF input is parsed and cached as one complete file, while format-native boundaries remain logical pages in structured output. EPUB pages follow OPF spine order and preserve resolvable internal links from authored contents.+This reads the PDF text layer and does not add an OCR fallback for scanned pages. Use `--ocr-mode ocr` and prepare the relevant models for scanned PDFs.++Native documents and batch conversion:++```bash+mineru-kit parse report.docx -o report.md --tier flash+mineru-kit parse ./documents -o ./output --format zip+```++For directories or multiple inputs, `-o` must be a directory. For single-file Markdown output, use a file path. `mineru-kit parse` defaults to all PDF pages.++## Document library and agents++```bash+mineru parse document.pdf --json+mineru parse document.pdf --pages all -o document.md+mineru search "keyword" --json+```++`mineru` uses the document library and cache. `mineru parse` defaults to the first 10 PDF pages and may return a continuation request when the output reaches its length budget. Follow the returned locator and `next_request`. This differs from `mineru-kit parse`, which directly writes complete conversion outputs; see [Quick Usage](../usage/quick_usage.md).++## WebUI and API++```bash+mineru-kit webui --server-name 127.0.0.1 --server-port 7860+```++Open the [local WebUI](http://127.0.0.1:7860). `mineru-webui` is the standalone command for the same entrypoint. Without `--api-url`, the WebUI manages a local V1 API server. See [SDK and API](../usage/sdk_api.md) to connect an existing service.++```bash+mineru-kit api-server --host 127.0.0.1 --port 8000 --tier standard+```++Inspect the running service through its [OpenAPI documentation](http://127.0.0.1:8000/docs).++## Install from source++Run from a repository checkout containing the 4.0 source:++```bash+uv pip install -e .+mineru version --json+```++Confirm a 4.x version; a development checkout may report a prerelease. For NVIDIA containers, see [Docker deployment](docker_deployment.md).++## Next steps-The legacy Gradio WebUI keeps its existing upload formats and does not yet accept CSV. For detailed instructions, please refer to the [Usage Guide](../usage/index.md).+- [Tiers and runtimes](../usage/tiers.md)+- [Model downloads and configuration](../usage/model_source.md)+- [3.x → 4.0 migration](../reference/migration_4.md)+- [Official application](https://mineru.net/) and [online demos](../demo/index.md)diff --git a/docs/en/reference/changelog.md b/docs/en/reference/changelog.mdindex b675a429..d62b6513 100644--- a/docs/en/reference/changelog.md+++ b/docs/en/reference/changelog.md@@ -2,7 +2,83 @@This document records the release history of MinerU, including major capability changes, compatibility updates, and notable fixes.----+## 4.0++- Four parsing tiers, native document formats, a local library, and progressive reading.+- ONNX/Torch small models with independent VLM engines, plus unified SDK, V1 API, WebUI, and rendering interfaces.+- See the [4.0 overview](../index.md) and [migration guide](migration_4.md) for capabilities and deployment changes. Legacy platform adaptations remain on `mineru<4`.++## 3.x release history++- 2026/06/18 3.4 Released++ This release focuses on **OCR capability upgrades for the pipeline backend**, **OCR processing pipeline optimization**, and **model download experience improvements**. The main updates include:++ - OCR model upgrade and processing acceleration+ - The OCR model for the `pipeline` backend has been upgraded to `PP-OCRv6`, improving OCR accuracy by about `11%` on OmniDocBench v1.6.+ - Removed Japanese, Traditional Chinese, English, and Latin options from OCR language selection. These scenarios are now routed to the `ch` OCR model, simplifying model configuration and language selection.+ - Optimized the OCR inference and processing pipeline, increasing OCR processing speed by about `100%` and significantly improving parsing efficiency for batch documents and OCR-intensive documents.++ - Model download logic optimization+ - Added automatic model source selection, allowing first-time installations to choose a better model source based on the current network environment.+ - Before downloading models, MinerU now prioritizes checking locally downloaded model cache files. Cache hits can be reused directly, reducing repeated downloads and unnecessary remote requests.+ - For more details about model source configuration, automatic source selection, and local model usage, see the [Model Source Documentation](https://opendatalab.github.io/MinerU/usage/model_source/).++ With the 3.4 release, MinerU further improves the parsing accuracy and processing efficiency of the `pipeline` backend in OCR scenarios. It also optimizes model downloads, cache reuse, and local configuration write-back, making first-time installation, model updates, and multi-environment deployment more stable and automated.++- 2026/06/11 3.3 Released++ This release focuses on **Hybrid parsing performance optimization** and **VLM model capability upgrades**. The main updates include:++ - New `effort` parsing-strength parameter for the Hybrid backend+ - Added two parsing-strength levels, `medium` and `high`, allowing users to balance parsing speed, parsing accuracy, and feature requirements.+ - On OmniDocBench v1.6, `medium` reduces overall accuracy by only `0.13` points compared with `high`, while delivering `35%` ~ `220%` parsing speed improvements across different devices and scenarios.+ - The default Hybrid backend now uses `effort=medium`, significantly improving overall parsing efficiency while maintaining high parsing accuracy.+ - The `medium` level does not support `image analysis`; for maximum parsing accuracy or `image analysis` support, switch to `effort=high`.++ - VLM model upgraded to `MinerU2.5-Pro-2605-1.2B`+ - Fixed multiple model issues found in the `2604` version, further improving parsing stability on complex documents.+ - Added native multilingual OCR support, reducing the need for extra language-parameter configuration.++- 2026/04/18 3.1.0 Released++ This release focuses on **licensing openness, parsing accuracy, and full-format native support**. The main updates include:++ - License upgrade+ - MinerU has officially moved from `AGPLv3` to the [MinerU Open Source License](https://github.com/opendatalab/MinerU/blob/master/LICENSE.md), a custom license based on `Apache 2.0`.+ - This change significantly reduces adoption friction for both community users and commercial deployments, making MinerU easier to integrate into real-world workflows.+ - VLM main model upgrade+ - The primary VLM model has been upgraded to `MinerU2.5-Pro-2604-1.2B`, bringing overall parsing accuracy to a state-of-the-art level.+ - The new model now supports image and chart parsing, truncated paragraph merging, cross-page table merging, and image recognition inside tables, further strengthening performance on complex document layouts.+ - Full-format native parsing support+ - Native parsing support has now been extended to `PPTX` and `XLSX`.+ - MinerU now fully supports parsing across images, `PDF`, `DOCX`, `PPTX`, and `XLSX`, providing a more complete multi-format document understanding workflow.++ With the 3.1.0 release, MinerU becomes more open, more accurate, and easier to adopt in production. The new license lowers the barrier for both community and commercial use, `MinerU2.5-Pro-2604-1.2B` improves parsing quality on complex content, and native `PPTX` / `XLSX` support completes end-to-end coverage of mainstream document formats.++- 2026/03/29 3.0.0 Released++ This release delivers a systematic upgrade centered on **parsing capability, system architecture, and engineering usability**. The main updates include:++ - Native `DOCX` parsing+ - Official support for native `DOCX` parsing, delivering high-precision results without hallucinations.+ - Compared with the traditional workflow of first converting `DOCX` to `PDF` and then parsing it, end-to-end speed is improved by tens of times, making it better suited for scenarios with high requirements for both accuracy and throughput.+ - `pipeline` backend upgrade+ - The `pipeline` backend achieves a score of `86.2` on OmniDocBench (v1.5), surpassing the accuracy of the previous-generation mainstream VLM `MinerU2.0-2505-0.9B`.+ - Added support for parsing images/formulas inside tables, seal text recognition, vertical text support, and interline formula numbering recognition, continuously improving parsing quality for complex document scenarios.+ - While maintaining high accuracy, it keeps resource usage extremely low and continues to support inference in pure CPU environments.+ - `API / CLI / Router` orchestration upgrade+ - `mineru` now runs as an orchestration client based on `mineru-api`; when `--api-url` is not provided, it will automatically start a local temporary service.+ - `mineru-api` adds a new asynchronous task endpoint `POST /tasks`, supporting task submission, status querying, and result retrieval; meanwhile, it retains the synchronous parsing endpoint `POST /file_parse` for compatibility with legacy plugins.+ - Added `mineru-router`, designed for unified entry deployment and task routing across multiple services and multiple GPUs; its interfaces are fully compatible with `mineru-api` and support automatic task load balancing.+ - Deployment and usability improvements+ - Resolved compatibility issues with `torch >= 2.8`; the base image has been upgraded to `vllm0.11.2 + torch2.9.0`, unifying installation paths across different Compute Capabilities.+ - Optimized the parsing pipeline with a sliding-window mechanism, significantly reducing peak memory usage in long-document scenarios, so documents with tens of thousands of pages no longer need to be split manually.+ - Batch inference in `pipeline` now supports streaming writes to disk, allowing completed parsing results to be written out in time and further improving the experience for long-running tasks.+ - Completed thread-safety optimization and now fully supports multi-threaded concurrent inference; together with `mineru-router`, this enables one-click multi-GPU deployment and makes it easy to build high-concurrency, high-throughput parsing systems.+ - Completely removed the use of two AGPLv3 models (`doclayoutyolo` and `mfd_yolov8`) and one CC-BY-NC-SA 4.0 model (`layoutreader`).++ This update is not just a set of feature enhancements, but a key leap forward in MinerU's overall system capabilities. We specifically addressed the peak memory usage issue in long-document parsing. Through optimizations such as sliding windows and streaming writes to disk, ultra-long document parsing has moved from “requiring manual splitting and careful handling” to being “stable, scalable, and ready for production workloads.” At the same time, we completed thread-safety optimization and fully enabled multi-threaded concurrent inference, further improving single-machine resource utilization and runtime stability under high-concurrency workloads. On top of this, with `mineru-router` and the new `API / CLI` orchestration framework, MinerU now supports one-click multi-GPU deployment, unified access across multiple services, and automatic task load balancing, significantly reducing the difficulty of large-scale deployment. As a result, MinerU is evolving from a standalone data production tool into a large-scale document parsing foundation for high-concurrency and high-throughput scenarios, providing enterprise-grade document data processing with infrastructure that is more stable, more efficient, and easier to scale.## 2.7 Series Versions@@ -360,8 +436,8 @@ Fixed several compatibility issues**Performance optimizations**-- Enhanced parsing speed for batches of small files by supporting batch processing of multiple PDF files ([script example](demo/batch_demo.py)), with formula parsing speed improved by up to 1400% and overall parsing speed improved by up to 500% compared to version 1.0.1-- Reduced memory usage and improved parsing speed by optimizing MFR model loading and usage (requires re-running the [model download process](docs/how_to_download_models_zh_cn.md) to get incremental updates to model files)+- Enhanced parsing speed for batches of small files by supporting batch processing of multiple PDF files ([script example](https://github.com/opendatalab/MinerU/blob/ae9fd9adaa336c171938f0ccd509cdf13a09087b/demo/batch_demo.py)), with formula parsing speed improved by up to 1400% and overall parsing speed improved by up to 500% compared to version 1.0.1+- Reduced memory usage and improved parsing speed by optimizing MFR model loading and usage (requires re-running the [model download process](https://github.com/opendatalab/MinerU/blob/magic_pdf-1.1.0-released/docs/how_to_download_models_zh_cn.md) to get incremental updates to model files)- Optimized GPU memory usage, requiring only 6GB minimum to run this project- Improved running speed on MPS devicesdiff --git a/docs/en/reference/index.md b/docs/en/reference/index.mdindex 638dbe36..447f4cdf 100644--- a/docs/en/reference/index.md+++ b/docs/en/reference/index.md@@ -4,6 +4,9 @@ This section provides detailed reference materials for MinerU project. Here you## Table of Contents+- [3.x → 4.0 migration](migration_4.md)+- [Python SDK and V1 API](../usage/sdk_api.md)+- [Output Files Documentation](./output_files.md) - Detailed explanation of all output files and their formats- [Changelog](./changelog.md) - Version update history and release notesdiff --git a/docs/en/reference/migration_4.md b/docs/en/reference/migration_4.mdnew file mode 100644index 00000000..a0c65777--- /dev/null+++ b/docs/en/reference/migration_4.md@@ -0,0 +1,49 @@+# Migrating from 3.x to 4.0++4.0 changes command entrypoints, dependency groups, configuration, and APIs. Validate in an isolated environment before migrating production callers. AMD and vendor accelerators stay on `mineru<4` using the [legacy guides](../usage/compatibility.md).++## Entrypoints and installation++| Previous usage | 4.0 usage |+| --- | --- |+| `mineru -p input.pdf -o output` | Library: `mineru parse input.pdf --pages all -o output.md`; one-off conversion: `mineru-kit parse input.pdf -o output.md` |+| Directory batch conversion | `mineru-kit parse ./documents -o ./output --format zip` |+| `mineru-gradio` / development-era `mineru-kit gradio` | `mineru-webui` / `mineru-kit webui` |+| Model download option `-m all` | `mineru-kit models download --tier standard` |+| Old HTTP parsing calls | V1 uploads → parse jobs → output files |+| Extras such as `mineru[core]` and `mineru[pipeline]` | Base package, `mineru[torch]`, or `mineru[full]` |++Install stable with `"mineru>=4.0,<5"`, inserting extras after the package name when needed. The package requires Python `>=3.10,<3.15`; optional engines also require suitable wheels and drivers. Stop services in the original environment before upgrading and check `mineru version --json` afterwards. Do not replace legacy platform images or installation commands with mainline 4.0 instructions.++## Tiers, pages, and outputs++- Select parsing quality with `flash/basic/standard/advanced`. Basic uses small models; Standard / Advanced use a VLM. Do not infer new quality defaults from old backend names.+- `mineru parse` uses the library, cache, and continuation protocol, defaulting to the first 10 PDF pages. `mineru-kit parse` and the Python SDK default to all pages.+- PDF ranges use `1-5,8,r3-r1`; `r1` is the last page and `all` selects the whole document. Non-PDF native documents are parsed as a whole.+- `-o` file/directory semantics depend on the entrypoint. `mineru-kit parse` defaults to Markdown for one file; directory or multi-file inputs write to a directory.+- Fields such as `_backend` and `pdf_info` in legacy results are not templates for 4.0. Read actual JSON using the [current output contract](output_files.md). Legacy artifacts are accepted only by explicitly supported compatibility readers; not every old JSON document can be passed to `ParseResult.from_dict()`.++## Configuration and models++Configuration lives in `$MINERU_HOME/config.yaml`, optionally overridden by `MINERU_CONFIG`. Old `mineru.json` configuration is not read. `model.stack`, `MINERU_MODEL_STACK`, and `--stack` have been removed; configure the two components independently:++```yaml+model:+ source: auto+ base_dir: ~/.mineru/models+ small_backend: auto+ vlm:+ engine: auto+```++Automatic selection follows the platform. Explicit `onnx + llama-cpp` can serve lighter environments. Torch and VLM engines can also be combined when their dependencies are available. Apple Silicon defaults to llama.cpp for the VLM; MLX requires manual installation and selection.++Restart relevant services after configuration changes, and download and verify models with matching backend choices. 4.0 has separate small-model bundles: the presence of an old model directory does not prove readiness. See [Model Source](../usage/model_source.md).++## API and WebUI++V1 uses `/v1/health`, `/v1/tiers`, `/v1/uploads`, `/v1/parse/jobs`, and `/v1/files`. Legacy `/file_parse` and `/tasks` are not provided. SDK clients and the WebUI must connect to a V1 service. The parsing API and OpenAI-compatible VLM server are different interfaces; their addresses are not interchangeable.++Existing Gradio clients also need to follow the new event interface; renaming the command alone is insufficient. Retained third-party integration guides describe their original adaptations and do not imply V1 compatibility.++Validate migration with a native document and a text-layer PDF. Check pages, Markdown, structured JSON, and assets, then validate the required quality tiers and API calls on the actual target hardware. See [SDK and API](../usage/sdk_api.md).diff --git a/docs/en/reference/output_files.md b/docs/en/reference/output_files.mdindex a6ef518d..03de9952 100644--- a/docs/en/reference/output_files.md+++ b/docs/en/reference/output_files.md@@ -1,441 +1,138 @@-# MinerU Output Files Documentation--## Overview--After executing the `mineru` command, in addition to the main markdown file output, multiple auxiliary files are generated for debugging, quality inspection, and further processing. These files include:--The exact set of generated files depends on the backend and the input document type.--- **Visual debugging files**: Help users intuitively understand the document parsing process and results-- **Structured data files**: Contain detailed parsing data for secondary development-- In multimodal markdown output, `image` / `chart` blocks render the screenshot first; when `content` exists, a collapsed HTML `<details>` block is appended after the image, using the block `sub_type` as the summary label when available and falling back to `image content` or `chart content`--The following sections provide detailed descriptions of each file's purpose and format.--## Visual Debugging Files--### Layout Analysis File (layout.pdf)--**File naming format**: `{original_filename}_layout.pdf`--**Functionality**:--- Visualizes layout analysis results for each page-- Numbers in the top-right corner of each detection box indicate reading order-- Different background colors distinguish different types of content blocks--**Use cases**:--- Check if layout analysis is correct-- Verify if reading order is reasonable-- Debug layout-related issues----## Structured Data Files--> [!IMPORTANT]-> The current structured output contract uses the unified `MinerUParser` with `tier` (flash/basic/standard/advanced) and `parse_mode` (txt/ocr) parameters. Legacy middle-json files marked with `_backend: "pipeline"`/`_backend: "hybrid"`/`_backend: "office"` are no longer accepted by current readers; use schema 2.0 `MiddleJson` instead.--### Unified Model Output Results--#### Model Inference Results (model.json)--**File naming format**: `{original_filename}_model.json`--##### Sample Data--```json-[- {- "cls_id": 12,- "label": "header",- "score": 0.93,- "bbox": [- 1217,- 104,- 1516,- 134- ],- "index": 2- },- {- "cls_id": 6,- "label": "doc_title",- "score": 0.9751,- "bbox": [- 275,- 181,- 1512,- 292- ],- "index": 3- },- {- "cls_id": 22,- "label": "text",- "score": 0.9217,- "bbox": [- 275,- 330,- 524,- 370- ],- "index": 4- }-]+# Output Formats and Result Contract++4.0 uses a shared document model. Distinguish what a renderer can generate from what a particular CLI/API exposes; renderer capabilities are not automatically valid command options.++## Entrypoint capabilities++| Entrypoint | Output |+| --- | --- |+| `mineru parse` | Markdown; `--json` is a command response with status, content, locators, and continuation |+| `mineru read` | Markdown or `--format image`; cached content only |+| `mineru-kit parse` | `markdown`, `middle_json`, `zip` |+| Self-hosted V1 API | `markdown`, `middle_json`, `structured_content`, `zip`; consult service capabilities |+| `ParseResult` | `markdown()`, `structured_content()`, `to_dict()`, `to_json()`, `save(writer)` |+| `mineru.render.render()` | The nine targets below |++A `mineru parse --json` response is not MiddleJson and cannot be passed directly to `ParseResult.from_dict()`. Remote output availability is defined by the remote service.++## Nine rendering targets++| `RenderFormat` | Format | Python return type |+| --- | --- | --- |+| `MARKDOWN` | Markdown | `str` |+| `HTML` | HTML | `str` |+| `LATEX` | LaTeX | `str` |+| `DOCX` | Word | `bytes` |+| `EPUB` | EPUB | `bytes` |+| `PDF` | Semantically reflowed PDF | `bytes` |+| `STRUCTURED_CONTENT` | General structured content | `dict` |+| `CONTENT_LIST` | Content List V1 | `list[dict]` |+| `CONTENT_LIST_V2` | Content List V2 grouped by page | `list[list[dict]]` |++PDF rendering produces a semantic reflow, not a pixel-identical copy of the input or a layout-debug PDF.++```python+from pathlib import Path+from mineru.parser import parse+from mineru.render import render, RenderFormat++result = parse("report.docx", tier="flash")+html = render(result.middle_json, RenderFormat.HTML)+Path("report.html").write_text(html, encoding="utf-8")```-#### Intermediate Processing Results (middle.json)--**File naming format**: `{original_filename}_middle.json`--##### Top-level Structure (schema 2.0)--| Field Name | Type | Description |-|------------|------|-------------|-| `pages` | `list[PageInfo]` | Array of parsing results for each page, strictly increasing by `page_idx` |-| `is_full_document` | `bool` | Whether the input is a full document (empty `page_index_map`) |-| `file_suffix` | `string` | Input file type: `pdf`, `doc`, `docx`, `ppt`, `pptx`, `xls`, `xlsx`, `rtf`, `csv`, `epub`, `html`, `odt`, `ods`, or `odp` |-| `effort` | `string` | Analysis effort: `flash`, `medium`, `high`, or `xhigh` |-| `parse_mode` | `string` | Parse mode: `txt` or `ocr` |-| `mineru_version` | `string` | MinerU version number |--Legacy fields `pdf_info`/`_backend`/`_version_name`/`_ocr_enable`/`_vlm_ocr_enable` are removed in schema 2.0.+## Intermediate JSON-##### Page Information Structure (pages)--| Field Name | Description |-|------------|-------------|-| `page_idx` | Page number, starting from 0 |-| `blocks` | List of top-level page blocks (the only content field) |--Legacy fields `preproc_blocks`/`para_blocks`/`page_size`/`images`/`tables`/`interline_equations`/`discarded_blocks`/`_layout_tree`/`layout_bboxes` are removed in schema 2.0 — all content is expressed in the `blocks` tree.--##### Block Structure Hierarchy--```-Top-level page blocks (text | title | equation | image | table | chart | code | list | index | ...)-└── Visual parent blocks (image | table | chart | code) contain child blocks- └── body block + optional caption/footnote blocks-```+`ModelJson` holds analysis `pages` and `page_index_map`; `MiddleJson` holds ordered postprocessed pages and semantic blocks. `schema_id` distinguishes `docvortex.model` from `docvortex.middle`, while `schema_version` identifies the protocol version. Do not identify a document type from its version number alone.-Leaf blocks (text, title, equation, etc.) carry `content: str` directly. Visual parent blocks (image, table, chart, code) carry `content: list[child blocks]`, where children include exactly one body plus optional caption/footnote. There are no independent `Line`/`Span` types in schema 2.0.+`metadata` carries the file type, producer, and document properties. `extensions["mineru"]` records the actual `tier` and final `parse_mode`. The producing version is `metadata.producer.version`, not a duplicate product extension field. Pages contain `page_idx` and `blocks`; `page_idx` is zero-based, unlike one-based CLI PDF ranges.-##### Common Block Fields--| Field Name | Description |-|------------|-------------|-| `type` | Block type (see table below) |-| `bbox` | Rectangular box coordinates of the block `[x0, y0, x1, y1]`, normalized to `[0, 1]` |-| `index` | Block index for reading order (required for top-level blocks) |-| `content` | For leaf blocks: a string; for visual parent blocks: a list of child blocks |--##### Block Types--| Type | Description |-|------|-------------|-| `text` | Text block (leaf, `content: str`) |-| `doc_title` | Document title (level=1) |-| `paragraph_title` | Paragraph title (level 2-6) |-| `equation` | Display (interline) formula block (renamed from `interline_equation`) |-| `image` | Image container; `content` includes `image_body` + optional `image_caption`/`image_footnote` |-| `table` | Table container; `content` includes `table_body` + optional `table_caption`/`table_footnote` |-| `chart` | Chart container; `content` includes `chart_body` + optional `chart_caption`/`chart_footnote` |-| `code` | Code container; `content` includes `code_body` + optional `code_caption`/`code_footnote`; `sub_type` is `code` or `algorithm` |-| `list` | List container; `content` is a list of `text`/`ref_text`/nested `list` blocks; `sub_type` is `text` or `ref_text` |-| `index` | Index (table of contents) container; `content` is a list of `text`/`doc_title`/`paragraph_title`/nested `index` blocks |-| `ref_text` | Reference / bibliography text block; EPUB notes do not use this type |-| `header` / `footer` / `page_number` / `aside_text` | Page auxiliary blocks (leaf, `content: str`); they do not accept `anchor` |-| `page_footnote` | Independent page footnote block (leaf, `content: str`); may include a document-wide `anchor` and remains visible in DEFAULT rendering |--##### Sample Data (schema 2.0)+The following example is serialized from the current public types. `4.0.0` is an illustrative stable producer version. Optional fields may be omitted; use the actual output contract:```json{- "pages": [+ "metadata": {+ "file_suffix": "html",+ "producer": {+ "name": "mineru",+ "version": "4.0.0"+ }+ },+ "extensions": {+ "mineru": {+ "tier": "flash",+ "parse_mode": "txt"+ }+ },+ "pages": [+ {+ "page_idx": 0,+ "blocks": [{- "page_idx": 0,- "blocks": [- {- "type": "doc_title",- "index": 0,- "bbox": [0.45, 0.23, 0.55, 0.28],- "content": "1 Introduction",- "level": 1- },- {- "type": "text",- "index": 1,- "bbox": [0.08, 0.30, 0.46, 0.40],- "content": "dependent on the service headway and the reliability of the departure"- },- {- "type": "image",- "index": 2,- "bbox": [0.52, 0.30, 0.95, 0.55],- "content": [- {- "type": "image_body",- "index": 2,- "bbox": [0.52, 0.30, 0.95, 0.55],- "content": "",- "image_path": "images/page_0_image_body_2.png"- },- {- "type": "image_caption",- "index": 3,- "bbox": [0.52, 0.56, 0.95, 0.58],- "content": "Figure 1: Example figure"- }- ],- "sub_type": null- }- ]+ "type": "text",+ "index": 0,+ "content": [+ {+ "type": "text",+ "content": "Hello MinerU"+ }+ ]}- ],- "file_suffix": "pdf",- "effort": "high",- "parse_mode": "ocr",- "mineru_version": "1.x.x"-}-```--#### Content List (content_list.json)--> [!NOTE]-> `content_list.json` is deprecated and no longer generated. Use `structured_content.json` for structured content output. See the [Common Structured Content](#common-structured-content-structured_contentjsondevelopment-version-subject-to-change) section below.--### Common Structured Content (structured_content.json)(development version, subject to change)--**File naming format**: `{original_filename}_structured_content.json`--##### Functionality--`structured_content.json` is the new structured output added in 3.0:--- The top level is grouped by page for page-oriented consumption-- Each item uses a unified `type + content` structure for easier programmatic processing-- The exact supported `type` values depend on the backend and input type--##### Common Fields--| Field | Type | Description |-|------|------|-------------|-| `type` | `string` | Content type |-| `content` | `dict` | Structured payload for the given `type` |-| `bbox` | `list[int]` | Optional bounding box mapped into the 0-1000 coordinate range |-| `anchor` | `string` | Optional document-wide target for titles and `page_footnote`; index leaves and inline links may reference it |--`image` / `chart` items may also include an optional top-level `sub_type` field for visual subtype propagation.--##### Common Types--| Type | Description |-|------|-------------|-| `title` | Title block with `title_content` and `level` |-| `paragraph` | Paragraph block with `paragraph_content` |-| `equation_interline` | Interline formula with `math_content` and `math_type` |-| `image` / `table` / `chart` | Visual blocks with image paths, captions, and related structured fields. Seal content uses `image` with `sub_type: "seal"` |-| `code` | Code block with `code_content`, `code_caption`, `code_footnote`, and `code_language` |-| `algorithm` | Algorithm block with `algorithm_content`, `algorithm_caption`, and `algorithm_footnote` |-| `list` / `index` | List and index blocks with `list_items` |-| `page_header` / `page_footer` / `page_number` / `page_aside_text` | Page auxiliary blocks |-| `page_footnote` | Independent page footnote content |--Inline fields such as `title_content`, `paragraph_content`, and captions are-usually span lists. A `hyperlink` span contains `content` and `url`; when one-link contains text fragments with different styles, it may also contain-`children`. In that case, `content` is the concatenated child text, and the-exact styles are represented by the child `text` spans.--##### Sample Data--```json-[- [- {- "type": "title",- "content": {- "title_content": [- {- "type": "text",- "content": "1 Introduction"- }- ],- "level": 1- },- "bbox": [83, 121, 917, 156]- },- {- "type": "page_footnote",- "content": {- "page_footnote_content": [- {- "type": "text",- "content": "* Corresponding author"- }- ]- },- "bbox": [71, 815, 915, 841]+ ]}- ]-]+ ],+ "is_full_document": true,+ "schema": "docvortex.middle",+ "schema_version": "2.0"+}```-### Multimodal Model Output Results+Round-trip current results with `ParseResult.from_json(result.to_json())`. Legacy `_backend`, `pdf_info`, and `_version_name` are not part of this contract. See [migration](migration_4.md) for historical data; changing a version number alone does not migrate a payload.-#### Model Inference Results (model.json)+## Structured Content-**File naming format**: `{original_filename}_model.json`+`structured_content()` returns a consumer-facing representation, not another name for the intermediate protocol. It retains `metadata` and `extensions` and turns natural-language spans into easier-to-consume text. Do not invent `schema_id` or `schema_version` fields for it.-##### File format description-- Two-level nested list: outer list = pages; inner list = content blocks of that page-- Each block is a dict with at least: `type`, `bbox`, `angle`, `content` (some types add extra fields like `score`, `block_tags`, `content_tags`, `format`)-- Designed for direct, raw model inspection--##### Supported content types (type field values)```json{- "text": "Plain text",- "title": "Title",- "equation": "Display (interline) formula",- "image": "Image",- "image_caption": "Image caption",- "image_footnote": "Image footnote",- "table": "Table",- "table_caption": "Table caption",- "table_footnote": "Table footnote",- "phonetic": "Phonetic annotation",- "code": "Code block",- "code_caption": "Code caption",- "ref_text": "Reference / citation entry",- "algorithm": "Algorithm block (treated as code subtype)",- "list": "List container",- "header": "Page header",- "footer": "Page footer",- "page_number": "Page number",- "aside_text": "Side / margin note",- "page_footnote": "Page footnote"-}-```--##### Coordinate system-- `bbox` = `[x0, y0, x1, y1]` (top-left, bottom-right)-- Origin at top-left of the page-- All coordinates are normalized percentages in `[0,1]`--##### Sample data-```json-[- [- {- "type": "header",- "bbox": [0.077, 0.095, 0.18, 0.181],- "angle": 0,- "score": null,- "block_tags": null,- "content": "ELSEVIER",- "format": null,- "content_tags": null- },+ "pages": [{- "type": "title",- "bbox": [0.157, 0.228, 0.833, 0.253],- "angle": 0,- "score": null,- "block_tags": null,- "content": "The response of flow duration curves to afforestation",- "format": null,- "content_tags": null- }- ]-]-```--#### Intermediate Processing Results (middle.json)--**File naming format**: `{original_filename}_middle.json`--In schema 2.0, the multimodal tier produces the same unified `MiddleJson` structure as other tiers. The block types below are part of the standard `blocks` tree (not extensions):--- `list` is a container block; `content` holds child `text`/`ref_text`/nested `list` blocks; `sub_type` distinguishes list categories:- * `text`: ordinary list- * `ref_text`: reference / bibliography style list-- `code` is a container block; `content` holds a `code_body` plus optional `code_caption`/`code_footnote`; `sub_type` is:- * `code`- * `algorithm`-- Page auxiliary blocks (`header`, `footer`, `page_number`, `aside_text`) and the independent `page_footnote` block appear as top-level leaves in `blocks` with `content: str` — there is no separate `discarded_blocks` field in schema 2.0. Only `page_footnote` may carry an optional document-wide `anchor`, and it remains visible in DEFAULT rendering.-- All blocks may include an `angle` field indicating rotation (one of `0, 90, 180, 270`).--##### Examples-- Example: list block- ```json- {- "type": "list",- "bbox": [0.068, 0.121, 0.319, 0.260],- "index": 11,- "content": [- {- "type": "text",- "bbox": [0.068, 0.123, 0.122, 0.137],- "index": 3,- "content": "H.1 Introduction"- },+ "page_idx": 0,+ "blocks": [{"type": "text",- "bbox": [0.068, 0.142, 0.181, 0.179],- "index": 4,- "content": "H.2 Example: Divide by Zero without Exception Handling"+ "content": "Hello MinerU"}- ],- "sub_type": "text"+ ]}- ```--- Example: code block with optional caption:- ```json- {- "type": "code",- "bbox": [0.045, 0.610, 0.346, 0.964],- "index": 17,- "content": [- {- "type": "code_body",- "bbox": [0.045, 0.610, 0.346, 0.964],- "index": 17,- "content": "1 // Fig. H.1: DivideByZeroNoExceptionHandling.java \n2 // Integer division without exception handling. \n3 import java.util.Scanner; \n4 \n5 public class DivideByZeroNoExceptionHandling \n6 { \n7 // demonstrates throwing an exception when a divide-by-zero occurs \n8 public static int quotient( int numerator, int denominator ) \n9 { \n10 return numerator / denominator; // possible division by zero \n11 } // end method quotient \n12 \n13 public static void main(String[] args) \n14 { \n15 Scanner scanner = new Scanner(System.in); // scanner for input \n16 \n17 System.out.print(\"Please enter an integer numerator: \"); \n18 int numerator = scanner.nextInt(); \n19 System.out.print(\"Please enter an integer denominator: \"); \n20 int denominator = scanner.nextInt(); \n21"- },- {- "type": "code_caption",- "bbox": [0.339, 0.125, 0.500, 0.148],- "index": 19,- "content": "Algorithm 1 Modules for MCTSteg"- }- ],- "sub_type": "code",- "guess_lang": "java"+ ],+ "metadata": {+ "file_suffix": "html",+ "producer": {+ "name": "mineru",+ "version": "4.0.0"}- ```+ },+ "extensions": {+ "mineru": {+ "tier": "flash",+ "parse_mode": "txt"+ }+ },+ "is_full_document": true+}+```-#### Content List (content_list.json)+## Saved files, ZIP, and assets-> [!NOTE]-> `content_list.json` is deprecated and no longer generated. Use `structured_content.json` for structured content output. See the [Common Structured Content](#common-structured-content-structured_contentjsondevelopment-version-subject-to-change) section above for the shared structure.+`ParseResult.save(writer)` writes `markdown.md`, `middle_json.json`, and `structured_content.json`, plus `model_output.json` when raw model output exists. `mineru-kit parse --format zip` packages these results.-## Summary+```python+from mineru.parser.writer import FileBasedDataWriter++result.save(FileBasedDataWriter("output"))+```-The above files constitute MinerU's complete output results. Users can choose appropriate files for subsequent processing based on their needs:+Assets may be embedded or referenced by image paths, depending on the source and output entrypoint. PDF `ParseResult.to_dict()` omits block `image_base64`; saving intermediate JSON alone does not preserve every external asset. Download and retain matching assets when consuming API output references. Do not rely on a closed PDF object or the original file for later rendering.-- **Model outputs** (Use raw outputs):- * model.json--- **Debugging and verification** (Use visualization files):- * layout.pdf--- **Content extraction**: (Use simplified files):- * *.md- * structured_content.json--- **Secondary development**: (Use structured files):- * middle.json+The WebUI layout PDF is a debugging artifact used to preview detections when available; otherwise the UI previews the original/cropped PDF. It serves a different purpose from `RenderFormat.PDF` above.diff --git a/docs/en/usage/advanced_cli_parameters.md b/docs/en/usage/advanced_cli_parameters.mdindex 0c3d6a60..5226b35f 100644--- a/docs/en/usage/advanced_cli_parameters.md+++ b/docs/en/usage/advanced_cli_parameters.md@@ -15,7 +15,7 @@> [!TIP]> - In any situation, you can specify visible GPU devices by adding the `CUDA_VISIBLE_DEVICES` environment variable at the beginning of the command line. For example:> ```bash-> CUDA_VISIBLE_DEVICES=1 mineru -p <input_path> -o <output_path>+> CUDA_VISIBLE_DEVICES=1 mineru-kit parse <input_path> -o <output_path>> ```> - This method applies to the model-serving and parsing commands documented below; it does not apply to `mineru-router`.@@ -52,5 +52,5 @@>> - If you have multiple GPUs and want to use `router` to launch and manage `fastapi` services across four GPUs, you can use the following command:> ```bash-> CUDA_VISIBLE_DEVICES=0,1,2,3 mineru-kit router --host 127.0.0.1 --port 8002+> mineru-kit router --host 127.0.0.1 --port 8002 --local-gpus 0,1,2,3> ```diff --git a/docs/en/usage/cli_tools.md b/docs/en/usage/cli_tools.mdindex d27c0781..40af2143 100644--- a/docs/en/usage/cli_tools.md+++ b/docs/en/usage/cli_tools.md@@ -46,10 +46,10 @@ Open `http://127.0.0.1:8000/docs` for the generated OpenAPI documentation. The s### Gradio WebUI```bash-mineru-kit gradio --server-name 127.0.0.1 --server-port 7860+mineru-kit webui --server-name 127.0.0.1 --server-port 7860```-Without `--api-url`, Gradio manages a loopback `mineru-kit api-server`. With `--api-url`, it connects only to that V1 service. `mineru-gradio` is retained as a command-name alias and accepts the same modern options; it does not restore legacy Gradio options or HTTP routes.+Without `--api-url`, Gradio manages a loopback `mineru-kit api-server`. With `--api-url`, it connects only to that V1 service. `mineru-webui` is retained as a command-name alias and accepts the same modern options; it does not restore legacy Gradio options or HTTP routes.### Router and VLM server@@ -84,4 +84,4 @@ fail with `page_range_invalid`. Without `--pages`, `mineru parse` starts with th`mineru-kit parse`, Python and Gradio select all pages. New requests use the current syntax. Historical positive result ranges using ASCII `~`remain readable without rebuilding Doclib caches; result responses and new cache entries use `-`.Fullwidth `~` and negative page-number notation are not supported.-See [page-range syntax and historical result compatibility](../../next/page-ranges.md).+See [page-range syntax and historical result compatibility](tiers.md).diff --git a/docs/en/usage/compatibility.md b/docs/en/usage/compatibility.mdnew file mode 100644index 00000000..cee736ef--- /dev/null+++ b/docs/en/usage/compatibility.md@@ -0,0 +1,42 @@+# Legacy Platform Adaptations (MinerU <4)++The following 13 platforms retain their existing adaptations, **for MinerU <4 only**. Mainline 4.0 dependency, model, and command changes do not extend these platforms' compatibility coverage.++The nine dedicated Dockerfiles retain their original extras and use `>=3.4.0,<4`, for example:++```bash+python -m pip install "mineru[core]>=3.4.0,<4"+```++This illustrates the version bound, not a universal vendor installation recipe. Follow each Dockerfile's Torch, engine, and patch requirements rather than applying a broad upgrade inside a vendor image. Keep stricter constraints such as `==2.7.0` or fixed commits. Source installs must use the original pinned commit or an appropriate legacy tag instead of following the default branch.++## Platform guides++The retained platform guides are in Chinese.++- [Ascend](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Ascend/)+- [THead](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/THead/)+- [METAX](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/METAX/)+- [Hygon](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Hygon/)+- [Enflame](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Enflame/)+- [MooreThreads](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/MooreThreads/)+- [IluvatarCorex](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/IluvatarCorex/)+- [Cambricon](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Cambricon/)+- [Kunlunxin](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Kunlunxin/)+- [Tecorigin](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Tecorigin/)+- [Biren](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/Biren/)+- [AMD](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/AMD/)+- [VastAI](https://opendatalab.github.io/MinerU/zh/usage/acceleration_cards/VastAI/)++## Legacy commands and references++These adaptations use `mineru -p`, `mineru-api`, `mineru-gradio`, and `mineru-models-download`, not 4.0 `mineru-kit`. Legacy references:++- [3.4.5 installation](https://github.com/opendatalab/MinerU/blob/mineru-3.4.5-released/docs/en/quick_start/index.md)+- [3.4.5 model configuration](https://github.com/opendatalab/MinerU/blob/mineru-3.4.5-released/docs/en/usage/model_source.md)++Vendors control prebuilt image contents; a `<4` bound in this repository does not modify existing images. Check inside the container before deployment:++```bash+python -c "from importlib.metadata import version; from packaging.specifiers import SpecifierSet; v = version('mineru'); print(v); assert v in SpecifierSet('<4'), 'Use the vendor image for MinerU <4'"+```diff --git a/docs/en/usage/index.md b/docs/en/usage/index.mdindex 526e6977..bf036f77 100644--- a/docs/en/usage/index.md+++ b/docs/en/usage/index.md@@ -4,6 +4,11 @@ This section provides comprehensive usage instructions for the project. We will## Table of Contents+- [Tiers and runtimes](tiers.md)+- [Python SDK and V1 API](sdk_api.md)+- [3.x → 4.0 migration](../reference/migration_4.md)+- [Legacy platforms (MinerU <4)](compatibility.md)+- [Quick Usage](./quick_usage.md) - Quick setup and basic usage- [Model Source Configuration](./model_source.md) - Detailed configuration instructions for model sources- [Command Line Tools](./cli_tools.md) - Detailed parameter descriptions for command line toolsdiff --git a/docs/en/usage/model_source.md b/docs/en/usage/model_source.mdindex 1efce583..47dbfa8b 100644--- a/docs/en/usage/model_source.md+++ b/docs/en/usage/model_source.md@@ -1,57 +1,76 @@-# Model Source Documentation+# Model Downloads and Configuration-MinerU uses `HuggingFace` and `ModelScope` as model repositories. Users can switch model sources or use local models as needed.+MinerU 4.0 configures small-model backends independently from VLM engines. Configuration defaults to `$MINERU_HOME/config.yaml` (`MINERU_HOME` defaults to `~/.mineru`); `MINERU_CONFIG` selects another file.-- `auto` is the default model source policy. It first checks whether Hugging Face is accessible. If accessible, MinerU uses `HuggingFace`, otherwise it automatically falls back to `ModelScope`.-- `HuggingFace` provides excellent loading speed and high stability globally.-- `ModelScope` is the best choice for users in mainland China, providing seamlessly compatible `hf` SDK modules, suitable for users who cannot access HuggingFace.+```yaml+model:+ source: auto+ base_dir: ~/.mineru/models+ small_backend: auto+ vlm:+ engine: auto+```++## Model sources-## Methods to Switch Model Sources+`model.source` accepts `auto`, `huggingface`, `modelscope`, and `local`. `auto` probes Hugging Face first and selects ModelScope when it is unavailable. Automatic selection from a default or config value may be written back to configuration. Environment variables override file settings:-### Configure via Environment Variables-MinerU configures model sources through the `MINERU_MODEL_SOURCE` environment variable. This applies to all command line tools and API calls. Supported values are `auto`, `huggingface`, `modelscope`, and `local`. The environment variable has higher priority than `model.source` in `config.yaml`.```bashexport MINERU_MODEL_SOURCE=modelscope-mineru -p <input_path> -o <output_path>+mineru-kit parse document.pdf -o document.md --tier standard```-or set it programmatically:-```python-import os-os.environ["MINERU_MODEL_SOURCE"] = "modelscope"++Windows PowerShell:++```powershell+$env:MINERU_MODEL_SOURCE = "modelscope"```->[!TIP]-> MinerU no longer provides a CLI flag for model source selection. Model sources set through environment variables take effect in the current terminal session until the terminal is closed or the environment variable is modified.-### Configure via Configuration File-If `MINERU_MODEL_SOURCE` is not set, MinerU reads `model.source` from `config.yaml`. `model.source` supports `auto`, `huggingface`, `modelscope`, and `local`. When the value is `auto` or the field is missing, MinerU probes the actual source first. If the value came from the config file or built-in default, MinerU writes the resolved source back as `huggingface` or `modelscope` to avoid switching sources on later startups due to network fluctuations.-```yaml-model:- source: auto- base_dir: ~/.mineru/models+The small-model bundles `MinerU-4_models_torch` and `MinerU-4_models_onnx` are registered for both Hugging Face and ModelScope. Original VLM weights and llama.cpp GGUF/mmproj use different repositories selected by the engine. Basic needs the selected small-model bundle; Standard also needs VLM models and serves Advanced requests.++## Download, verify, and run offline++Download and verify a Standard deployment using the current configuration:++```bash+mineru-kit models download --tier standard --source huggingface+mineru-kit models verify --tier standard+mineru-kit models show```-## Using Local Models+An explicit CPU small-model and llama.cpp combination:-### 1. Download Models to Local Storage```bash-mineru-kit models download --help+mineru-kit models download --tier standard --small-backend onnx --vlm-engine llama-cpp --source huggingface+mineru-kit models verify --tier standard --small-backend onnx --vlm-engine llama-cpp```-or download all built-in model bundles:++A NVIDIA / vLLM deployment can download its models on a build machine without a GPU. Specify the target backends instead of relying on that machine's automatic selection:+```bash-mineru-kit models download --tier standard+mineru-kit models download --tier standard --small-backend torch --vlm-engine vllm --source huggingface+mineru-kit models verify --tier standard --small-backend torch --vlm-engine vllm```-> [!NOTE]->- Models are downloaded under `config.model.base_dir`. By default, this is `~/.mineru/models`.->- `mineru-kit models download` does not write model paths to `mineru.json`.->- If you need a custom model directory, set `model.base_dir` in `config.yaml` before downloading.->- If you need to update model files, run `mineru-kit models download --tier standard` again. Existing files in the same `model.base_dir` are incrementally reused by the provider SDK.->- `mineru-kit models download` must use a remote model source to perform a real download. If your current config sets `model.source: local`, this command temporarily treats it as `auto` for this invocation.->- MinerU marks a fully downloaded repository with an empty `.mineru_complete` file at its root. Repositories downloaded by required paths instead mark each completed model directory. A directory left by an older release or an interrupted download without its marker is checked through an incremental provider download before use. With `model.source: local`, such a directory is reported as not ready instead of accessing the network.-### 2. Use Local Models for Parsing+These command options apply only to the current operation and do not change persistent configuration. Use the same combination for inference, for example:-Enable local models through environment variables:```bash+export MINERU_MODEL_SMALL_BACKEND=torch+export MINERU_MODEL_VLM_ENGINE=vllmexport MINERU_MODEL_SOURCE=local-mineru -p <input_path> -o <output_path>+mineru-kit parse document.pdf -o document.md --tier standard```++Use `basic` as the download tier when no VLM is needed. Advanced has no separate deployment download tier. Set `model.base_dir` before downloading to change the model root. Completion markers and required files determine readiness. Repeated downloads reuse provider caches; do not create completion markers manually.++`local` uses ready local models and fails on missing assets without downloading. An explicit `models download` is a download operation: even with `local` configured, it temporarily resolves a remote source automatically.++## VLM servers and manual MLX++An existing `model.vlm.server_url` takes priority and removes the local VLM weight requirement. This is a model inference endpoint, not the MinerU V1 document parsing API. Small-model requirements still depend on the tier.++MLX requires manual installation of `mlx-vlm>=0.7.0,<0.8.0` and explicit `model.vlm.engine: mlx`. `model.stack`, `MINERU_MODEL_STACK`, and `--stack` have been removed. Restart relevant services after configuration changes.++## Download troubleshooting++Hugging Face uses `hf_xet` by default. If your network cannot reach Xet CAS, set `HF_HUB_DISABLE_XET=1` before downloading to use regular HTTP, or switch to ModelScope. For offline deployment, download and verify before selecting `local`. See [extension modules](../quick_start/extension_modules.md) for installation combinations.diff --git a/docs/en/usage/quick_usage.md b/docs/en/usage/quick_usage.mdindex 5c2d3fa8..17dbd9f7 100644--- a/docs/en/usage/quick_usage.md+++ b/docs/en/usage/quick_usage.md@@ -1,7 +1,7 @@# Using MinerU## Quick Model Source Configuration-MinerU uses `huggingface` as the default model source. If users cannot access `huggingface` due to network restrictions, they can conveniently switch the model source to `modelscope` through environment variables:+MinerU defaults to `auto`: probe Hugging Face first and choose ModelScope when it is unavailable. If users cannot access `huggingface` due to network restrictions, they can conveniently switch the model source to `modelscope` through environment variables:```bashexport MINERU_MODEL_SOURCE=modelscope```@@ -25,6 +25,18 @@ mineru parse <input_path> --pages all -o <output_path>If you need to adjust parsing options through custom parameters, you can also check the more detailed [Command Line Tools Usage Instructions](./cli_tools.md) in the documentation.+## Library, search, and continuation++`mineru` keeps file identity, parsing caches, and indexes in a local document library. Responses include locators; replace the example document ID below with an actual returned ID:++```bash+mineru parse document.pdf --json+mineru search "keyword" --json+mineru read "doc:ab12cd3/tier:standard/page:11" --json+```++When an output reaches its budget, follow `next_request` or the returned continuation command. `read` consumes existing results without automatically starting higher-quality parsing. Use `mineru-kit parse` for stateless batches and complete exports. Native Office, HTML, CSV/TSV, EPUB, and OFD normalize to local Flash.+## Advanced Usage via API, WebUI, and Services- Start the self-hosted V1 API:@@ -34,18 +46,18 @@ If you need to adjust parsing options through custom parameters, you can also ch>[!TIP]>Access `http://127.0.0.1:8000/docs` for the OpenAPI documentation. The supported service surface is `/v1/*`, including health, capability discovery, uploads, files, parse jobs, and usage.>- >Native document parsing example: [DocVortex Python example](https://github.com/myhloli/docvortex/blob/main/demo/demo.py)+ >Native document parsing example: [Python SDK and V1 API](sdk_api.md)- Start Gradio WebUI visual frontend:```bash- mineru-kit gradio --server-name 0.0.0.0 --server-port 7860+ mineru-kit webui --server-name 0.0.0.0 --server-port 7860```>[!TIP]>>- Access `http://127.0.0.1:7860` in your browser to use the Gradio WebUI.>- Without `--api-url`, Gradio manages a loopback `mineru-kit api-server`; with `--api-url`, it connects only to that existing V1 service.>- Use `--api-server-preload-models` to preload models for the managed local server.- >- `mineru-gradio` remains available as a command-name alias with the same modern options.+ >- `mineru-webui` remains available as a command-name alias with the same modern options.- Use `mineru-router` for multi-service / multi-GPU orchestration:```bash@@ -102,7 +114,9 @@ Model storage and source settings use the `model` section:model:base_dir: ~/.mineru/modelssource: auto- stack: auto+ small_backend: auto+ vlm:+ engine: auto```See [Model Source Documentation](./model_source.md) for model download and local-source details.@@ -116,4 +130,4 @@ fail with `page_range_invalid`. Without `--pages`, `mineru parse` starts with th`mineru-kit parse`, Python and Gradio select all pages. New requests use the current syntax. Historical positive result ranges using ASCII `~`remain readable without rebuilding Doclib caches; result responses and new cache entries use `-`.Fullwidth `~` and negative page-number notation are not supported.-See [page-range syntax and historical result compatibility](../../next/page-ranges.md).+See [page-range syntax and historical result compatibility](tiers.md).diff --git a/docs/en/usage/sdk_api.md b/docs/en/usage/sdk_api.mdnew file mode 100644index 00000000..7f62e3f7--- /dev/null+++ b/docs/en/usage/sdk_api.md@@ -0,0 +1,86 @@+# Python SDK and V1 API++## Local Python SDK++`mineru.parser` exports stateless `parse`, `parse_async`, `MinerUParser`, and a shared `ParseResult`; it does not create a document library. PDF page ranges default to all pages; `page_range="1-3"` uses one-based page numbers.++```python+from pathlib import Path+from mineru.parser import parse, ParseResult++result = parse("document.pdf", tier="flash", ocr_mode="txt", page_range="1-3")+Path("document.md").write_text(result.markdown(), encoding="utf-8")+Path("document.json").write_text(result.to_json(), encoding="utf-8")+restored = ParseResult.from_json(result.to_json())+assert restored.to_dict() == result.to_dict()+```++For native documents, use `parse("report.docx", tier="flash")` without a PDF page range. For higher-quality PDF/image parsing, select `tier="standard"` or `tier="advanced"` and prepare the relevant runtime and models.++The asynchronous entrypoint accepts the same parsing options:++```python+import asyncio+from mineru.parser import parse_async++result = asyncio.run(parse_async("report.docx", tier="flash"))+print(result.markdown())+```++Inside an existing event loop, use `await parse_async(...)`. An async interface does not imply identical execution mechanisms across engines.++## Connect to a self-hosted V1 API++Start the service in its inference environment:++```bash+mineru-kit api-server --host 127.0.0.1 --port 8000 --tier standard+```++The Python client handles discovery, file submission, job polling, and result downloads:++```python+from mineru.parser import MinerUApiParser++parser = MinerUApiParser(+ api_url="http://127.0.0.1:8000",+ api_key="",+ tier="standard",+ include_images=True,+)+result = parser.parse("document.pdf", page_range="1-3")+print(result.markdown())+```++`api_url` is the service root before `/v1`. Use `MINERU_API_KEY` for a configured key instead of embedding credentials in source. Connecting to another machine may upload files to that service. The WebUI can use the same address:++```bash+mineru-kit webui --api-url http://127.0.0.1:8000+```++## HTTP workflow++Discover actual service capabilities first:++```bash+curl http://127.0.0.1:8000/v1/health+curl http://127.0.0.1:8000/v1/tiers+```++1. Create an upload with `POST /v1/uploads`. Follow its returned URL, HTTP method, and headers, then call `/v1/uploads/{id}/complete` when required to obtain `file.id`. A completed deduplicated upload can return the file reference directly.+2. Submit a job with `POST /v1/parse/jobs`, using a body such as the following.+3. Poll `GET /v1/parse/jobs/{job_id}`. `completed`, `partial`, `failed`, and `canceled` are all terminal. Inspect per-file errors; partial success is not full completion.+4. Download outputs through `GET /v1/files/{file_id}/content` using the artifact references in the job response.++```json+{+ "files": [{"source": {"type": "file_id", "file_id": "file-id-from-upload"}, "page_range": "1-3"}],+ "tier": "standard",+ "ocr_mode": "auto",+ "output_formats": ["markdown", "middle_json", "structured_content", "zip"]+}+```++Omit `page_range` for non-PDF files. The current self-hosted server provides the four output types above. Consult the server capabilities and OpenAPI at `/docs`; renderer formats do not imply API support.++The 4.0 V1 service does not provide legacy `/file_parse` or `/tasks` routes. See [migration](../reference/migration_4.md) for older clients and [output formats](../reference/output_files.md) for rendering and saving Python results.diff --git a/docs/en/usage/tiers.md b/docs/en/usage/tiers.mdnew file mode 100644index 00000000..5a42e9c1--- /dev/null+++ b/docs/en/usage/tiers.md@@ -0,0 +1,48 @@+# Tiers and Runtimes++Tiers express parsing quality and cost. Small-model backends and VLM engines are configured independently; they are not tier names.++| Tier | Purpose | Local execution |+| --- | --- | --- |+| `flash` | Fast previews, indexing, native documents | Native PDF text / document parsing; Flash OCR for scans and images |+| `basic` | OCR, formulas, and tables | ONNX or Torch small models; no local VLM required |+| `standard` | Complex layouts and high-quality parsing | Small models + VLM |+| `advanced` | More demanding quality requirements | Standard models and runtime, with more inference computation |++PDF and images support all four tiers. Office, OpenDocument, RTF, EPUB, OFD, HTML, and CSV/TSV use local Flash and whole-document parsing. Pass `tier="flash"` explicitly for these formats in the local Python SDK. Plain text is not parsed, but can be indexed and read by the document library.++## Default selection++- `mineru-kit parse` and local Python `parse()` default to Standard for PDFs.+- After discovering service capabilities, the document library prefers Standard, then Basic for PDF/images. If neither is available, it returns `quality_tier_unavailable` rather than silently choosing Flash or uploading to the official service.+- Advanced is explicit. Prepare models and managed service capacity as Standard; there is no separate Advanced model download.+- Library `read` consumes cached results without starting a new parse. Without an explicit tier, it prefers cached Advanced, Standard, then Basic results.++## Backends and engines++| Environment | Automatic small models | Automatic VLM |+| --- | --- | --- |+| Apple Silicon / MPS | Torch / MPS | llama.cpp |+| Linux / Windows, base package | ONNX / CPU when no Torch accelerator runtime is available | llama.cpp |+| Linux, accelerator and `full` | Torch | vLLM, otherwise installed LMDeploy |+| Windows, accelerator and `full` | Torch | LMDeploy |+| CPU environment | ONNX / CPU | llama.cpp |++Automatic selection uses installed dependencies and available devices. An explicit choice with missing dependencies fails instead of silently selecting another backend. ONNX small models run on CPU; VLM device selection is independent.++```yaml+model:+ small_backend: auto+ vlm:+ engine: auto+```++`small_backend` accepts `auto/onnx/torch`; `engine` accepts `auto/llama-cpp/vllm/lmdeploy/mlx`. macOS does not select MLX automatically: install and configure it explicitly.++## Resources and platform boundaries++Native text parsing needs no inference models. Basic can run on CPU. Standard / Advanced speed and memory depend on the VLM engine, input size, and concurrency. Plan for at least 16 GB of system memory for higher-throughput local deployment. NVIDIA deployments also need an engine-supported GPU, driver, and sufficient free VRAM; 8 GB is only a planning starting point, not a guarantee for every workload.++For Apple Silicon, at least 16 GB of unified memory and a direct macOS installation are recommended. Existing AMD and vendor adaptations remain on [MinerU <4](compatibility.md); this page does not extend their compatibility claims to 4.0.++See [extension modules](../quick_start/extension_modules.md) for installation and [Model Source](model_source.md) for downloads and configuration.diff --git a/docs/zh/faq/index.md b/docs/zh/faq/index.mdindex 87085c78..07c5cac0 100644--- a/docs/zh/faq/index.md+++ b/docs/zh/faq/index.md@@ -4,29 +4,17 @@如果您仍然无法解决问题,您可通过[Discord](https://discord.gg/Tdedn9GTXq)或[WeChat](https://mineru.net/community-portal/?aliasId=3c430f94)加入社区,与其他用户和开发者交流。-??? question "Windows 直接安装后推理速度很慢怎么办?"+??? question "Windows 推理很慢或引擎安装失败怎么办?"- ### Windows 直接安装后推理速度很慢怎么办? {#windows-cuda-acceleration}+ ### Windows CUDA 加速 {#windows-cuda-acceleration}- Windows 直接安装后如果推理速度很慢,通常是 CUDA 加速相关依赖未正确安装。请根据显卡架构选择对应方案:+ 基础包默认可使用 ONNX / CPU 与 llama.cpp。需要 Torch 小模型和 LMDeploy 时,在原虚拟环境中安装 `"mineru[full]>=4.0,<5"`,并核对 Torch 的 CUDA 支持、显卡驱动及引擎 wheel 的 Python 范围。- - Volta / Turing / Ampere / Ada Lovelace 架构显卡,例如 V100、20 系、T4、30 系、40 系:直接安装支持 CUDA 的 `torch` 和 `torchvision` 即可。请前往 [PyTorch 官网](https://pytorch.org/get-started/locally/) 选择适合您 CUDA 版本的 Windows 安装命令。- - Blackwell 架构显卡,例如 RTX 50xx 系列:安装 `lmdeploy 0.11.1 + cu128` 的 Windows wheel。请将 `PYTHON_VERSION` 设置为当前 Python 版本,例如 Python 3.10 / 3.11 / 3.12 / 3.13 分别填写 `310` / `311` / `312` / `313`。+ 4.0 使用 `lmdeploy>=0.17.0,<0.18` 和 Transformers 5;不要套用旧版 LMDeploy 0.11.x 的 wheel 或跳过依赖检查。详见[扩展模块](../quick_start/extension_modules.md)和[档位说明](../usage/tiers.md)。- ```powershell- $env:LMDEPLOY_VERSION = "0.11.1"- $env:PYTHON_VERSION = "312"-- $wheel = "https://github.com/InternLM/lmdeploy/releases/download/v$($env:LMDEPLOY_VERSION)/lmdeploy-$($env:LMDEPLOY_VERSION)+cu128-cp$($env:PYTHON_VERSION)-cp$($env:PYTHON_VERSION)-win_amd64.whl"- pip install $wheel --extra-index-url https://download.pytorch.org/whl/cu128- ```-- 如果 Blackwell 架构显卡环境中已经安装过 cu128 版本的 `torch`,则在定义好 `$wheel` 后只需执行以下命令,避免重新下载低版本 `torch`:-- ```powershell- pip install $wheel --no-dependencies- ```+??? question "升级后旧命令、API 或配置不再工作怎么办?"+ 4.0 WebUI 使用 `mineru-kit webui` / `mineru-webui`,解析 API 使用 `/v1/*`,配置使用 `config.yaml`。旧 `/file_parse`、`/tasks` 和 `model.stack` 不能直接沿用。见[迁移指南](../reference/migration_4.md)。??? question "在WSL2的Ubuntu22.04中遇到报错`ImportError: libGL.so.1: cannot open shared object file: No such file or directory`"diff --git a/docs/zh/index.md b/docs/zh/index.mdindex 6f3fbdb8..6f2a7c06 100644--- a/docs/zh/index.md+++ b/docs/zh/index.md@@ -1,75 +1,25 @@-<div align="center" xmlns="http://www.w3.org/1999/html">-<!-- logo -->-<p align="center">- <img src="https://opendatalab.github.io/MinerU/images/MinerU-logo.png" width="300px" style="vertical-align:middle;">-</p>-</div>+# MinerU 4.0-<!-- icon -->+{ width="300" }-[](https://github.com/opendatalab/MinerU)-[](https://github.com/opendatalab/MinerU)-[](https://github.com/opendatalab/MinerU/issues)-[](https://github.com/opendatalab/MinerU/issues)-[](https://pypi.org/project/mineru/)-[](https://pypi.org/project/mineru/)-[](https://pepy.tech/project/mineru)-[](https://pepy.tech/project/mineru)-[](https://mineru.net/OpenSourceTools/Extractor?source=github)-[](https://www.modelscope.cn/studios/OpenDataLab/MinerU)-[](https://huggingface.co/spaces/opendatalab/MinerU)-[](https://colab.research.google.com/gist/myhloli/a3cb16570ab3cfeadf9d8f0ac91b4fca/mineru_demo.ipynb)-[](https://arxiv.org/abs/2409.18839)-[](https://arxiv.org/abs/2509.22186)-[](https://arxiv.org/abs/2604.04771)-[](https://deepwiki.com/opendatalab/MinerU)+MinerU 4.0 将多格式文档解析、文档库和服务工具整合到统一工作流,面向文档转换、应用集成和 Agent 阅读。-<div align="center">-<a href="https://trendshift.io/repositories/11174" target="_blank"><img src="https://trendshift.io/api/badge/repositories/11174" alt="opendatalab%2FMinerU | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>-<!-- hot link -->+- **四档解析**:Flash 用于快速预览与索引,Basic 提供基础 OCR/模型解析,Standard 与 Advanced 面向更复杂的版面和更高的质量需求。+- **多格式输入**:PDF、图片,以及 DOC/DOCX、PPT/PPTX、XLS/XLSX、RTF、ODT/ODS/ODP、EPUB、OFD、HTML、CSV/TSV。原生文档由 DocVortex 提供解析能力。+- **文档库与 Agent 阅读**:发现文件、缓存结果、搜索内容,按页或块继续阅读,并保留稳定引用位置。+- **独立模型配置**:小模型选择 ONNX 或 Torch;VLM 独立选择 llama.cpp、vLLM、LMDeploy,或手动安装并显式配置 MLX。+- **统一工具入口**:Python SDK、V1 API、无状态批处理、多服务 Router 和基于 Gradio 的 WebUI。+- **结构化结果与渲染**:统一文档模型支持 Markdown、HTML、LaTeX、DOCX、EPUB、PDF、Structured Content、Content List V1/V2 九种渲染目标;各 CLI/API 的导出范围见输出说明。-<p align="center">-🚀<a href="https://mineru.net/?source=github">MinerU 官网入口→✅ 免装在线版 ✅ 全功能客户端 ✅ 开发者API在线调用,省去部署麻烦,多种产品形态一键get,速冲!</a>-</p>+PDF 和图片支持四档解析;Office、OpenDocument、EPUB、OFD、HTML、CSV/TSV 使用本地 Flash 原生解析。纯文本直接读取,不进入解析流程。默认不会自动将文档上传到官网服务,远程解析需要显式配置。-<!-- join us -->+## 开始使用-<p align="center">- 👋 join us on <a href="https://discord.gg/Tdedn9GTXq" target="_blank">Discord</a> and <a href="https://mineru.net/community-portal/?aliasId=3c430f94" target="_blank">WeChat</a>-</p>-</div>+- [安装与快速入门](quick_start/index.md)+- [档位与运行环境](usage/tiers.md)+- [Python SDK 与 V1 API](usage/sdk_api.md)+- [3.x → 4.0 迁移](reference/migration_4.md)+- [旧平台适配(MinerU <4)](usage/compatibility.md)+- [更新历史](reference/changelog.md)-## 项目简介--MinerU 是一款文档解析工具,可将 `PDF`、`EPUB`、静态 `HTML`、图片、`CSV`、`RTF`、`DOCX`、`PPTX`、`XLSX`、`ODT`、`ODS`、`ODP` 转化为机器可读格式(如 Markdown、JSON),便于后续检索、抽取与二次处理。-MinerU诞生于[书生-浦语](https://github.com/InternLM/InternLM)的预训练过程中,我们将会集中精力解决科技文献中的符号转化问题,希望在大模型时代为科技发展做出贡献。-相比国内外知名商用产品MinerU还很年轻,如果遇到问题或者结果不及预期请到[issue](https://github.com/opendatalab/MinerU/issues)提交问题,同时**附上相关文档或样例文件**。----## 主要功能--- 支持 `PDF`、`EPUB`、静态 `HTML`、图片、`CSV`、`RTF`、`DOCX`、`PPTX`、`XLSX`、`ODT`、`ODS`、`ODP` 输入-- 删除页眉、页脚、脚注、页码等元素,确保语义连贯-- 输出符合人类阅读顺序的文本,适用于单栏、多栏及复杂排版-- 保留原文档的结构,包括标题、段落、列表等-- 提取图像、图片描述、表格、表格标题及脚注-- 自动识别并转换文档中的公式为LaTeX格式-- 自动识别并转换文档中的表格为HTML格式-- 自动检测扫描版PDF和乱码PDF,并启用OCR功能-- OCR支持109种语言的检测与识别-- 支持多种输出格式,如多模态与NLP的Markdown、按阅读顺序排序的JSON、含有丰富信息的中间格式等-- 支持layout可视化,便于高效确认输出效果与质检-- 内置命令行、FastAPI、Gradio WebUI,支持本地编排和多服务部署-- 支持纯CPU环境运行,并支持 GPU(CUDA)/NPU(CANN)/MPS 加速-- 兼容Windows、Linux和Mac平台---## 使用指南--- [快速上手指南](./quick_start/index.md)-- [详细使用说明](./usage/index.md)--## 许可证信息--本仓库采用 [MinerU 开源许可证](https://github.com/opendatalab/MinerU/blob/master/LICENSE.md) 进行许可,基于 Apache 2.0 并附带额外条款。+[GitHub](https://github.com/opendatalab/MinerU) · [MinerU](https://mineru.net/) · [License](https://github.com/opendatalab/MinerU/blob/master/LICENSE.md)diff --git a/docs/zh/quick_start/docker_deployment.md b/docs/zh/quick_start/docker_deployment.mdindex 5b5aa07c..08dbdfb9 100644--- a/docs/zh/quick_start/docker_deployment.md+++ b/docs/zh/quick_start/docker_deployment.md@@ -1,96 +1,56 @@-# 使用docker部署Mineru+# Docker 部署(MinerU 4.0 / NVIDIA)-MinerU提供了便捷的docker部署方式,这有助于快速搭建环境并解决一些棘手的环境兼容问题。+通用 Docker 面向 Linux NVIDIA 环境(Windows 使用 WSL2)。Apple Silicon 使用 macOS 原生安装;此 Docker 流程不提供 MPS/MLX 加速。AMD 和国产卡使用[旧平台指南](../usage/compatibility.md),对应专用 Docker 保持 `mineru<4`。-> [!WARNING]-> - Docker 部署仅适用于 Linux,以及支持 WSL2 的 Windows 环境。-> - 请不要在 macOS 上使用 Docker 部署 MinerU。由于 Docker 环境下无法调用 macOS 上的 MPS 和 MLX 加速能力,Apple Silicon 设备无法通过该方案获得预期加速效果。+## 构建镜像-## 使用 Dockerfile 构建镜像+在包含本次 4.0 Dockerfile 的仓库根目录执行:```bash-wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/Dockerfile-docker build -t mineru:latest -f Dockerfile .+docker build -t mineru:4 -f docker/china/Dockerfile .```-## Docker说明+基础镜像保留 vLLM 0.21.0,Dockerfile 安装 `mineru[torch]>=4.0,<5`,复用基础镜像中的 vLLM。默认镜像使用 CUDA 13.0;需要 CUDA 12.9 时启用文件中注释的 `v0.21.0-cu129` 基础镜像,并确保主机驱动支持所选运行时。-Mineru的docker使用了`vllm/vllm-openai`作为基础镜像,因此在docker中默认集成了`vllm`推理加速框架和必需的依赖环境。当前国内 Dockerfile 默认使用`docker.m.daocloud.io/vllm/vllm-openai:v0.21.0`,适用于 CUDA 13.0 兼容环境;如果您的环境需要 CUDA 12.9 兼容镜像,请将 Dockerfile 顶部的默认`FROM`注释掉,并启用注释中的`docker.m.daocloud.io/vllm/vllm-openai:v0.21.0-cu129`基础镜像。因此在满足条件的设备上,您可以直接使用`vllm`加速VLM模型推理。-> [!NOTE]-> 使用`vllm`加速VLM模型推理需要满足的条件是:->-> - 设备包含Volta及以后架构的显卡,且可用显存大于等于8G。-> - 物理机的显卡驱动应支持所选基础镜像对应的 CUDA 运行时版本:默认`v0.21.0`需要 CUDA 13.0 兼容驱动,`v0.21.0-cu129`需要 CUDA 12.9 兼容驱动。可通过`nvidia-smi`命令检查驱动版本。-> - docker中能够访问物理机的显卡设备。+构建时明确下载 Torch 小模型和 vLLM 原始权重,运行时也固定 `MINERU_MODEL_SMALL_BACKEND=torch`、`MINERU_MODEL_VLM_ENGINE=vllm`。这允许无 GPU 构建机准备正确的权重,实际推理仍需要匹配的 GPU。国内 Dockerfile 使用 ModelScope,国际版本使用 Hugging Face。+## 交互式容器-## 启动 Docker 容器+```bash+docker run --gpus all --shm-size 32g --ipc=host \+ -p 7860:7860 -p 8000:8000 -p 8002:8002 -p 30000:30000 \+ -it mineru:4 /bin/bash+```++容器内启动 WebUI:```bash-docker run --gpus all \- --shm-size 32g \- -p 30000:30000 -p 7860:7860 -p 8000:8000 -p 8002:8002 \- --ipc=host \- -it mineru:latest \- /bin/bash+mineru-kit webui --server-name 0.0.0.0 --server-port 7860```-执行该命令后,您将进入到Docker容器的交互式终端,并映射了一些端口用于可能会使用的服务,您可以直接在容器内运行MinerU相关命令来使用MinerU的功能。-您也可以直接通过替换`/bin/bash`为服务启动命令来启动MinerU服务,详细说明请参考[通过命令启动服务](https://opendatalab.github.io/MinerU/zh/usage/quick_usage/#apiwebuihttp-clientserver)。+## Docker Compose++以下命令使用同一仓库中的 Compose 配置和本地构建的 `mineru:4`。按需要选择一个服务 profile;同时启动多个模型服务时需规划显存和 GPU 分配。-## 通过 Docker Compose 直接启动服务+```bash+docker compose -f docker/compose.yaml --profile webui up -d+docker compose -f docker/compose.yaml --profile api up -d+docker compose -f docker/compose.yaml --profile router up -d+docker compose -f docker/compose.yaml --profile openai-server up -d+```-我们提供了[compose.yml](https://github.com/opendatalab/MinerU/blob/master/docker/compose.yaml)文件,您可以通过它来快速启动MinerU服务。+| Profile | 地址 / 健康检查 | 用途 |+| --- | --- | --- |+| `webui` | `http://127.0.0.1:7860` | 文档解析界面,服务名 `mineru-webui` |+| `api` | `http://127.0.0.1:8000/v1/health` | V1 文档解析 API |+| `router` | `http://127.0.0.1:8002/v1/health` | 多服务 / 多 GPU V1 入口 |+| `openai-server` | `http://127.0.0.1:30000/health` | OpenAI 兼容 VLM 推理,不是文档解析 API |++检查配置与日志:```bash-# 下载 compose.yaml 文件-wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml+docker compose -f docker/compose.yaml --profile webui config+docker compose -f docker/compose.yaml logs mineru-webui```->[!NOTE]->->- `compose.yaml`文件中包含了MinerU的多个服务配置,您可以根据需要选择启动特定的服务。->- 不同的服务可能会有额外的参数配置,您可以在`compose.yaml`文件中查看并编辑。->- 由于`vllm`推理加速框架预分配显存的特性,您可能无法在同一台机器上同时运行多个`vllm`服务,因此请确保在启动`vlm-openai-server`服务或使用`vlm-vllm-engine`后端时,其他可能使用显存的服务已停止。-------### 启动 openai兼容接口 服务-并通过`vlm-http-client`后端连接`openai-server`- ```bash- docker compose -f compose.yaml --profile openai-server up -d- ```- >[!TIP]- >在另一个终端中通过http client连接openai server(只需cpu与网络,不需要vllm环境)- > ```bash- > mineru -p <input_path> -o <output_path> -b vlm-http-client -u http://<server_ip>:30000- > ```-------### 启动 Web API 服务- ```bash- docker compose -f compose.yaml --profile api up -d- ```- >[!TIP]- >在浏览器中访问 `http://<server_ip>:8000/docs` 查看API文档。-------### 启动 MinerU Router 服务- ```bash- docker compose -f compose.yaml --profile router up -d- ```- >[!TIP]- >- >- 默认配置会以 `--local-gpus auto` 模式在容器内自动拉起本地 worker,并通过 `http://<server_ip>:8002/docs` 暴露统一入口。- >- 如果您希望聚合已有的 `mineru-api` 服务而不是启动本地 worker,可直接参考 `compose.yaml` 中 `mineru-router` 服务下的注释示例,改为使用 `--upstream-url`。-------### 启动 Gradio WebUI 服务- ```bash- docker compose -f compose.yaml --profile gradio up -d- ```- >[!TIP]- >- >- 在浏览器中访问 `http://<server_ip>:7860` 使用 Gradio WebUI。++从旧 Compose 升级时,将 `gradio` profile 改为 `webui`,服务名改为 `mineru-webui`。容器挂载目录、GPU `device_ids` 和端口按部署环境调整。更多接口用法见[SDK 与 API](../usage/sdk_api.md)。diff --git a/docs/zh/quick_start/extension_modules.md b/docs/zh/quick_start/extension_modules.mdindex ea00e102..a096f30b 100644--- a/docs/zh/quick_start/extension_modules.md+++ b/docs/zh/quick_start/extension_modules.md@@ -1,56 +1,38 @@-# MinerU 扩展模块安装指南-MinerU 支持根据不同需求,按需安装扩展模块,以增强功能或支持特定的模型后端。+# 扩展模块安装-## 常见场景+所有示例面向 MinerU 4.x,在已激活的虚拟环境中执行。++| 安装方式 | 包含能力 | 适用场景 |+| --- | --- | --- |+| `mineru>=4.0,<5` | ONNX、llama.cpp、WebUI、SDK/API;Apple Silicon 自动包含 Torch | 原生文档、CPU 小模型、llama.cpp 或连接已有服务 |+| `mineru[torch]>=4.0,<5` | 基础包 + Torch、Torchvision、Transformers、Accelerate | 使用 Torch 小模型,VLM 引擎独立选择 |+| `mineru[full]>=4.0,<5` | Torch extra + Linux 上的 vLLM / Windows 上的 LMDeploy | 支持设备上的高吞吐部署 |-### 核心功能安装-`core` 模块是 MinerU 的核心依赖,包含了常用解析功能,不包含`vllm`/`lmdeploy`等可选模块。安装此模块可以确保 MinerU 的基本功能正常运行。```bash-uv pip install "mineru[core]"+uv pip install -U "mineru[torch]>=4.0,<5"```------### 使用`vllm`加速 VLM 模型推理-> [!NOTE]-> `vllm`和`lmdeploy`对vlm的推理加速效果和使用方式几乎相同,您可以根据实际情况选择其中之一进行安装和使用,但不建议同时安装这两个模块,以避免潜在的依赖冲突。+或安装平台对应的推理引擎:-`vllm` 模块提供了对 VLM 模型推理的加速支持,适用于具有 Volta 及以后架构的显卡(8G 显存及以上)。安装此模块可以显著提升模型推理速度。```bash-uv pip install "mineru[core,vllm]"+uv pip install -U "mineru[full]>=4.0,<5"```-> [!TIP]-> - 由于`vllm`扩展包已放开到 0.21 系列版本,默认安装通常会选择当前允许范围内更高的`vllm`版本。请确保物理机显卡驱动支持所安装`vllm`包对应的 CUDA 运行时,默认路径需要 CUDA 13.0 兼容驱动。-> - 如需使用 CUDA 12.9 兼容环境,请参考 [vllm 官方文档](https://docs.vllm.ai/en/latest/getting_started/installation/index.html) 选择对应的 CUDA 安装方式,或直接使用 [Docker](./docker_deployment.md) 中的`vllm/vllm-openai:v0.21.0-cu129`基础镜像。-> - 如在安装包含`vllm`的扩展包过程中发生异常,也可参考 [vllm 官方文档](https://docs.vllm.ai/en/latest/getting_started/installation/index.html) 尝试解决。----+`all` 是 `full` 的组合别名。`core`、`pipeline`、`vlm`、`vllm`、`lmdeploy`、`gradio`、`mlx` 不再是 MinerU 4.0 的 extras。档位名称也不是 extra。-### 使用`lmdeploy`加速 VLM 模型推理-> [!NOTE]-> `vllm`和`lmdeploy`对vlm的推理加速效果和使用方式几乎相同,您可以根据实际情况选择其中之一进行安装和使用,但不建议同时安装这两个模块,以避免潜在的依赖冲突。+## 可选引擎约束-`lmdeploy` 模块提供了对 VLM 模型推理的加速支持,适用于具有 Volta 及以后架构的显卡(8G 显存及以上)。安装此模块可以显著提升模型推理速度。-```bash-uv pip install "mineru[core,lmdeploy]"-```-> [!TIP]-> 如在安装包含`lmdeploy`的扩展包过程中发生异常,请参考 [lmdeploy 官方文档](https://lmdeploy.readthedocs.io/en/latest/get_started/installation.html) 尝试解决。+4.0 当前声明 `torch>=2.7.0,<3`、`transformers>=5.10.1,<6`、Linux `vllm>=0.19.1,<0.29.0`、Windows `lmdeploy>=0.17.0,<0.18`。Python 支持范围还应与这些依赖实际提供的 wheel 取交集。升级已有厂商环境前,先确认它是否属于[旧平台适配](../usage/compatibility.md)。----+Apple Silicon 的默认 VLM 是 llama.cpp;`full` 不自动安装 MLX。需要 MLX 时手动安装并显式选择:-### 安装轻量版client连接兼容openai服务器使用 (适用vlm-http-client模式)-如果您需要在边缘设备上安装轻量版的 client 端以连接兼容 openai 接口的服务端来使用vlm模式,可以安装mineru的基础包,非常轻量,适合在只有cpu和网络连接的设备上使用。```bash-uv pip install mineru-mineru -p <input_path> -o <output_path> -b vlm-http-client -u http://127.0.0.1:30000+uv pip install "mineru>=4.0,<5" "mlx-vlm>=0.7.0,<0.8.0"+mineru config set model.vlm.engine mlx```----+WebUI 使用 Gradio 6,包含本地 PDF.js 预览资源,无需额外安装 `gradio-pdf`。独立 UI 环境可用基础包,通过 `mineru-kit webui --api-url http://127.0.0.1:8000` 连接推理服务。-### 安装轻量版client连接兼容openai服务器使用 (适用hybrid-http-client模式)-如果您需要在边缘设备上安装轻量版的 client 端以连接兼容 openai 接口的服务端来使用hybrid模式,可以安装mineru的pipeline扩展包,相对较轻量,可以在只有cpu和网络连接的设备上使用,同时在支持gpu加速的设备上可以更快运行。-```bash-uv pip install "mineru[pipeline]"-mineru -p <input_path> -o <output_path> -b hybrid-http-client -u http://127.0.0.1:30000-```+## 升级已有环境++先停止该环境的 MinerU 服务,再用原安装工具升级并保留需要的 extras,完成后确认版本、依赖与模型配置。模型下载与推理使用相同的 `model.small_backend` 和 `model.vlm.engine`,详见[模型源说明](../usage/model_source.md)。diff --git a/docs/zh/quick_start/index.md b/docs/zh/quick_start/index.mdindex 8b0338de..8f397c13 100644--- a/docs/zh/quick_start/index.md+++ b/docs/zh/quick_start/index.md@@ -1,164 +1,100 @@# 快速入门-文档解析是困难且复杂的任务,尤其是对于复杂版面、扫描件、手写体等场景,解析结果可能不尽如人意。我们建议您先在线体验评估 MinerU 的解析效果和适用性,再根据实际需求选择合适的部署方式。-如果您有解析效果不佳的**文档**样例,欢迎提交上传到 [issue](https://github.com/opendatalab/MinerU/issues),我们会持续优化解析能力。-如果遇到任何安装问题,请先查询 [FAQ](../faq/index.md)--## 在线体验--### 官网在线应用-官网在线版功能与客户端一致,界面美观,功能丰富,需要登录使用--- [](https://mineru.net/OpenSourceTools/Extractor?source=github)--### 基于Gradio的在线demo-基于gradio开发的webui,界面简洁,仅包含核心解析功能,免登录--- [](https://www.modelscope.cn/studios/OpenDataLab/MinerU)-- [](https://huggingface.co/spaces/opendatalab/MinerU)--## 本地部署--> [!WARNING]-> **安装前必看——软硬件环境支持说明**->-> 为了确保项目的稳定性和可靠性,我们在开发过程中仅对特定的软硬件环境进行优化和测试。这样当用户在推荐的系统配置上部署和运行项目时,能够获得最佳的性能表现和最少的兼容性问题。->-> 通过集中资源和精力于主线环境,我们团队能够更高效地解决潜在的BUG,及时开发新功能。->-> 在非主线环境中,由于硬件、软件配置的多样性,以及第三方依赖项的兼容性问题,我们无法100%保证项目的完全可用性。因此,对于希望在非推荐环境中使用本项目的用户,我们建议先仔细阅读文档以及FAQ,大多数问题已经在FAQ中有对应的解决方案,除此之外我们鼓励社区反馈问题,以便我们能够逐步扩大支持范围。--<table border="1">- <thead>- <tr>- <th rowspan="2" style="text-align:center; vertical-align:middle;">解析后端</th>- <th rowspan="2" style="text-align:center; vertical-align:middle;">hybrid low</th>- <th colspan="2" style="text-align:center;">*-engine</th>- <th colspan="2" style="text-align:center;">*-http-client</th>- </tr>- <tr>- <th>hybrid</th>- <th>vlm</th>- <th>hybrid</th>- <th>vlm</th>- </tr>- </thead>- <tbody>- <tr>- <th>后端特性</th>- <td style="text-align:center;">兼容性好</td>- <td colspan="2" style="text-align:center;">硬件配置要求较高</td>- <td colspan="2" style="text-align:center;">适用于OpenAI兼容服务器<sup>2</sup></td>- </tr>- <tr>- <th>精度指标<sup>1</sup></th>- <td style="text-align:center;">86.47</td>- <td style="text-align:center;">95.39(effort=high)<br>95.26(effort=medium)</td>- <td style="text-align:center;">95.30</td>- <td style="text-align:center;">95.39(effort=high)<br>95.26(effort=medium)</td>- <td style="text-align:center;">95.30</td>- </tr>- <tr>- <th>操作系统</th>- <td colspan="5" style="text-align:center;">Linux<sup>3</sup> / Windows<sup>4</sup> / macOS<sup>5</sup></td>- </tr>- <tr>- <th>纯CPU平台支持</th>- <td style="text-align:center;">✅</td>- <td colspan="2" style="text-align:center;">❌</td>- <td colspan="2" style="text-align:center;">✅</td>- </tr>- <tr>- <th>GPU加速支持</th>- <td colspan="4" style="text-align:center;">Volta及以后架构GPU或Apple Silicon</td>- <td rowspan="2" style="text-align:center; vertical-align:middle;">不需要</td>- </tr>- <tr>- <th>显存最低要求</th>- <td style="text-align:center;">4GB</td>- <td colspan="2" style="text-align:center;">8GB</td>- <td style="text-align:center;">2GB</td>- </tr>- <tr>- <th>内存要求</th>- <td colspan="3" style="text-align:center;">最低16GB以上,推荐32GB以上</td>- <td colspan="2" style="text-align:center;">16GB</td>- </tr>- <tr>- <th>磁盘空间要求</th>- <td colspan="3" style="text-align:center;">20GB以上,推荐使用SSD</td>- <td colspan="2" style="text-align:center;">2GB</td>- </tr>- <tr>- <th>python版本</th>- <td colspan="5" style="text-align:center;">3.10-3.13</td>- </tr>- </tbody>-</table>--<sup>1</sup> 精度指标为OmniDocBench (v1.6)的End-to-End Evaluation Overall分数,基于`MinerU`最新版本测试-<sup>2</sup> 兼容OpenAI API的服务器,如通过`vLLM`/`SGLang`/`LMDeploy`等推理框架部署的本地模型服务器或远程模型服务-<sup>3</sup> Linux仅支持2019年及以后发行版-<sup>4</sup> 由于关键依赖`ray`未能在windows平台支持Python 3.13,故仅支持至3.10~3.12版本-<sup>5</sup> macOS 需使用14.0以上版本---> [!TIP]-> 除以上主流环境与平台外,我们也收录了一些社区用户反馈的其他平台支持情况,详情请参考[其他加速卡适配](https://opendatalab.github.io/MinerU/zh/usage/)。-> 如果您有意将自己的环境适配经验分享给社区,欢迎通过[show-and-tell](https://github.com/opendatalab/MinerU/discussions/categories/show-and-tell)提交或提交PR至[其他加速卡适配](https://github.com/opendatalab/MinerU/tree/master/docs/zh/usage/acceleration_cards)文档。---### 安装 MinerU--#### 使用pip或uv安装MinerU+本指南面向 MinerU **4.0 正式版**。AMD 和国产加速卡的既有适配保持在 `<4`,请使用[旧平台指南](../usage/compatibility.md)。++## 安装 MinerU++MinerU 包支持 Python `>=3.10,<3.15`。建议新建 Python 3.12 环境;vLLM、LMDeploy、Torch 等可选引擎还受各自 wheel、操作系统和驱动约束,包支持的 Python 范围不等于所有引擎均支持该范围。++```bash+uv venv --python 3.12 .venv+```++Linux / macOS 激活环境:++```bash+source .venv/bin/activate+```++Windows PowerShell 激活环境:++```powershell+.venv\Scripts\Activate.ps1+```++安装基础包:++```bash+uv pip install -U "mineru>=4.0,<5"+```++也可在已激活的环境中使用 `python -m pip install -U "mineru>=4.0,<5"`。中国大陆可给安装命令添加 `-i https://mirrors.aliyun.com/pypi/simple`。++基础包包含 WebUI、ONNX 小模型运行时和 llama.cpp VLM;Apple Silicon 上会自动安装 Torch 依赖。需要 Torch 小模型或高吞吐 VLM 时,按[扩展模块](extension_modules.md)安装 `torch` 或 `full`,不要使用 3.x 的 extras。++## 第一次解析++无状态解析单个文件,将 Markdown 写入指定文件:+```bash-pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple-pip install uv -i https://mirrors.aliyun.com/pypi/simple-uv pip install -U "mineru[all]" -i https://mirrors.aliyun.com/pypi/simple+mineru-kit parse document.pdf -o document.md --tier standard```-#### 通过源码安装MinerU+首次使用模型可能需要下载权重。无模型的原生 PDF 文本提取可显式选择:++```bash+mineru-kit parse document.pdf -o document.md --tier flash --ocr-mode txt+```++该命令使用 PDF 文本层,不会为扫描页追加 OCR 回退。扫描 PDF 应使用 `--ocr-mode ocr` 并准备对应模型。++原生文档解析与批量转换:+```bash-git clone https://github.com/opendatalab/MinerU.git-cd MinerU-uv pip install -e .[all] -i https://mirrors.aliyun.com/pypi/simple+mineru-kit parse report.docx -o report.md --tier flash+mineru-kit parse ./documents -o ./output --format zip```-> [!TIP]-> - `mineru[all]`包含所有核心功能,兼容Windows / Linux / macOS系统,适合绝大多数用户。-> - 如果您在 Windows 上安装后无法使用 CUDA 加速,请参考 [Windows CUDA 加速 FAQ](../faq/index.md#windows-cuda-acceleration)。-> - 如果您需要指定vlm模型的推理框架,或是仅准备在边缘设备安装轻量版client端,可以参考文档[扩展模块安装指南](https://opendatalab.github.io/MinerU/zh/quick_start/extension_modules/)。+目录和多文件输入的 `-o` 必须是目录;单文件 Markdown 输出使用文件路径。`mineru-kit parse` 默认处理全部 PDF 页。------#### 使用docker部署Mineru-MinerU提供了便捷的docker部署方式,这有助于快速搭建环境并解决一些棘手的环境兼容问题。+## 文档库与 Agent-> [!TIP]-> - Docker 部署仅适用于 Linux,以及支持 WSL2 的 Windows 环境;-> - macOS 用户请直接参考前面两种方式部署安装,不要使用 Docker 部署。+```bash+mineru parse document.pdf --json+mineru parse document.pdf --pages all -o document.md+mineru search "关键词" --json+```-您可以在文档中获取[Docker部署说明](./docker_deployment.md)。+`mineru` 使用文档库和缓存。`mineru parse` 默认读取 PDF 前 10 页,可能按输出长度返回继续阅读请求;按返回的 locator 和 `next_request` 继续。它与直接输出完整文件的 `mineru-kit parse` 是不同工作流,详见[基础使用](../usage/quick_usage.md)。----+## WebUI 与 API-### 使用 MinerU+```bash+mineru-kit webui --server-name 127.0.0.1 --server-port 7860+```->[!TIP]->默认使用托管在`huggingface`的模型进行解析,首次使用时会自动下载所需模型文件,后续使用将直接加载本地缓存的模型。如果您无法访问`huggingface`,可以通过以下命令切换至国内镜像源:->```bash->export MINERU_MODEL_SOURCE=modelscope->```+在浏览器打开 [本地 WebUI](http://127.0.0.1:7860)。`mineru-webui` 是相同入口的独立命令。未指定 `--api-url` 时,WebUI 托管本地 V1 API 服务;连接已有服务见[SDK 与 API](../usage/sdk_api.md)。-如果您的设备满足上表中GPU加速的条件,可以使用简单的命令行进行文档解析:```bash-mineru -p <input_path> -o <output_path>+mineru-kit api-server --host 127.0.0.1 --port 8000 --tier standard```-如果您的设备不满足GPU加速条件,可以显式使用 Flash tier,以在不调用 VLM 的模式下运行:++在 [OpenAPI 文档](http://127.0.0.1:8000/docs)查看当前服务接口。++## 源码安装++在包含 4.0 源码的仓库根目录执行:+```bash-mineru parse "<input_path>" --tier flash -o <output_path>+uv pip install -e .+mineru version --json```-当前 `mineru` 的现代 CLI 和 API 入口支持本地 `PDF / EPUB / 图片 / CSV / RTF / DOCX / PPTX / XLSX / ODT / ODS / ODP` 文件或目录输入。EPUB、RTF 与 OpenDocument 采用本地 Flash 语义解析,不依赖外部 Office 套件。只有 PDF 接受页范围;其他输入均按一个完整文件解析和缓存,但各格式自身的边界仍作为结构化输出中的逻辑页保留。EPUB 页面严格遵循 OPF spine 顺序,并保留作者目录中可解析的内部跳转。+确认输出版本为 4.x;源码开发环境可显示预发布版本。NVIDIA 容器部署见[Docker 部署](docker_deployment.md)。++## 继续阅读-旧 Gradio WebUI 保持原有上传格式,暂不接收 CSV。具体使用方法请参考[使用指南](../usage/index.md)。+- [档位与运行环境](../usage/tiers.md)+- [模型下载与配置](../usage/model_source.md)+- [3.x → 4.0 迁移](../reference/migration_4.md)+- [官网](https://mineru.net/)与[在线演示](../demo/index.md)diff --git a/docs/zh/reference/changelog.md b/docs/zh/reference/changelog.mdindex 5f22b3bb..f7d7f28c 100644--- a/docs/zh/reference/changelog.md+++ b/docs/zh/reference/changelog.md@@ -2,7 +2,83 @@本文档记录 MinerU 项目的版本更新历史、主要能力演进和重要兼容性变动。----+## 4.0++- 四档解析、多格式原生文档支持、文档库与渐进阅读。+- ONNX/Torch 小模型与独立 VLM 引擎配置,统一 SDK、V1 API、WebUI 和渲染接口。+- 主要能力见[4.0 概览](../index.md),接口与部署调整见[迁移指南](migration_4.md);旧平台适配继续限制 `mineru<4`。++## 3.x 系列版本++- 2026/06/18 3.4 发布++ 本次版本更新聚焦于 **pipeline 后端 OCR 能力升级**、**OCR 处理链路优化** 与 **模型下载体验改进**。主要更新内容包括:++ - OCR 模型升级与处理加速+ - `pipeline` 后端 OCR 模型更新至 `PP-OCRv6`,在 OmniDocBench v1.6 评测中,OCR 相关指标提升约 `11%`。+ - 移除 OCR 语言选择中的日语、繁体中文、英语、拉丁文选项,相关场景统一路由到 `ch` OCR 模型,简化模型配置与语言选择逻辑。+ - 优化 OCR 推理与处理链路,OCR 处理速度提升约 `100%`,显著改善批量文档和 OCR 密集型文档的解析效率。++ - 模型下载逻辑优化+ - 新增模型源自动选择能力,首次安装时可根据当前网络环境自动选择更合适的模型源。+ - 下载模型前会优先检查本地已下载的模型缓存文件,命中缓存时可直接复用,减少重复下载和不必要的远端请求。+ - 更多模型源配置、自动选择策略与本地模型使用说明,请参考 [模型源说明](https://opendatalab.github.io/MinerU/zh/usage/model_source/)。++ 在 3.4 版本,MinerU 进一步提升了 `pipeline` 后端在 OCR 场景下的解析精度与处理效率,同时优化了模型下载、缓存复用和本地配置写入流程,让首次安装、模型更新和多环境部署更加稳定、自动化。++- 2026/06/11 3.3 发布++ 本次版本更新聚焦于 **Hybrid 解析性能优化** 与 **VLM 模型能力升级**。主要更新内容包括:++ - Hybrid 后端新增 `effort` 解析强度参数+ - 新增 `medium` 与 `high` 两档解析强度,用户可根据解析速度、解析精度和功能需求灵活选择。+ - 在 OmniDocBench v1.6 评测中,`medium` 相比 `high` 综合精度仅降低 `0.13`,但在不同设备和场景下可获得 `35%` ~ `220%` 的解析速度提升。+ - 默认 Hybrid 后端将使用 `effort=medium`,在保持高解析精度的同时显著提升整体解析效率。+ - `medium` 档不支持 `image analysis`(图片/图表分析)功能;如需极致解析精度或启用 `image analysis`,可通过 `effort=high` 切换至高强度解析模式。++ - VLM 模型升级至 `MinerU2.5-Pro-2605-1.2B`+ - 修复 `2604` 版本中存在的多处模型问题,进一步提升复杂文档场景下的解析稳定性。+ - 原生支持多语言 OCR,降低多语言文档解析时对额外语言参数配置的依赖。++- 2026/04/18 3.1.0 发布++ 本次版本更新聚焦于**许可协议开放性、解析精度提升与全格式原生支持**。主要更新内容包括:++ - 许可协议升级+ - MinerU 已正式从 `AGPLv3` 切换至基于 `Apache 2.0` 的 [MinerU 开源许可证](https://github.com/opendatalab/MinerU/blob/master/LICENSE.md)。+ - 新的许可方式在兼顾开源协作与商业落地的同时,进一步降低了社区使用和商业化接入门槛,让 MinerU 更容易融入真实业务流程。+ - VLM 主模型升级+ - VLM 主模型正式切换为 `MinerU2.5-Pro-2604-1.2B`,整体解析精度提升至业内领先水平。+ - 新模型现已支持子图切分合并、图像与图表解析、截断段落合并、跨页面表格合并以及表格内图像识别,复杂版面场景下的解析能力进一步增强。+ - 全格式原生解析支持+ - 新增 `PPTX` 与 `XLSX` 原生解析能力。+ - 至此,MinerU 已完整支持图片、`PDF`、`DOCX`、`PPTX`、`XLSX` 全格式解析,为多类型文档统一处理提供了更完整的能力闭环。++ 通过 3.1.0 版本,MinerU 在开放性、解析精度和落地能力上进一步提升。新的许可协议降低了社区使用和商业接入门槛,`MinerU2.5-Pro-2604-1.2B` 提升了复杂内容的解析质量,而 `PPTX` 与 `XLSX` 原生解析的补齐,也让 MinerU 完成了主流文档格式的端到端覆盖。++- 2026/03/29 3.0.0 发布++ 本次版本更新围绕**解析能力、系统架构与工程可用性**进行了系统升级。主要更新内容包括:++ - `DOCX` 原生解析+ - 正式支持 `DOCX` 原生解析,在无幻觉前提下实现高精度解析。+ - 相较于“先将 `DOCX` 转为 `PDF` 再解析”的传统流程,端到端速度提升数十倍以上,更适合对精度与吞吐均有要求的场景。+ - `pipeline` 后端升级+ - `pipeline` 后端在 OmniDocBench (v1.5) 上取得 `86.2` 分,精度超过上一代主流 VLM `MinerU2.0-2505-0.9B`。+ - 新增表格内图片/公式解析、印章文字识别、竖排文本支持、行间公式序号识别等能力,持续提升复杂文档场景下的解析效果。+ - 在保持高精度的同时,资源占用极低,并继续支持纯 CPU 环境推理。+ - `API / CLI / Router` 编排升级+ - `mineru` 现作为基于 `mineru-api` 的编排客户端运行;在未传入 `--api-url` 时,会自动拉起本地临时服务。+ - `mineru-api` 新增异步任务接口 `POST /tasks`,支持任务提交、状态查询与结果获取;同时保留同步解析接口 `POST /file_parse`,以兼容老版本插件。+ - 新增 `mineru-router`,适用于多服务、多 GPU 的统一入口部署与任务路由;其接口与 `mineru-api` 完全兼容,并支持任务自动负载均衡。+ - 部署与使用体验优化+ - 解决了 `torch >= 2.8` 的兼容问题,基础镜像升级为 `vllm0.11.2 + torch2.9.0`,统一了不同 Compute Capability 的安装路径。+ - 通过滑动窗口优化解析链路,显著降低长文档场景下的内存峰值占用,上万页文档解析不再需要手动拆分。+ - `pipeline` 的 batch 推理支持流式落盘,已完成的解析结果可及时写出,进一步提升长任务处理体验。+ - 完成线程安全优化,全面支持多线程并发推理;配合 `mineru-router`,可一键实现多卡部署,轻松构建高并发、高吞吐解析系统。+ - 完全移除了两个 AGPLv3 模型(`doclayoutyolo` 和 `mfd_yolov8`)以及一个 CC-BY-NC-SA 4.0 模型(`layoutreader`)的使用。++ 本次更新不仅是若干功能点的补强,更是 MinerU 在系统能力上的一次关键跃迁。我们重点解决了长文档解析过程中的内存峰值占用问题,通过滑动窗口、流式落盘等链路优化,让超长文档解析从“需要手动拆分、谨慎处理”走向“稳定可跑、规模可扩展”。同时,我们完成了线程安全优化,全面支持多线程并发推理,进一步提升了单机资源利用率与高并发场景下的运行稳定性。在此基础上,基于 mineru-router 与全新的 API / CLI 编排体系,MinerU 已具备一键多卡部署、多服务统一接入、任务自动负载均衡的能力,显著降低了大规模部署难度。至此,MinerU 正在从单一的数据生产工具,进一步演进为面向高并发、高吞吐场景的大规模文档解析基座,为企业级文档数据处理提供更稳定、更高效、更易扩展的基础设施能力。## 2.7 系列版本@@ -366,8 +442,8 @@ MinerU 2.0 集成了我们最新研发的小参数量、高性能多模态文档**性能优化**-- 通过支持多个pdf文件的batch处理([脚本样例](demo/batch_demo.py)),提升了批量小文件的解析速度 (与1.0.1版本相比,公式解析速度最高提升超过1400%,整体解析速度最高提升超过500%)-- 通过优化mfr模型的加载和使用,降低了显存占用并提升了解析速度(需重新执行[模型下载流程](docs/how_to_download_models_zh_cn.md)以获得模型文件的增量更新)+- 通过支持多个pdf文件的batch处理([脚本样例](https://github.com/opendatalab/MinerU/blob/ae9fd9adaa336c171938f0ccd509cdf13a09087b/demo/batch_demo.py)),提升了批量小文件的解析速度 (与1.0.1版本相比,公式解析速度最高提升超过1400%,整体解析速度最高提升超过500%)+- 通过优化mfr模型的加载和使用,降低了显存占用并提升了解析速度(需重新执行[模型下载流程](https://github.com/opendatalab/MinerU/blob/magic_pdf-1.1.0-released/docs/how_to_download_models_zh_cn.md)以获得模型文件的增量更新)- 优化显存占用,最低仅需6GB即可运行本项目- 优化了在mps设备上的运行速度diff --git a/docs/zh/reference/index.md b/docs/zh/reference/index.mdindex a1b61fb6..fbe87ddb 100644--- a/docs/zh/reference/index.md+++ b/docs/zh/reference/index.md@@ -4,6 +4,9 @@## 目录+- [3.x → 4.0 迁移](migration_4.md)+- [Python SDK 与 V1 API](../usage/sdk_api.md)+- [输出文件说明](./output_files.md) - 详细介绍所有输出文件及其格式- [更新日志](./changelog.md) - 版本更新历史和发布说明diff --git a/docs/zh/reference/migration_4.md b/docs/zh/reference/migration_4.mdnew file mode 100644index 00000000..b774d1eb--- /dev/null+++ b/docs/zh/reference/migration_4.md@@ -0,0 +1,49 @@+# 从 3.x 迁移到 4.0++4.0 调整了命令入口、依赖组合、配置和 API。先使用独立环境验证,再迁移生产调用。AMD 和国产加速卡使用[旧平台指南](../usage/compatibility.md),继续限制 `mineru<4`。++## 入口与安装++| 原用法 | 4.0 用法 |+| --- | --- |+| `mineru -p input.pdf -o output` | 文档库:`mineru parse input.pdf --pages all -o output.md`;一次性转换:`mineru-kit parse input.pdf -o output.md` |+| 目录批处理 | `mineru-kit parse ./documents -o ./output --format zip` |+| `mineru-gradio` / 开发期 `mineru-kit gradio` | `mineru-webui` / `mineru-kit webui` |+| 旧模型下载参数 `-m all` | `mineru-kit models download --tier standard` |+| 旧 API 调用 | V1 上传 → 解析任务 → 文件产物 |+| `mineru[core]`、`mineru[pipeline]` 等 extras | 基础包、`mineru[torch]` 或 `mineru[full]` |++正式版安装使用 `"mineru>=4.0,<5"`(需要 extras 时加在包名后)。Python 包要求 `>=3.10,<3.15`;可选引擎按实际 wheel 和驱动选择版本。升级前停止原环境中的服务,升级后检查 `mineru version --json`。不要把旧平台的镜像和安装命令替换成主线 4.0。++## 档位、页码与输出++- 用 `flash/basic/standard/advanced` 选择解析档位;Basic 对应基础小模型流程,Standard / Advanced 使用 VLM。不要用旧 backend 的名称推断新默认质量。+- `mineru parse` 使用文档库、缓存和继续阅读协议,PDF 默认前 10 页;`mineru-kit parse` 与 Python SDK 默认全部页。+- PDF 页范围使用 `1-5,8,r3-r1`,`r1` 表示最后一页,`all` 表示全部;非 PDF 原生文档整本解析。+- `-o` 的文件/目录含义依入口而异。`mineru-kit parse` 单文件默认 Markdown;目录或多文件输入输出到目录。+- 旧结果中的 `_backend`、`pdf_info` 等字段不能作为 4.0 文档结构模板。按[当前输出协议](output_files.md)读取实际 JSON;历史产物只在明确支持的兼容读取路径中使用,不承诺所有旧 JSON 可直接传给 `ParseResult.from_dict()`。++## 配置与模型++配置使用 `$MINERU_HOME/config.yaml`,可由 `MINERU_CONFIG` 指定;旧 `mineru.json` 配置不再读取。`model.stack`、`MINERU_MODEL_STACK` 和 `--stack` 已移除,改为独立配置:++```yaml+model:+ source: auto+ base_dir: ~/.mineru/models+ small_backend: auto+ vlm:+ engine: auto+```++默认按平台选择后端。显式 `onnx + llama-cpp` 可用于较轻的运行环境;Torch 与 VLM 引擎也可自由组合,但必须满足对应依赖。Apple Silicon 默认 VLM 是 llama.cpp;MLX 需要手动安装和选择。++变更配置后重启相关服务,并使用相同后端执行模型下载和验证。4.0 使用独立的小模型包,不能仅凭旧模型目录存在就认定已准备完成,详见[模型源说明](../usage/model_source.md)。++## API 与 WebUI++V1 API 使用 `/v1/health`、`/v1/tiers`、`/v1/uploads`、`/v1/parse/jobs` 和 `/v1/files`;旧 `/file_parse`、`/tasks` 不再提供。SDK 客户端和 WebUI 必须连接 V1 服务。文档解析 API 与 OpenAI 兼容 VLM 服务是不同接口,地址不可互换。++原 Gradio 客户端也需按新版事件接口调整,不能仅替换命令名称。第三方插件的旧适配文档保留历史说明,不表示已支持 V1 API。++迁移验证:先转换一个原生文档,再转换一份带文本层的 PDF;检查页数、Markdown、结构化 JSON 和素材。然后在实际目标硬件上验证所需质量档位和 API 调用。见[SDK 与 API](../usage/sdk_api.md)。diff --git a/docs/zh/reference/output_files.md b/docs/zh/reference/output_files.mdindex d4e598bd..09ae4b32 100644--- a/docs/zh/reference/output_files.md+++ b/docs/zh/reference/output_files.md@@ -1,470 +1,138 @@-# MinerU 输出文件说明--## 概览--`mineru` 命令执行后,除了输出主要的 markdown 文件外,还会生成多个辅助文件用于调试、质检和进一步处理。这些文件包括:--具体会生成哪些文件,取决于后端类型和输入文档类型。--- **可视化调试文件**:帮助用户直观了解文档解析过程和结果-- **结构化数据文件**:包含详细的解析数据,可用于二次开发-- 多模态 markdown 输出中,`image` / `chart` 默认以截图为主;若块内存在 `content`,会在图片后追加一个默认折叠的 HTML `<details>` 内容块,其中折叠标题优先使用块的 `sub_type`,否则回退为 `image content` 或 `chart content`--下面将详细介绍每个文件的作用和格式。--## 可视化调试文件--### 布局分析文件 (layout.pdf)--**文件命名格式**:`{原文件名}_layout.pdf`--**功能说明**:--- 可视化展示每一页的布局分析结果-- 每个检测框右上角的数字表示阅读顺序-- 使用不同背景色块区分不同类型的内容块--**使用场景**:--- 检查布局分析是否正确-- 确认阅读顺序是否合理-- 调试布局相关问题----## 结构化数据文件--> [!IMPORTANT]-> 当前结构化输出合约使用统一的 `MinerUParser`,通过 `tier`(flash/basic/standard/advanced)和 `parse_mode`(txt/ocr)参数控制。旧 middle-json 中标记 `_backend: "pipeline"`/`_backend: "hybrid"`/`_backend: "office"` 的产物不再被当前读取逻辑兼容,请使用 schema 2.0 的 `MiddleJson`。--### 统一模型输出结果--#### 模型推理结果 (model.json)--**文件命名格式**:`{原文件名}_model.json`--##### 示例数据--```json-[- {- “cls_id”: 12,- “label”: “header”,- “score”: 0.93,- “bbox”: [- 1217,- 104,- 1516,- 134- ],- “index”: 2- },- {- “cls_id”: 6,- “label”: “doc_title”,- “score”: 0.9751,- “bbox”: [- 275,- 181,- 1512,- 292- ],- “index”: 3- },- {- “cls_id”: 22,- “label”: “text”,- “score”: 0.9217,- “bbox”: [- 275,- 330,- 524,- 370- ],- “index”: 4- }-]+# 输出格式与结果协议++4.0 使用统一文档模型。区分“渲染器能生成什么”与“当前 CLI/API 暴露什么”,不要将渲染层的能力直接当作某个产品入口的参数。++## 入口支持范围++| 入口 | 输出 |+| --- | --- |+| `mineru parse` | Markdown;`--json` 为含状态、内容、定位和继续阅读信息的命令响应 |+| `mineru read` | Markdown 或 `--format image`;只读取已缓存内容 |+| `mineru-kit parse` | `markdown`、`middle_json`、`zip` |+| 自部署 V1 API | `markdown`、`middle_json`、`structured_content`、`zip`;以服务能力为准 |+| `ParseResult` | `markdown()`、`structured_content()`、`to_dict()`、`to_json()`、`save(writer)` |+| `mineru.render.render()` | 下列九种目标格式 |++`mineru parse --json` 的响应不是 MiddleJson,不能直接传给 `ParseResult.from_dict()`。远端服务的产物范围由该服务声明。++## 九种渲染目标++| `RenderFormat` | 格式 | Python 返回类型 |+| --- | --- | --- |+| `MARKDOWN` | Markdown | `str` |+| `HTML` | HTML | `str` |+| `LATEX` | LaTeX | `str` |+| `DOCX` | Word | `bytes` |+| `EPUB` | EPUB | `bytes` |+| `PDF` | 语义重排版 PDF | `bytes` |+| `STRUCTURED_CONTENT` | 通用结构化内容 | `dict` |+| `CONTENT_LIST` | Content List V1 | `list[dict]` |+| `CONTENT_LIST_V2` | 按页组织的 Content List V2 | `list[list[dict]]` |++PDF 渲染是语义重排版,不是原 PDF 版式的逐像素复刻,也不是布局调试 PDF。++```python+from pathlib import Path+from mineru.parser import parse+from mineru.render import render, RenderFormat++result = parse("report.docx", tier="flash")+html = render(result.middle_json, RenderFormat.HTML)+Path("report.html").write_text(html, encoding="utf-8")```-#### 中间处理结果 (middle.json)--**文件命名格式**:`{原文件名}_middle.json`+## 中间 JSON-##### 顶层结构(schema 2.0)+`ModelJson` 保存分析结果 `pages` 和 `page_index_map`;`MiddleJson` 保存后处理后的有序页面和语义块。`schema_id` 区分 `docvortex.model` 与 `docvortex.middle`,`schema_version` 标识协议版本。不要只根据版本数字判断文档种类。-| 字段名 | 类型 | 说明 |-|--------|------|------|-| `pages` | `list[PageInfo]` | 每一页的解析结果数组,按 `page_idx` 严格升序 |-| `is_full_document` | `bool` | 是否整本文档解析(`page_index_map` 为空时为 `True`) |-| `file_suffix` | `string` | 输入文件类型:`pdf`、`doc`、`docx`、`ppt`、`pptx`、`xls`、`xlsx`、`rtf`、`csv`、`epub`、`html`、`odt`、`ods` 或 `odp` |-| `effort` | `string` | 分析强度:`flash`、`medium`、`high` 或 `xhigh` |-| `parse_mode` | `string` | 解析模式:`txt` 或 `ocr` |-| `mineru_version` | `string` | MinerU 版本号 |+`metadata` 包含文件类型、生产者和文档属性;`extensions["mineru"]` 记录实际执行的 `tier` 与最终 `parse_mode`。版本来自 `metadata.producer.version`,不重复放在产品扩展中。页面包含 `page_idx` 与 `blocks`,`page_idx` 从 0 开始,区别于 CLI 中从 1 开始的 PDF 页码。-schema 2.0 已移除旧字段 `pdf_info`/`_backend`/`_version_name`/`_ocr_enable`/`_vlm_ocr_enable`。--##### 页面信息结构 (pages)--| 字段名 | 说明 |-|--------|------|-| `page_idx` | 页码,从 0 开始 |-| `blocks` | 顶层页面块列表(唯一内容字段) |--schema 2.0 已移除旧字段 `preproc_blocks`/`para_blocks`/`page_size`/`images`/`tables`/`interline_equations`/`discarded_blocks`/`_layout_tree`/`layout_bboxes`——所有内容统一在 `blocks` 树里表达。--##### 块结构层次--```-顶层页面块 (text | title | equation | image | table | chart | code | list | index | ...)-└── 视觉父块 (image | table | chart | code) 包含子块- └── body 块 + 可选 caption/footnote 块-```--叶子块(text、title、equation 等)直接持有 `content: str`。视觉父块(image、table、chart、code)持有 `content: list[子块]`,子块包含唯一 body 加可选 caption/footnote。schema 2.0 不再有独立的 `Line`/`Span` 类型。--##### 通用块字段--| 字段名 | 说明 |-|--------|------|-| `type` | 块类型(详见下表) |-| `bbox` | 块的矩形框坐标 `[x0, y0, x1, y1]`,归一化到 `[0, 1]` |-| `index` | 块的阅读序号(顶层块必填) |-| `content` | 叶子块为字符串;视觉父块为子块列表 |--##### 块类型--| 类型 | 说明 |-|------|------|-| `text` | 文本块(叶子块,`content: str`) |-| `doc_title` | 文档标题(level=1) |-| `paragraph_title` | 段落标题(level 2-6) |-| `equation` | 行间公式块(由 `interline_equation` 重命名) |-| `image` | 图片容器;`content` 包含 `image_body` + 可选 `image_caption`/`image_footnote` |-| `table` | 表格容器;`content` 包含 `table_body` + 可选 `table_caption`/`table_footnote` |-| `chart` | 图表容器;`content` 包含 `chart_body` + 可选 `chart_caption`/`chart_footnote` |-| `code` | 代码容器;`content` 包含 `code_body` + 可选 `code_caption`/`code_footnote`;`sub_type` 为 `code` 或 `algorithm` |-| `list` | 列表容器;`content` 为 `text`/`ref_text`/嵌套 `list` 块列表;`sub_type` 为 `text` 或 `ref_text` |-| `index` | 目录容器;`content` 为 `text`/`doc_title`/`paragraph_title`/嵌套 `index` 块列表 |-| `ref_text` | 参考文献文本块;EPUB 脚注不使用该类型 |-| `header` / `footer` / `page_number` / `aside_text` | 页面辅助块(叶子块,`content: str`);不接受 `anchor` |-| `page_footnote` | 独立页面脚注块(叶子块,`content: str`);可带 document-wide `anchor`,DEFAULT 渲染也保留 |--##### 示例数据(schema 2.0)+以下示例由当前公开类型序列化生成,`4.0.0` 是正式版文档的示意生产者版本;可选字段可被省略,实际输出为准:```json{- “pages”: [+ "metadata": {+ "file_suffix": "html",+ "producer": {+ "name": "mineru",+ "version": "4.0.0"+ }+ },+ "extensions": {+ "mineru": {+ "tier": "flash",+ "parse_mode": "txt"+ }+ },+ "pages": [+ {+ "page_idx": 0,+ "blocks": [{- “page_idx”: 0,- “blocks”: [- {- “type”: “doc_title”,- “index”: 0,- “bbox”: [0.45, 0.23, 0.55, 0.28],- “content”: “1 Introduction”,- “level”: 1- },- {- “type”: “text”,- “index”: 1,- “bbox”: [0.08, 0.30, 0.46, 0.40],- “content”: “dependent on the service headway and the reliability of the departure”- },- {- “type”: “image”,- “index”: 2,- “bbox”: [0.52, 0.30, 0.95, 0.55],- “content”: [- {- “type”: “image_body”,- “index”: 2,- “bbox”: [0.52, 0.30, 0.95, 0.55],- “content”: “”,- “image_path”: “images/page_0_image_body_2.png”- },- {- “type”: “image_caption”,- “index”: 3,- “bbox”: [0.52, 0.56, 0.95, 0.58],- “content”: “Figure 1: Example figure”- }- ],- “sub_type”: null- }- ]+ "type": "text",+ "index": 0,+ "content": [+ {+ "type": "text",+ "content": "Hello MinerU"+ }+ ]}- ],- “file_suffix”: “pdf”,- “effort”: “high”,- “parse_mode”: “ocr”,- “mineru_version”: “1.x.x”+ ]+ }+ ],+ "is_full_document": true,+ "schema": "docvortex.middle",+ "schema_version": "2.0"}```-#### 内容列表 (content_list.json)--> [!NOTE]-> `content_list.json` 已废弃,不再生成。结构化内容输出请使用 `structured_content.json`,详见下文”通用结构化内容”章节。--### 通用结构化内容 (structured_content.json)(开发中,格式可能调整)--**文件命名格式**:`{原文件名}_structured_content.json`--##### 功能说明--`structured_content.json` 是 3.0 起新增的结构化输出文件,所有后端都会输出该文件:--- 顶层是按页分组的列表,便于按页消费结果-- 每个内容块使用统一的 `type + content` 结构,适合程序化处理-- 不同后端和输入类型支持的 `type` 会有所不同+可以通过 `ParseResult.from_json(result.to_json())` 往返读取当前结果。旧版 `_backend`、`pdf_info`、`_version_name` 不属于此协议;历史数据兼容见[迁移指南](migration_4.md),不要手工改一个版本号就当作格式已迁移。-##### 通用字段+## Structured Content-| 字段名 | 类型 | 说明 |-|--------|------|------|-| `type` | `string` | 内容类型 |-| `content` | `dict` | 与 `type` 对应的结构化内容 |-| `bbox` | `list[int]` | 可选,0-1000 范围的边界框 |-| `anchor` | `string` | 可选,标题与 `page_footnote` 的 document-wide 目标;目录叶子和行内链接可以引用 |--其中 `image` / `chart` 类型还可能包含可选顶层字段 `sub_type`,用于表示视觉子类型。--##### 常见类型--| 类型 | 说明 |-|------|------|-| `title` | 标题块,包含 `title_content` 与 `level` |-| `paragraph` | 段落块,包含 `paragraph_content` |-| `equation_interline` | 行间公式,包含 `math_content`、`math_type` |-| `image` / `table` / `chart` | 视觉类块,包含图片路径、说明文字等结构化字段;印章使用 `sub_type: "seal"` 的 `image` 表示 |-| `code` | 代码块,包含 `code_content`、`code_caption`、`code_footnote`、`code_language` |-| `algorithm` | 算法块,包含 `algorithm_content`、`algorithm_caption`、`algorithm_footnote` |-| `list` / `index` | 列表与索引,包含 `list_items` |-| `page_header` / `page_footer` / `page_number` / `page_aside_text` | 页面辅助块 |-| `page_footnote` | 独立页面脚注内容 |--`title_content`、`paragraph_content`、说明文字等行内内容通常由 span 列表组成。-`hyperlink` span 包含 `content`、`url`,当同一个链接内存在多段不同样式文本时,-还会包含 `children`;此时 `content` 是 children 文本的拼接,精确样式以-`children` 中的 `text` span 为准。--##### 示例数据--```json-[- [- {- "type": "title",- "content": {- "title_content": [- {- "type": "text",- "content": "1 Introduction"- }- ],- "level": 1- },- "bbox": [- 83,- 121,- 917,- 156- ]- },- {- "type": "page_footnote",- "content": {- "page_footnote_content": [- {- "type": "text",- "content": "* Corresponding author"- }- ]- },- "bbox": [- 71,- 815,- 915,- 841- ]- }- ]-]-```--### 多模态模型输出结果--#### 模型推理结果 (model.json)--**文件命名格式**:`{原文件名}_model.json`--##### 文件格式说明--- 该文件为多模态模型的原始输出结果,包含两层嵌套list,外层表示页面,内层表示该页的内容块-- 每个内容块都是一个dict,包含 `type`、`bbox`、`angle`、`content` 字段---##### 支持的内容类型+`structured_content()` 返回面向消费端的内容结构,而非中间协议的另一个名称。它保留 `metadata` 和 `extensions`,将自然语言 span 转为更易消费的文本;不要为它补造 `schema_id` 或 `schema_version`。```json{- “text”: “文本”,- “title”: “标题”,- “equation”: “行间公式”,- “image”: “图片”,- “image_caption”: “图片描述”,- “image_footnote”: “图片脚注”,- “table”: “表格”,- “table_caption”: “表格描述”,- “table_footnote”: “表格脚注”,- “phonetic”: “拼音”,- “code”: “代码块”,- “code_caption”: “代码描述”,- “ref_text”: “参考文献”,- “algorithm”: “算法块”,- “list”: “列表”,- “header”: “页眉”,- “footer”: “页脚”,- “page_number”: “页码”,- “aside_text”: “装订线旁注”,- “page_footnote”: “页面脚注”-}-```--##### 坐标系统说明--`bbox` 坐标格式:`[x0, y0, x1, y1]`--- 分别表示左上、右下两点的坐标-- 坐标原点在页面左上角-- 坐标为相对于原始页面尺寸的百分比,范围在0-1之间--##### 示例数据--```json-[- [- {- “type”: “header”,- “bbox”: [- 0.077,- 0.095,- 0.18,- 0.181- ],- “angle”: 0,- “score”: null,- “block_tags”: null,- “content”: “ELSEVIER”,- “format”: null,- “content_tags”: null- },+ "pages": [+ {+ "page_idx": 0,+ "blocks": [{- “type”: “title”,- “bbox”: [- 0.157,- 0.228,- 0.833,- 0.253- ],- “angle”: 0,- “score”: null,- “block_tags”: null,- “content”: “The response of flow duration curves to afforestation”,- “format”: null,- “content_tags”: null+ "type": "text",+ "content": "Hello MinerU"}- ]-]-```--#### 中间处理结果 (middle.json)--**文件命名格式**:`{原文件名}_middle.json`--##### 文件格式说明--在 schema 2.0 中,多模态 tier 与其他 tier 产出相同的统一 `MiddleJson` 结构。以下块类型是标准 `blocks` 树的一部分(不再是扩展):--- list 是容器块,`content` 持有子 `text`/`ref_text`/嵌套 `list` 块,`sub_type` 区分 list 类型:- * `text`(文本类型)- * `ref_text`(引用类型)--- code 是容器块,`content` 持有 `code_body` 加可选 `code_caption`/`code_footnote`,`sub_type` 为:- * `code`- * `algorithm`--- 页面辅助块(`header`、`footer`、`page_number`、`aside_text`)和独立的 `page_footnote` 块都作为顶层叶子出现在 `blocks` 中,`content: str`——schema 2.0 不再有独立的 `discarded_blocks` 字段;只有 `page_footnote` 可以额外携带 document-wide `anchor`,且 DEFAULT 渲染也会保留。-- 所有 block 可能包含 `angle` 字段,用来表示旋转角度,0,90,180,270---##### 示例数据-- list block 示例- ```json- {- “type”: “list”,- “bbox”: [0.068, 0.121, 0.319, 0.260],- “index”: 11,- “content”: [- {- “type”: “text”,- “bbox”: [0.068, 0.123, 0.122, 0.137],- “index”: 3,- “content”: “H.1 Introduction”- },- {- “type”: “text”,- “bbox”: [0.068, 0.142, 0.181, 0.179],- “index”: 4,- “content”: “H.2 Example: Divide by Zero without Exception Handling”- }- ],- “sub_type”: “text”+ ]}- ```-- code block 示例- ```json- {- “type”: “code”,- “bbox”: [0.045, 0.610, 0.346, 0.964],- “index”: 17,- “content”: [- {- “type”: “code_body”,- “bbox”: [0.045, 0.610, 0.346, 0.964],- “index”: 17,- “content”: “1 // Fig. H.1: DivideByZeroNoExceptionHandling.java \n2 // Integer division without exception handling. \n3 import java.util.Scanner; \n4 \n5 public class DivideByZeroNoExceptionHandling \n6 { \n7 // demonstrates throwing an exception when a divide-by-zero occurs \n8 public static int quotient( int numerator, int denominator ) \n9 { \n10 return numerator / denominator; // possible division by zero \n11 } // end method quotient \n12 \n13 public static void main(String[] args) \n14 { \n15 Scanner scanner = new Scanner(System.in); // scanner for input \n16 \n17 System.out.print(\”Please enter an integer numerator: \”); \n18 int numerator = scanner.nextInt(); \n19 System.out.print(\”Please enter an integer denominator: \”); \n20 int denominator = scanner.nextInt(); \n21”- },- {- “type”: “code_caption”,- “bbox”: [0.339, 0.125, 0.500, 0.148],- “index”: 19,- “content”: “Algorithm 1 Modules for MCTSteg”- }- ],- “sub_type”: “code”,- “guess_lang”: “java”+ ],+ "metadata": {+ "file_suffix": "html",+ "producer": {+ "name": "mineru",+ "version": "4.0.0"+ }+ },+ "extensions": {+ "mineru": {+ "tier": "flash",+ "parse_mode": "txt"}- ```+ },+ "is_full_document": true+}+```-#### 内容列表 (content_list.json)+## 文件保存、ZIP 与素材-> [!NOTE]-> `content_list.json` 已废弃,不再生成。结构化内容输出请使用 `structured_content.json`,其通用结构见上文”通用结构化内容”章节。+`ParseResult.save(writer)` 写出 `markdown.md`、`middle_json.json`、`structured_content.json`;有原始模型结果时还写出 `model_output.json`。`mineru-kit parse --format zip` 打包这一组结果。-## 总结+```python+from mineru.parser.writer import FileBasedDataWriter-以上文件为 MinerU 的完整输出结果,用户可根据需要选择合适的文件进行后续处理:+result.save(FileBasedDataWriter("output"))+```-- **模型输出**(使用原始输出):- * model.json+素材可能以内嵌数据或图片路径表示,取决于来源与输出入口。PDF 的 `ParseResult.to_dict()` 会省略块中的 `image_base64`;只保存中间 JSON 不等于保存了所有外部素材。消费 API 结果时按产物引用下载并保留对应素材,不能依赖已关闭的 PDF 对象或原文件继续渲染。-- **调试和验证**(使用可视化文件):- * layout.pdf--- **内容提取**(使用简化文件):- * *.md- * structured_content.json--- **二次开发**(使用结构化文件):- * middle.json+WebUI 显示的布局 PDF 是调试产物,可用时用于预览检测结果;不可用时使用原始/裁页 PDF 预览。它与上述 `RenderFormat.PDF` 是不同用途。diff --git a/docs/zh/usage/acceleration_cards/AMD.md b/docs/zh/usage/acceleration_cards/AMD.mdindex 6ab58978..4f4341bb 100644--- a/docs/zh/usage/acceleration_cards/AMD.md+++ b/docs/zh/usage/acceleration_cards/AMD.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 基于Triton的ROCm 不同后端实现优化,基本实现vllm后端正常推理,以及pipeline后端中第一步layout用的DocLayout-YOLO**已有完整python vllm和mineru环境直接跳转第五步!!!**@@ -9,7 +14,7 @@Two Step Extraction: 100%|████████████████████████████████████████| 200/200 [01:40<00:00, 1.99it/s]**下面为之前14学术论文测试结果:**-7900xtx 使用 `mineru-kit gradio --server-name 0.0.0.0 --server-port 7860 --api-server-tier standard` 时速度大概为**1.6-1.8s/it**,没有仔细测试,简单试了两个文档。第二种矩阵乘法代替原来的dots点乘可以进一步提速到1.3s/it,优化后的主要算子耗时在hipblast(这个没法提升了)和vllm triton后端,各占25%耗时吧,vllm tirion后端这个这个只能等官方优化了。。。。+7900xtx 使用 `mineru-gradio --server-name 0.0.0.0 --server-port 7860 --enable-vllm-engine true` 时速度大概为**1.6-1.8s/it**,没有仔细测试,简单试了两个文档。第二种矩阵乘法代替原来的dots点乘可以进一步提速到1.3s/it,优化后的主要算子耗时在hipblast(这个没法提升了)和vllm triton后端,各占25%耗时吧,vllm tirion后端这个这个只能等官方优化了。。。。doclayout-yolo的layout速度从原来的1.6it/s提高到15it/s,注意需要缓存一下输入的pdf尺寸后,triton必须要缓存尺寸没办法。主要是为了保留模型输入输出接口,最小代码改动。采用-b vlm-vllm-engine模式举个例子@@ -21,8 +26,8 @@ Processed prompts: 100%|██████████████████Adding requests: 100%|█████████████████████████████████████████████████████████████████████████████| 278/278 [00:00<00:00, 323.03it/s]Processed prompts: 100%|██████████████████| 278/278 [00:07<00:00, 37.63it/s, est. speed input: 5264.66 toks/s, output: 2733.31 toks/s]-`mineru-kit gradio --server-name 0.0.0.0 --server-port 7860 --api-server-tier standard` 测试:-2025-10-05 15:46:55.953 | WARNING | mineru.cli_old.common:convert_pdf_bytes_to_bytes_by_pypdfium2:54 - end_page_id is out of range, use pdf_docs length+`mineru-gradio --server-name 0.0.0.0 --server-port 7860 --enable-vllm-engine true` 测试:+2025-10-05 15:46:55.953 | WARNING | mineru.cli.common:convert_pdf_bytes_to_bytes_by_pypdfium2:54 - end_page_id is out of range, use pdf_docs lengthTwo Step Extraction: 100%|████████████████████████████████████████████████████████████████████████████| 14/14 [00:18<00:00, 1.30s/it]---@@ -53,7 +58,7 @@ source .venv/bin/activateuv pip install --pre torch torchvision -i https://pypi.tuna.tsinghua.edu.cn/simple/ --extra-index-url https://download.pytorch.org/whl/nightly/rocm7.0uv pip install pip# 避免覆盖我们本地的pytorch,改用pip而没有继续使用uv pip-pip install -U "mineru[core]" -i https://pypi.mirrors.ustc.edu.cn/simple/+pip install -U "mineru[core]<4" -i https://pypi.mirrors.ustc.edu.cn/simple/```vllm 安装参考官方手册[Vllm](https://docs.vllm.com.cn/en/latest/getting_started/installation/gpu.html#amd-rocm)```@@ -335,7 +340,7 @@ def triton_conv3d_patchify(x_5d: torch.Tensor, weight_5d: torch.Tensor) -> torchreturn C```----**4.关闭终端后再次使用 `mineru-kit gradio` 会报一个 Lora 错误,修改代码跳过它**+**4.关闭终端后再次使用 `mineru-gradio` 会报一个 Lora 错误,修改代码跳过它**```pip show mineru_vl_utils```diff --git a/docs/zh/usage/acceleration_cards/Ascend.md b/docs/zh/usage/acceleration_cards/Ascend.mdindex f27e7143..0cf43e49 100644--- a/docs/zh/usage/acceleration_cards/Ascend.md+++ b/docs/zh/usage/acceleration_cards/Ascend.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -126,7 +131,7 @@ docker run -u root --name mineru_docker --privileged=true \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td><td>🟢</td>@@ -142,7 +147,7 @@ docker run -u root --name mineru_docker --privileged=true \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td><td>🟢</td>diff --git a/docs/zh/usage/acceleration_cards/Biren.md b/docs/zh/usage/acceleration_cards/Biren.mdindex 329686d2..73e4179b 100644--- a/docs/zh/usage/acceleration_cards/Biren.md+++ b/docs/zh/usage/acceleration_cards/Biren.md@@ -1,3 +1,14 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。++使用厂商预制镜像时,先在容器内检查版本;本仓库的版本上限不会改变已构建镜像的内容:++```bash+python -c "from importlib.metadata import version; from packaging.specifiers import SpecifierSet; v = version('mineru'); print(v); assert v in SpecifierSet('<4'), 'Use the vendor image for MinerU <4'"+```+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -65,7 +76,7 @@ docker run -it --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td></tr>@@ -78,7 +89,7 @@ docker run -it --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td></tr>diff --git a/docs/zh/usage/acceleration_cards/Cambricon.md b/docs/zh/usage/acceleration_cards/Cambricon.mdindex 3586a2ad..622312ec 100644--- a/docs/zh/usage/acceleration_cards/Cambricon.md+++ b/docs/zh/usage/acceleration_cards/Cambricon.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -105,7 +110,7 @@ docker run --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td><td>🟢</td>@@ -121,7 +126,7 @@ docker run --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td><td>🟢</td>diff --git a/docs/zh/usage/acceleration_cards/Enflame.md b/docs/zh/usage/acceleration_cards/Enflame.mdindex 751c48ee..e27d5d37 100644--- a/docs/zh/usage/acceleration_cards/Enflame.md+++ b/docs/zh/usage/acceleration_cards/Enflame.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -63,7 +68,7 @@ docker run -u root --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td></tr>@@ -76,7 +81,7 @@ docker run -u root --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td></tr>diff --git a/docs/zh/usage/acceleration_cards/Hygon.md b/docs/zh/usage/acceleration_cards/Hygon.mdindex 5b33986f..244af91f 100644--- a/docs/zh/usage/acceleration_cards/Hygon.md+++ b/docs/zh/usage/acceleration_cards/Hygon.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -70,7 +75,7 @@ docker run -u root --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td></tr>@@ -83,7 +88,7 @@ docker run -u root --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td></tr>diff --git a/docs/zh/usage/acceleration_cards/IluvatarCorex.md b/docs/zh/usage/acceleration_cards/IluvatarCorex.mdindex fb6aa46f..c5aeb565 100644--- a/docs/zh/usage/acceleration_cards/IluvatarCorex.md+++ b/docs/zh/usage/acceleration_cards/IluvatarCorex.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -77,7 +82,7 @@ docker run --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td></tr>@@ -90,7 +95,7 @@ docker run --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td></tr>diff --git a/docs/zh/usage/acceleration_cards/Kunlunxin.md b/docs/zh/usage/acceleration_cards/Kunlunxin.mdindex 4fa0ae40..23c0c16f 100644--- a/docs/zh/usage/acceleration_cards/Kunlunxin.md+++ b/docs/zh/usage/acceleration_cards/Kunlunxin.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -76,7 +81,7 @@ docker run -u root --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td></tr>@@ -89,7 +94,7 @@ docker run -u root --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td></tr>diff --git a/docs/zh/usage/acceleration_cards/METAX.md b/docs/zh/usage/acceleration_cards/METAX.mdindex 73c54ce3..9ff29786 100644--- a/docs/zh/usage/acceleration_cards/METAX.md+++ b/docs/zh/usage/acceleration_cards/METAX.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -98,7 +103,7 @@ docker run --ipc host \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td><td>🟢</td>@@ -114,7 +119,7 @@ docker run --ipc host \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td><td>🟢</td>diff --git a/docs/zh/usage/acceleration_cards/MooreThreads.md b/docs/zh/usage/acceleration_cards/MooreThreads.mdindex f629c3a4..649e381a 100644--- a/docs/zh/usage/acceleration_cards/MooreThreads.md+++ b/docs/zh/usage/acceleration_cards/MooreThreads.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -71,7 +76,7 @@ docker run -u root --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td></tr>@@ -84,7 +89,7 @@ docker run -u root --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td></tr>diff --git a/docs/zh/usage/acceleration_cards/THead.md b/docs/zh/usage/acceleration_cards/THead.mdindex 7acacf09..70fa7b99 100644--- a/docs/zh/usage/acceleration_cards/THead.md+++ b/docs/zh/usage/acceleration_cards/THead.md@@ -1,3 +1,8 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -89,7 +94,7 @@ docker run --privileged=true \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td><td>🟢</td>@@ -105,7 +110,7 @@ docker run --privileged=true \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td><td>🟢</td>diff --git a/docs/zh/usage/acceleration_cards/Tecorigin.md b/docs/zh/usage/acceleration_cards/Tecorigin.mdindex af0e2591..3b0f7002 100644--- a/docs/zh/usage/acceleration_cards/Tecorigin.md+++ b/docs/zh/usage/acceleration_cards/Tecorigin.md@@ -1,3 +1,14 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。++使用厂商预制镜像时,先在容器内检查版本;本仓库的版本上限不会改变已构建镜像的内容:++```bash+python -c "from importlib.metadata import version; from packaging.specifiers import SpecifierSet; v = version('mineru'); print(v); assert v in SpecifierSet('<4'), 'Use the vendor image for MinerU <4'"+```+## 1. 测试平台以下为本指南测试使用的平台信息,供参考:```@@ -73,7 +84,7 @@ docker run -dit --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="3">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🟢</td></tr>@@ -86,7 +97,7 @@ docker run -dit --name mineru_docker \<td>🟢</td></tr><tr>- <td rowspan="3">gradio界面(mineru-kit gradio)</td>+ <td rowspan="3">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🟢</td></tr>diff --git a/docs/zh/usage/acceleration_cards/VastAI.md b/docs/zh/usage/acceleration_cards/VastAI.mdindex a2f2aa7e..badeefa8 100644--- a/docs/zh/usage/acceleration_cards/VastAI.md+++ b/docs/zh/usage/acceleration_cards/VastAI.md@@ -1,3 +1,14 @@+> [!NOTE]+> **旧版适配,仅适用于 MinerU <4。** 本页保留原平台依赖、模型和命令;4.0 不沿用此适配保证。+> 安装或升级时必须保留 `mineru<4`;已有固定版本、提交或厂商镜像继续按原方案使用,不要替换为 4.0 的安装命令。+> 通用说明见[旧平台版本约束](../compatibility.md)。++使用厂商预制镜像时,先在容器内检查版本;本仓库的版本上限不会改变已构建镜像的内容:++```bash+python -c "from importlib.metadata import version; from packaging.specifiers import SpecifierSet; v = version('mineru'); print(v); assert v in SpecifierSet('<4'), 'Use the vendor image for MinerU <4'"+```+## 1. 瀚博半导体@@ -41,7 +52,7 @@- 安装MinerU- - 参考官方文档安装:[README_zh.md#安装-mineru](https://github.com/opendatalab/MinerU/blob/master/README_zh.md#安装-mineru)+ - 参考官方文档安装:[README_zh.md#安装-mineru](https://github.com/opendatalab/MinerU/blob/mineru-2.7.0-released/README_zh-CN.md#安装-mineru)```bash# 启动容器@@ -56,8 +67,9 @@# 通过源码安装MinerUgit clone https://github.com/opendatalab/MinerU.git+ cd MinerUgit checkout 8c4b3ef3a20b11ddac9903f25124d24ea82639b5- pip install -e .[core] -i https://mirrors.aliyun.com/pypi/simple+ pip install -e ".[core]" "mineru<4" -i https://mirrors.aliyun.com/pypi/simple# 或使用pip安装MinerUpip install -U "mineru[core]==2.7.0" -i https://mirrors.aliyun.com/pypi/simple@@ -81,7 +93,7 @@- 使用MinerU- - 模型准备,参考官方介绍:[model_source.md](https://github.com/opendatalab/MinerU/blob/master/docs/zh/usage/model_source.md)+ - 模型准备,参考官方介绍:[model_source.md](https://github.com/opendatalab/MinerU/blob/mineru-2.7.0-released/docs/zh/usage/model_source.md)- 方式一:`vlm-engine`@@ -159,7 +171,7 @@<td>🟢</td></tr><tr>- <td rowspan="5">FastAPI 服务(mineru-kit api-server)</td>+ <td rowspan="5">FastAPI 服务(mineru-api)</td><td>pipeline</td><td>🔴</td></tr>@@ -180,7 +192,7 @@<td>🟢</td></tr><tr>- <td rowspan="5">gradio界面(mineru-kit gradio)</td>+ <td rowspan="5">gradio界面(mineru-gradio)</td><td>pipeline</td><td>🔴</td></tr>diff --git a/docs/zh/usage/advanced_cli_parameters.md b/docs/zh/usage/advanced_cli_parameters.mdindex 7730bd1a..d32b83f5 100644--- a/docs/zh/usage/advanced_cli_parameters.md+++ b/docs/zh/usage/advanced_cli_parameters.md@@ -15,7 +15,7 @@> [!TIP]> - 任何情况下,您都可以通过在命令行的开头添加`CUDA_VISIBLE_DEVICES` 环境变量来指定可见的 GPU 设备:> ```bash-> CUDA_VISIBLE_DEVICES=1 mineru -p <input_path> -o <output_path>+> CUDA_VISIBLE_DEVICES=1 mineru-kit parse <input_path> -o <output_path>> ```> - 这种指定方式适用于下文明确说明的模型服务与解析命令,不适用于 `mineru-router`。@@ -53,5 +53,5 @@>> - 如果您有多张显卡,需要通过`router`在其中4张卡上启动`fastapi`服务并统一管理,可以使用以下命令:> ```bash-> CUDA_VISIBLE_DEVICES=0,1,2,3 mineru-kit router --host 127.0.0.1 --port 8002+> mineru-kit router --host 127.0.0.1 --port 8002 --local-gpus 0,1,2,3> ```diff --git a/docs/zh/usage/cli_tools.md b/docs/zh/usage/cli_tools.mdindex a93d44f9..c97dc9a0 100644--- a/docs/zh/usage/cli_tools.md+++ b/docs/zh/usage/cli_tools.md@@ -46,10 +46,10 @@ mineru-kit api-server --host 127.0.0.1 --port 8000 --tier standard### Gradio WebUI```bash-mineru-kit gradio --server-name 127.0.0.1 --server-port 7860+mineru-kit webui --server-name 127.0.0.1 --server-port 7860```-未传 `--api-url` 时,Gradio 会托管 loopback `mineru-kit api-server`;传入后只连接指定的 V1 服务。`mineru-gradio` 保留为命令名兼容别名,接受相同的新版参数,不恢复旧 Gradio 参数或 HTTP 路由。+未传 `--api-url` 时,Gradio 会托管 loopback `mineru-kit api-server`;传入后只连接指定的 V1 服务。`mineru-webui` 保留为命令名兼容别名,接受相同的新版参数,不恢复旧 Gradio 参数或 HTTP 路由。### Router 与 VLM Server@@ -82,4 +82,4 @@ mineru-kit vlm-server --engine auto --port 30000省略页码时 `mineru parse` 默认前 10 页,`mineru-kit parse`、Python 和 Gradio 默认全部。新请求使用新规范;历史正整数半角 `~` 结果可直接读取,无需重建 Doclib 缓存。结果返回值和新缓存使用 `-`,全角 `~` 及负号倒数页码不受支持。-完整说明见 [页码规范与历史结果兼容](../../next/page-ranges.md)。+档位与默认选择见[档位与运行环境](tiers.md),升级注意事项见[迁移指南](../reference/migration_4.md)。diff --git a/docs/zh/usage/compatibility.md b/docs/zh/usage/compatibility.mdnew file mode 100644index 00000000..101d3deb--- /dev/null+++ b/docs/zh/usage/compatibility.md@@ -0,0 +1,40 @@+# 旧平台适配(MinerU <4)++以下 13 个平台保留已有适配方案,**仅适用于 MinerU <4**。主线 4.0 的依赖、模型和命令变更不自动扩展这些平台的兼容范围。++9 个专用 Dockerfile 的 MinerU 依赖为原 extras 与 `>=3.4.0,<4`。例如:++```bash+python -m pip install "mineru[core]>=3.4.0,<4"+```++此命令仅说明版本约束;实际部署应按各平台 Dockerfile 保留厂商 Torch、引擎和补丁,不能在厂商镜像内盲目执行通用全量升级。已有 `==2.7.0` 或固定提交等更严格约束继续保留。源码安装必须选择原指南中的固定提交或相应旧版标签,不跟随默认分支。++## 平台指南++- [昇腾 / Ascend](acceleration_cards/Ascend.md)+- [平头哥 / THead](acceleration_cards/THead.md)+- [沐曦 / METAX](acceleration_cards/METAX.md)+- [海光 / Hygon](acceleration_cards/Hygon.md)+- [燧原 / Enflame](acceleration_cards/Enflame.md)+- [摩尔线程 / MooreThreads](acceleration_cards/MooreThreads.md)+- [天数智芯 / IluvatarCorex](acceleration_cards/IluvatarCorex.md)+- [寒武纪 / Cambricon](acceleration_cards/Cambricon.md)+- [昆仑芯 / Kunlunxin](acceleration_cards/Kunlunxin.md)+- [太初元碁 / Tecorigin](acceleration_cards/Tecorigin.md)+- [壁仞 / Biren](acceleration_cards/Biren.md)+- [AMD](acceleration_cards/AMD.md)+- [瀚博 / VastAI](acceleration_cards/VastAI.md)++## 旧版入口与资料++这些适配使用 `mineru -p`、`mineru-api`、`mineru-gradio` 和 `mineru-models-download`,不使用 4.0 的 `mineru-kit`。旧版参考:++- [3.4.5 installation](https://github.com/opendatalab/MinerU/blob/mineru-3.4.5-released/docs/zh/quick_start/index.md)+- [3.4.5 model configuration](https://github.com/opendatalab/MinerU/blob/mineru-3.4.5-released/docs/zh/usage/model_source.md)++厂商预制镜像的内容由厂商控制,仓库内 `<4` 约束不会修改已有镜像。部署前在容器中检查:++```bash+python -c "from importlib.metadata import version; from packaging.specifiers import SpecifierSet; v = version('mineru'); print(v); assert v in SpecifierSet('<4'), 'Use the vendor image for MinerU <4'"+```diff --git a/docs/zh/usage/index.md b/docs/zh/usage/index.mdindex a4db9749..ea2c546a 100644--- a/docs/zh/usage/index.md+++ b/docs/zh/usage/index.md@@ -3,26 +3,17 @@本章节提供了项目的完整使用说明。我们将通过以下几个部分,帮助您从基础到进阶逐步掌握项目的使用方法:## 目录++- [档位与运行环境](tiers.md)+- [Python SDK 与 V1 API](sdk_api.md)+- [3.x → 4.0 迁移](../reference/migration_4.md)- 本地部署* [基础使用](./quick_usage.md) - 快速上手和基本使用* [模型源配置](./model_source.md) - 模型源的详细配置说明* [命令行工具](./cli_tools.md) - 命令行工具的详细参数说明* [命令行进阶参数](./advanced_cli_parameters.md) - 一些适配命令行工具的进阶参数说明-- 其他加速卡适配(🚀官方支持/❤️社区贡献)- * [昇腾 Ascend](acceleration_cards/Ascend.md) 🚀- * [平头哥 T-Head](acceleration_cards/THead.md) 🚀- * [沐曦 METAX](acceleration_cards/METAX.md) 🚀- * [海光 Hygon](acceleration_cards/Hygon.md) 🚀- * [燧原 Enflame](acceleration_cards/Enflame.md) 🚀- * [摩尔线程 MooreThreads](acceleration_cards/MooreThreads.md) 🚀- * [天数智芯 IluvatarCorex](acceleration_cards/IluvatarCorex.md) 🚀- * [寒武纪 Cambricon](acceleration_cards/Cambricon.md) 🚀- * [昆仑芯 Kunlunxin](acceleration_cards/Kunlunxin.md) 🚀- * [太初元碁 Tecorigin](acceleration_cards/Tecorigin.md) ❤️- * [壁仞 Biren](acceleration_cards/Biren.md) ❤️- * [AMD #3662](https://github.com/opendatalab/MinerU/discussions/3662) ❤️- * [瀚博 VastAI #4237](https://github.com/opendatalab/MinerU/discussions/4237) ❤️-- 插件与生态+- [旧平台适配(MinerU <4)](compatibility.md) - AMD 与国产卡保留原适配+- 插件与生态(保留原集成说明,不代表已支持 4.0 V1 API)* [Cherry Studio](plugin/Cherry_Studio.md)* [Sider](plugin/Sider.md)* [Dify](plugin/Dify.md)diff --git a/docs/zh/usage/model_source.md b/docs/zh/usage/model_source.mdindex acfcdbdb..5f0cf652 100644--- a/docs/zh/usage/model_source.md+++ b/docs/zh/usage/model_source.md@@ -1,66 +1,76 @@-# 模型源说明+# 模型下载与配置-MinerU使用 `HuggingFace` 和 `ModelScope` 作为模型仓库,用户可以根据需要切换模型源或使用本地模型。+MinerU 4.0 独立配置小模型后端和 VLM 引擎。配置文件默认位于 `$MINERU_HOME/config.yaml`(`MINERU_HOME` 默认 `~/.mineru`),可通过 `MINERU_CONFIG` 指定其他文件。-- `auto` 是默认的模型源策略,会优先探测 HuggingFace 是否可访问;可访问时使用 `HuggingFace`,不可访问时自动回退到 `ModelScope`。-- `HuggingFace` 在全球范围内提供了优异的加载速度和极高稳定性。-- `ModelScope` 是中国大陆地区用户的最佳选择,提供了无缝兼容的SDK模块,适用于无法访问`HuggingFace`的用户。--使用 `HuggingFace` 下载模型时,MinerU 默认通过 `hf_xet` 加速传输。如果当前网络或代理无法访问 Xet CAS,设置-`HF_HUB_DISABLE_XET=1` 可回退到普通 HTTP 下载。--```powershell-$env:HF_HUB_DISABLE_XET = "1"-mineru-kit models download --tier standard --source huggingface+```yaml+model:+ source: auto+ base_dir: ~/.mineru/models+ small_backend: auto+ vlm:+ engine: auto```-## 模型源的切换方法+## 模型源++`model.source` 支持 `auto`、`huggingface`、`modelscope`、`local`。`auto` 优先探测 Hugging Face,不可访问时选择 ModelScope;来自默认值或配置文件的自动选择可写回配置。环境变量优先于文件配置:-### 通过环境变量切换-MinerU 通过 `MINERU_MODEL_SOURCE` 环境变量配置模型源,这适用于所有命令行工具和 API 调用。支持的取值为 `auto`、`huggingface`、`modelscope` 和 `local`,环境变量优先级高于 `config.yaml` 中的 `model.source`。```bashexport MINERU_MODEL_SOURCE=modelscope-mineru -p <input_path> -o <output_path>+mineru-kit parse document.pdf -o document.md --tier standard```-或在代码中设置:-```python-import os-os.environ["MINERU_MODEL_SOURCE"] = "modelscope"-```->[!TIP]-> MinerU 已不再提供用于切换模型源的命令行参数。通过环境变量设置的模型源会在当前终端会话中生效,直到终端关闭或环境变量被修改。-### 通过配置文件切换-如果未设置 `MINERU_MODEL_SOURCE`,MinerU 会读取 `config.yaml` 中的 `model.source` 字段。`model.source` 支持 `auto`、`huggingface`、`modelscope` 和 `local`。当值为 `auto` 或字段缺失时,会先自动探测实际来源;如果该值来自配置文件或内置默认值,首次自动探测完成后会将 `model.source` 写回为 `huggingface` 或 `modelscope`,避免后续启动时因网络波动反复切换来源。-```yaml-model:- source: auto- base_dir: ~/.mineru/models+Windows PowerShell:++```powershell+$env:MINERU_MODEL_SOURCE = "modelscope"```+小模型包 `MinerU-4_models_torch` 和 `MinerU-4_models_onnx` 在 Hugging Face 与 ModelScope 均已登记;VLM 原始权重与 llama.cpp 的 GGUF/mmproj 使用不同模型仓库,由所选引擎决定。Basic 需要对应小模型包,Standard 还需要 VLM 模型,并同时支持 Advanced 请求。-## 使用本地模型+## 下载、检查和离线使用++按当前配置下载并验证 Standard 部署模型:-### 1. 下载模型到本地```bash-mineru-kit models download --help+mineru-kit models download --tier standard --source modelscope+mineru-kit models verify --tier standard+mineru-kit models show```-或下载全部内置模型包:++CPU 小模型和 llama.cpp 的显式组合:++```bash+mineru-kit models download --tier standard --small-backend onnx --vlm-engine llama-cpp --source huggingface+mineru-kit models verify --tier standard --small-backend onnx --vlm-engine llama-cpp+```++NVIDIA / vLLM 部署可以在无 GPU 的构建机下载目标模型;下载时必须显式指定目标后端,不能依赖构建机自动选择:+```bash-mineru-kit models download --tier standard+mineru-kit models download --tier standard --small-backend torch --vlm-engine vllm --source modelscope+mineru-kit models verify --tier standard --small-backend torch --vlm-engine vllm```-> [!NOTE]->- 模型会下载到 `config.model.base_dir` 下,默认路径为 `~/.mineru/models`。->- `mineru-kit models download` 不会把模型路径写入 `mineru.json`。->- 如需自定义模型目录,请先在 `config.yaml` 中设置 `model.base_dir`,再执行下载。->- 如需更新模型文件,可以再次运行 `mineru-kit models download --tier standard`;在同一个 `model.base_dir` 下,provider SDK 会尽量复用已有文件做增量更新。->- `mineru-kit models download` 必须使用远端模型源执行真实下载;如果当前配置为 `model.source: local`,该命令会仅在本次执行中临时按 `auto` 处理。->- MinerU 会在整仓下载完成后于仓库根目录写入空白 `.mineru_complete`;按指定路径下载时,则分别标记已完成的模型目录。旧版本或中断下载留下但没有相应 marker 的目录,会在使用前通过 provider 增量下载确认;当 `model.source: local` 时,这类目录会报告为未 ready,而不会访问网络。-### 2. 使用本地模型进行解析+这些命令选项只覆盖本次操作,不修改持久配置。运行解析前使用相同组合,例如:-通过环境变量启用本地模型:```bash+export MINERU_MODEL_SMALL_BACKEND=torch+export MINERU_MODEL_VLM_ENGINE=vllmexport MINERU_MODEL_SOURCE=local-mineru -p <input_path> -o <output_path>+mineru-kit parse document.pdf -o document.md --tier standard```++只需 Basic 时将下载档位改为 `basic`;Advanced 不使用独立下载档位。`model.base_dir` 控制模型根目录,下载前设置;完成标记和必需文件共同决定模型是否就绪。重复下载会利用 provider 缓存;不应手动创建完成标记。++`local` 模式只使用就绪的本地模型,缺失时报错,不自动下载。显式执行 `models download` 是下载操作,即使配置为 `local`,该命令也会临时采用自动远端模型源。++## VLM 服务与手动 MLX++`model.vlm.server_url` 配置已有 VLM 服务时,优先使用该服务,不要求本地 VLM 权重;它是模型推理接口,不是 MinerU V1 文档解析 API。小模型依赖仍由所选档位决定。++MLX 需手动安装 `mlx-vlm>=0.7.0,<0.8.0` 并显式设置 `model.vlm.engine: mlx`。`model.stack`、`MINERU_MODEL_STACK` 和 `--stack` 已移除。修改配置后重启相关服务。++## 下载问题++Hugging Face 默认使用 `hf_xet`。如果网络无法访问 Xet CAS,可在下载前设置 `HF_HUB_DISABLE_XET=1` 使用普通 HTTP;也可切换 ModelScope。离线部署先完成下载和验证,再设置 `local`。更多安装组合见[扩展模块](../quick_start/extension_modules.md)。diff --git a/docs/zh/usage/quick_usage.md b/docs/zh/usage/quick_usage.mdindex 3ac22415..e18a13c4 100644--- a/docs/zh/usage/quick_usage.md+++ b/docs/zh/usage/quick_usage.md@@ -1,7 +1,7 @@# 使用 MinerU## 快速配置模型源-MinerU默认使用`huggingface`作为模型源,若用户网络无法访问`huggingface`,可以通过环境变量便捷地切换模型源为`modelscope`:+MinerU 默认使用 `auto` 模型源策略,优先探测 Hugging Face,不可访问时选择 ModelScope,若用户网络无法访问`huggingface`,可以通过环境变量便捷地切换模型源为`modelscope`:```bashexport MINERU_MODEL_SOURCE=modelscope```@@ -25,6 +25,18 @@ mineru parse <input_path> --pages all -o <output_path>如果需要通过自定义参数调整解析选项,您也可以在文档中查看更详细的[命令行工具使用说明](./cli_tools.md)。+## 文档库、搜索与继续阅读++`mineru` 使用本地文档库保存文件身份、解析缓存和索引。解析后的响应带有 locator;按真实返回值替换下例中的文档 ID:++```bash+mineru parse document.pdf --json+mineru search "关键词" --json+mineru read "doc:ab12cd3/tier:standard/page:11" --json+```++超过输出预算时按 `next_request` 或返回的继续阅读命令操作。`read` 读取已有结果,不会自动发起新的高质量解析。无状态批处理和完整导出使用 `mineru-kit parse`;原生 Office、HTML、CSV/TSV、EPUB、OFD 自动归一到本地 Flash。+## 通过 API、WebUI 和服务进阶使用- 启动自部署 V1 API:@@ -34,18 +46,18 @@ mineru parse <input_path> --pages all -o <output_path>>[!TIP]>在浏览器中访问 `http://127.0.0.1:8000/docs` 查看 OpenAPI 文档。服务只提供 `/v1/*` 接口,包括健康检查、能力发现、上传、文件、解析任务和用量查询。>- >原生文档解析示例:[DocVortex Python 示例](https://github.com/myhloli/docvortex/blob/main/demo/demo.py)+ >原生文档解析示例:[Python SDK 与 V1 API](sdk_api.md)- 启动gradio webui 可视化前端:```bash- mineru-kit gradio --server-name 0.0.0.0 --server-port 7860+ mineru-kit webui --server-name 0.0.0.0 --server-port 7860```>[!TIP]>>- 在浏览器中访问 `http://127.0.0.1:7860` 使用 Gradio WebUI。>- 未传 `--api-url` 时,Gradio 会托管 loopback `mineru-kit api-server`;传入后只连接指定的 V1 服务。>- 使用 `--api-server-preload-models` 为托管的本地服务预加载模型。- >- `mineru-gradio` 仍作为命令名兼容别名,使用相同的新版参数。+ >- `mineru-webui` 仍作为命令名兼容别名,使用相同的新版参数。- 通过 `mineru-router` 进行多服务 / 多 GPU 编排:```bash@@ -102,7 +114,9 @@ MinerU 可开箱即用,并从 `$MINERU_HOME/config.yaml` 读取当前配置;model:base_dir: ~/.mineru/modelssource: auto- stack: auto+ small_backend: auto+ vlm:+ engine: auto```模型下载和本地模型源的详细说明见[模型源说明](./model_source.md)。@@ -114,4 +128,4 @@ model:省略页码时 `mineru parse` 默认前 10 页,`mineru-kit parse`、Python 和 Gradio 默认全部。新请求使用新规范;历史正整数半角 `~` 结果可直接读取,无需重建 Doclib 缓存。结果返回值和新缓存使用 `-`,全角 `~` 及负号倒数页码不受支持。-完整说明见 [页码规范与历史结果兼容](../../next/page-ranges.md)。+档位与默认选择见[档位与运行环境](tiers.md),升级注意事项见[迁移指南](../reference/migration_4.md)。diff --git a/docs/zh/usage/sdk_api.md b/docs/zh/usage/sdk_api.mdnew file mode 100644index 00000000..52113c16--- /dev/null+++ b/docs/zh/usage/sdk_api.md@@ -0,0 +1,86 @@+# Python SDK 与 V1 API++## 本地 Python SDK++`mineru.parser` 提供无状态的 `parse`、`parse_async`、`MinerUParser` 和统一的 `ParseResult`,不会建立文档库。PDF 页范围默认全部,`page_range="1-3"` 使用从 1 开始的页码。++```python+from pathlib import Path+from mineru.parser import parse, ParseResult++result = parse("document.pdf", tier="flash", ocr_mode="txt", page_range="1-3")+Path("document.md").write_text(result.markdown(), encoding="utf-8")+Path("document.json").write_text(result.to_json(), encoding="utf-8")+restored = ParseResult.from_json(result.to_json())+assert restored.to_dict() == result.to_dict()+```++原生文档调用 `parse("report.docx", tier="flash")`;不传 PDF 专用页范围。PDF/图片的高质量解析可使用 `tier="standard"` 或 `tier="advanced"`,需要准备对应运行环境和模型。++异步入口接受同样的解析选项:++```python+import asyncio+from mineru.parser import parse_async++result = asyncio.run(parse_async("report.docx", tier="flash"))+print(result.markdown())+```++在已有事件循环中直接 `await parse_async(...)`。异步接口不保证所有引擎采用相同的执行机制。++## 连接自部署 V1 API++先在服务环境启动:++```bash+mineru-kit api-server --host 127.0.0.1 --port 8000 --tier standard+```++Python 客户端负责能力发现、文件提交、任务轮询和结果下载:++```python+from mineru.parser import MinerUApiParser++parser = MinerUApiParser(+ api_url="http://127.0.0.1:8000",+ api_key="",+ tier="standard",+ include_images=True,+)+result = parser.parse("document.pdf", page_range="1-3")+print(result.markdown())+```++`api_url` 是 `/v1` 之前的服务根地址。API Key 从配置或环境读取时,使用 `MINERU_API_KEY`;不要把密钥写入源码。连接其他机器意味着文件可能上传到该服务。WebUI 可连接同一地址:++```bash+mineru-kit webui --api-url http://127.0.0.1:8000+```++## HTTP 工作流++先通过健康检查和档位发现获取实际能力:++```bash+curl http://127.0.0.1:8000/v1/health+curl http://127.0.0.1:8000/v1/tiers+```++1. `POST /v1/uploads` 创建上传,根据响应的 URL、HTTP 方法和请求头上传文件;需要时调用 `/v1/uploads/{id}/complete`,取得 `file.id`。已完成的去重上传可直接取得文件引用。+2. `POST /v1/parse/jobs` 提交任务,例如下方 JSON。+3. `GET /v1/parse/jobs/{job_id}` 轮询。`completed`、`partial`、`failed`、`canceled` 都是终态;逐文件检查错误,不能将部分成功当作全部完成。+4. 按任务响应中的产物引用调用 `GET /v1/files/{file_id}/content` 下载结果。++```json+{+ "files": [{"source": {"type": "file_id", "file_id": "file-id-from-upload"}, "page_range": "1-3"}],+ "tier": "standard",+ "ocr_mode": "auto",+ "output_formats": ["markdown", "middle_json", "structured_content", "zip"]+}+```++非 PDF 文件省略 `page_range`。当前自部署服务提供上例四种产物;以服务能力和 `/docs` 的 OpenAPI 为准,不能由渲染层的格式列表推断 API 支持范围。++4.0 V1 服务不提供旧 `/file_parse` 和 `/tasks` 路由。既有客户端迁移见[迁移指南](../reference/migration_4.md),Python 渲染与结果保存见[输出格式](../reference/output_files.md)。diff --git a/docs/zh/usage/tiers.md b/docs/zh/usage/tiers.mdnew file mode 100644index 00000000..de1e3d08--- /dev/null+++ b/docs/zh/usage/tiers.md@@ -0,0 +1,48 @@+# 档位与运行环境++档位表达解析质量和成本;小模型后端与 VLM 引擎是独立配置,不是档位名称。++| 档位 | 主要用途 | 本地执行 |+| --- | --- | --- |+| `flash` | 快速预览、索引、原生文档解析 | 原生 PDF 文本 / 文档解析;扫描 PDF 与图片使用 Flash OCR |+| `basic` | 基础 OCR、公式和表格解析 | ONNX 或 Torch 小模型,不需要本地 VLM |+| `standard` | 复杂版面与高质量解析 | 小模型 + VLM |+| `advanced` | 更高质量需求 | 与 Standard 共用模型与运行环境,投入更多推理计算 |++PDF 和图片可选四档。Office、OpenDocument、RTF、EPUB、OFD、HTML、CSV/TSV 固定走本地 Flash,整本解析;Python 本地 SDK 调用这些格式时显式传 `tier="flash"`。纯文本不进入解析,但可由文档库索引和读取。++## 默认选择++- `mineru-kit parse` 和本地 Python `parse()` 的 PDF 默认档位为 Standard。+- 文档库发现服务能力后,PDF/图片默认优先 Standard,其次 Basic;不可用时报 `quality_tier_unavailable`,不会静默降为 Flash 或上传到官网。+- Advanced 需要显式选择;本地托管服务按 Standard 准备模型和启动能力,不单独下载 Advanced 模型。+- 文档库 `read` 读取已有缓存,不发起新解析;未指定档位时优先已有的 Advanced、Standard、Basic 结果。++## 后端与引擎++| 环境 | 自动选择的小模型 | 自动选择的 VLM |+| --- | --- | --- |+| Apple Silicon / MPS | Torch / MPS | llama.cpp |+| Linux / Windows,基础包 | ONNX / CPU(没有可用 Torch 加速环境时) | llama.cpp |+| Linux,有加速器并安装 `full` | Torch | vLLM;否则尝试已安装的 LMDeploy |+| Windows,有加速器并安装 `full` | Torch | LMDeploy |+| CPU 环境 | ONNX / CPU | llama.cpp |++自动选择依据已安装依赖和可用设备;显式指定的后端缺依赖时会报错,不会静默改用另一种。ONNX 小模型在 CPU 上执行,VLM 的设备选择独立。++```yaml+model:+ small_backend: auto+ vlm:+ engine: auto+```++`small_backend` 可选 `auto/onnx/torch`;`engine` 可选 `auto/llama-cpp/vllm/lmdeploy/mlx`。macOS 不自动选择 MLX,需手动安装并显式配置。++## 资源与平台边界++原生文本解析不需要推理模型。Basic 可在 CPU 运行;Standard / Advanced 的速度和内存占用取决于 VLM 引擎、输入规模和并发。高吞吐本地部署建议至少 16 GB 系统内存;NVIDIA 部署还需要所选引擎支持的显卡、驱动和足够可用显存,8 GB 仅作为规划起点,不是所有任务的保证。++Apple Silicon 建议使用至少 16 GB 统一内存并直接在 macOS 安装。既有 AMD 和国产卡适配继续使用 [MinerU <4](compatibility.md),不属于本文的 4.0 平台兼容承诺。++安装组合见[扩展模块](../quick_start/extension_modules.md),下载与配置见[模型源](model_source.md)。diff --git a/mkdocs.yml b/mkdocs.ymlindex 082e459a..570499f5 100644--- a/mkdocs.yml+++ b/mkdocs.yml@@ -84,11 +84,15 @@ nav:- Usage:- Usage: usage/index.md- Quick Usage: usage/quick_usage.md+ - Tiers and Runtimes: usage/tiers.md+ - Python SDK and V1 API: usage/sdk_api.md+ - Legacy Platforms (MinerU <4): usage/compatibility.md- Model Source: usage/model_source.md- CLI Tools: usage/cli_tools.md- Advanced CLI Parameters: usage/advanced_cli_parameters.md- Reference:- Reference: reference/index.md+ - Migration to 4.0: reference/migration_4.md- Output File Format: reference/output_files.md- Changelog: reference/changelog.md- FAQ:@@ -102,11 +106,15 @@ nav:- Usage:- Usage: usage/index.md- Quick Usage: usage/quick_usage.md+ - Tiers and Runtimes: usage/tiers.md+ - Python SDK and V1 API: usage/sdk_api.md+ - Legacy Platforms (MinerU <4): usage/compatibility.md- Model Source: usage/model_source.md- CLI Tools: usage/cli_tools.md- Advanced CLI Parameters: usage/advanced_cli_parameters.md- Reference:- Reference: reference/index.md+ - Migration to 4.0: reference/migration_4.md- Output File Format: reference/output_files.md- Changelog: reference/changelog.md- FAQ:@@ -138,6 +146,10 @@ plugins:Usage: 使用指南Quick Usage: 基础使用CLI Tools: 命令行工具+ Tiers and Runtimes: 档位与运行环境+ Python SDK and V1 API: Python SDK 与 V1 API+ Legacy Platforms (MinerU <4): 旧平台适配(MinerU <4)+ Migration to 4.0: 迁移到 4.0Model Source: 模型源配置Advanced CLI Parameters: 命令行进阶参数FAQ: 常见问题解答diff --git a/skills/mineru/SKILL.md b/skills/mineru/SKILL.mdindex b2e2a359..719fd36f 100644--- a/skills/mineru/SKILL.md+++ b/skills/mineru/SKILL.md@@ -11,9 +11,9 @@ MinerU is not a RAG framework, vector database, or chat-with-doc application.This skill mainly uses the `mineru` command.-## Pre-release Status+## Version Scope-The current MinerU release line is in Beta pre-release. Package installers normally prefer stable releases, so explicitly enable pre-release resolution whenever installing or upgrading MinerU from a package index. The installation commands in this skill already include the required installer-specific options.+This skill targets MinerU `>=4.0,<5` stable. Existing AMD and vendor adaptations remain on `<4`; use their version-specific guides rather than upgrading them with these commands.## When To Use MinerU@@ -47,8 +47,8 @@ Use MinerU for local document files such as:| OpenDocument | `.odt`, `.ods`, `.odp` || EPUB | `.epub`, parsed as a full document in OPF spine order with source internal links preserved || OFD | `.ofd` |-| HTML | `.html`, `.htm` |-| CSV | `.csv` |+| HTML | `.html`, `.htm`, `.shtml` |+| CSV / TSV | `.csv`, `.tsv` |PDF and images support every quality tier (`flash`, `basic`, `standard`, `advanced`). Office, HTML, CSV, EPUB, and OFD files are parsed locally at the `flash` tier. Plain-text files (`.txt`, `.md`, `.markdown`, `.rst`, `.tex`) are not parsed; read them directly.@@ -119,7 +119,7 @@ mineru read "doc:ab12cd3/tier:standard/page:18" --json## Installation And Setup-This skill requires MinerU `>=4.0.0b1`. Before using any workflow, check whether the CLI is installed:+This skill requires MinerU `>=4.0,<5`. Before using any workflow, check whether the CLI is installed:```bashcommand -v mineru@@ -133,7 +133,7 @@ mineru version --jsonIf `mineru version --json` fails, try `mineru --version` for older CLIs. If the detected version does not meet this requirement, tell the user which version was found and ask before upgrading it. If approved, upgrade with the same installer and environment, then check the version again. If declined, stop and do not run this skill's commands. Never assume compatibility when the version cannot be determined.-MinerU requires Python `>=3.10,<3.14`.+MinerU requires Python `>=3.10,<3.15`. Optional engines also need compatible wheels, drivers, and devices; the package range alone does not guarantee engine availability.### Upgrade An Existing Installation@@ -146,12 +146,12 @@ mineru server stopmineru server status --json```-Use the matching upgrade command only after the user approves the upgrade:+Use the matching upgrade command only after the user approves the upgrade. Preserve any extras and tool options already used by that installation (for example, keep `[full]` when reinstalling with pipx):```bash-uv tool upgrade --prerelease allow mineru-pipx upgrade mineru --pip-args="--pre"-"<environment-python>" -m pip install --upgrade --pre mineru+uv tool upgrade "mineru>=4.0,<5"+pipx install --force "mineru>=4.0,<5"+"<environment-python>" -m pip install --upgrade "mineru>=4.0,<5"```If the owner cannot be determined, multiple installations exist, or MinerU is installed from source or in editable mode, ask the user instead of upgrading. After upgrading, check the resolved executable and its version again.@@ -167,6 +167,7 @@ If no supported interpreter is available, install Python 3.12 with `uv` as a concommand -v uvuv python find 3.12uv python find 3.13+uv python find 3.14uv python find 3.11uv python find 3.10```@@ -180,7 +181,7 @@ uv python install 3.12Then install MinerU with the supported interpreter that was found, or with Python 3.12 if it was installed as the fallback:```bash-uv tool install --python 3.12 --prerelease allow mineru+uv tool install --python 3.12 "mineru>=4.0,<5"```### Install with `pipx`@@ -194,24 +195,24 @@ PIPX_DEFAULT_PYTHON="$(pipx environment --value PIPX_DEFAULT_PYTHON)""$PIPX_DEFAULT_PYTHON" --version```-Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.10,<3.14`, install with `pipx`:+Check the `PIPX_DEFAULT_PYTHON` path reported by `pipx`. If that interpreter satisfies `>=3.10,<3.15`, install with `pipx`:```bash-pipx install --pip-args="--pre" mineru+pipx install "mineru>=4.0,<5"```-If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.10,<3.14`.+If `PIPX_DEFAULT_PYTHON` is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. `python3.12` is an example; use any interpreter that satisfies `>=3.10,<3.15`.```bashcommand -v python3.12python3.12 --version-pipx install --python python3.12 --pip-args="--pre" mineru+pipx install --python python3.12 "mineru>=4.0,<5"```If no supported system interpreter is available and `pipx` supports Python fetching, ask for approval before downloading a standalone Python:```bash-pipx install --python 3.12 --fetch-python=missing --pip-args="--pre" mineru+pipx install --python 3.12 --fetch-python=missing "mineru>=4.0,<5"```### Install with global `pip`@@ -219,19 +220,19 @@ pipx install --python 3.12 --fetch-python=missing --pip-args="--pre" mineruIf neither `uv` nor `pipx` is available, but `pip` or `pip3` is available, check the Python version of the `pip` command, and ask the user before installing into the global python environment:```bash-which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 # find all available pips+which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pipspip --version```-If a `pip` command reports Python `>=3.10,<3.14`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:+If a `pip` command reports Python `>=3.10,<3.15`, and the user confirms, install with the exact supported `pip` command that was verified. Replace `pip` below with the verified pip command if needed:```bash-pip install --pre mineru+pip install "mineru>=4.0,<5"```### If No Supported Installer Is Available-If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.10,<3.14`, recommend that the user install `uv` first.+If `uv`, `pipx`, `pip`, and `pip3` are all unavailable, or none of them can install with Python `>=3.10,<3.15`, recommend that the user install `uv` first.### After Installation@@ -265,9 +266,7 @@ MinerU may collect anonymous, locally aggregated usage and diagnostic telemetryTelemetry does not collect document contents, extracted text or images, file names, file paths, search queries, prompts, snippets, API keys, usernames, hostnames, raw tracebacks, or exact hardware identifiers.-Telemetry starts in an unset consent state. In this state MinerU may keep local aggregate data but will not upload it. Users can enable or disable telemetry explicitly; disabling telemetry stops new telemetry aggregation and removes unsent local telemetry data.--During the current beta prerelease, the unset state may also upload locally aggregated metrics. The existing interactive prompt and explicit enable/disable commands remain unchanged. This temporary behavior will be reverted for the stable release.+Users can inspect telemetry status and explicitly enable or disable it. To prevent telemetry uploads, disable it explicitly; disabling also stops new aggregation and removes unsent local telemetry data. Check the running version and status rather than inferring consent from installation.Do not prompt for telemetry consent in agent or non-interactive contexts. If the user asks about telemetry, use:@@ -318,48 +317,62 @@ mineru parse "paper.pdf" --tier advancedmineru parse "paper.pdf" --tier flash```-## Model Stacks+## Model Backends-MinerU use neural network models for local `basic`, `standard`, and `advanced` parsing.-To better support different hardwares, MinerU provide two model stacks: `light` and `full`.+Small models and the VLM engine are configured independently. Gradio is included in the base package.+The `torch` extra installs the small-model Torch dependencies; `full` also installs vLLM on Linux or+LMDeploy on Windows. ARM macOS installs the Torch dependencies by default. No MinerU extra installs MLX-VLM.-| Stack | Model engines | Install |+| Environment (automatic selection) | Small models | VLM ||---|---|---|-| `light` | ONNX + llama.cpp | Already in `mineru` base module |-| `full` | PyTorch + vLLM/lmdeploy/mlx | Requires `mineru[full]` extra |--Stack controls resource use and download size:--| Tier | Stack | Model download | RAM (min) | Accelerator |-|---|---|---|---|---|-| `basic` | `light` | ~0.8 GB | 4 GB | None (CPU works) |-| `basic` | `full` | ~2 GB | 16 GB | GPU/MPS recommended |-| `standard` / `advanced` | `light` | ~2 GB | 8 GB | CPU works, Vulkan recommended |-| `standard` / `advanced` | `full` | ~4 GB | 16 GB | GPU/MPS required, 8 GB+ VRAM |+| ARM macOS with MPS, base or full | Torch / MPS | llama.cpp |+| Linux / Windows, base | ONNX / CPU | llama.cpp |+| Linux with accelerator and full | Torch | vLLM, then LMDeploy if available |+| Windows with accelerator and full | Torch | LMDeploy |+| Linux / Windows with accelerator and torch extra only | Torch | llama.cpp |+| No available accelerator, including Intel Mac CPU | ONNX / CPU | llama.cpp |-The default setting is `auto`: CPU uses `light`, while GPU, MPS, and other accelerators with `mineru[full]` installed use `full`.-To select a stack explicitly for the current environment, set:+Automatic selection uses installed dependencies and available devices, not installation history.+Explicit backend choices are independent and do not silently fall back when dependencies are missing.```bash-export MINERU_MODEL_STACK=light # or full, or auto+export MINERU_MODEL_SMALL_BACKEND=auto # auto, onnx, torch+export MINERU_MODEL_VLM_ENGINE=auto # auto, llama-cpp, vllm, lmdeploy, mlx```-To persist the selection, set it in `config.yaml`:+Equivalent `config.yaml`:```yamlmodel:- stack: light+ small_backend: auto+ vlm:+ engine: auto```-Stop and restart the MinerU server after changing the stack because running processes do not reload startup configuration.--Download and verify models for a specific stack:+`model.stack`, `MINERU_MODEL_STACK`, and `--stack` have been removed and report migration errors.+Replace the old light configuration with `onnx` + `llama-cpp`; replace full with `torch` and the desired+VLM engine, or use `auto` for platform defaults. Restart running services after changing configuration.+An explicit `model.vlm.server_url` takes priority and removes local VLM dependency and weight requirements.+MLX remains available through explicit configuration after manually installing `mlx-vlm>=0.7.0,<0.8.0`.```bash-mineru-kit models download --tier <tier> --stack <stack>-mineru-kit models verify --tier <tier> --stack <stack>+mineru-kit models download --tier standard --small-backend torch --vlm-engine llama-cpp --source huggingface+mineru-kit models verify --tier standard --small-backend torch --vlm-engine llama-cpp```+Model command options only override the current command. Explicit downloads do not require the target+engine to be installed. A basic deployment needs the selected small-model bundle; standard also needs+GGUF + mmproj for llama.cpp or the original VLM weights for other local engines, and supports advanced requests.++Small models use `MinerU-4_models_torch` or `MinerU-4_models_onnx`, with PP-DocLayoutV2, PP-OCRv6 Tiny Det ++Small Rec, PP-FormulaNet plus-M, seal OCR and shared table models. ONNX Runtime remains a base dependency+because some table models also use ONNX in the Torch backend. All ONNX sessions run on CPU; VLM devices+are selected independently.++The small-model bundles support both Hugging Face and ModelScope. Use `model.source: auto`, select either+provider explicitly, or select `local` after downloading and verifying the matching models. See+[model downloads and configuration](https://opendatalab.github.io/MinerU/usage/model_source/).+## Server RulesMost `mineru` commands use the local MinerU background service. If a command fails with `server_not_running`, start it:@@ -406,41 +419,34 @@ Use available read-only system commands to inspect the OS, architecture, total m- Windows PowerShell: `(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory`, `Get-CimInstance Win32_Processor`, and `nvidia-smi` when available.- Other accelerators: use an already-installed vendor tool if available; do not install software merely to inspect hardware.-### Choose Local Stack--The `light` stack is suitable for most hardwares, including CPU-only machines, Apple Silicon, and low-end iGPU/GPU machines.--Install and use `full` stack only when you have enough RAM and powerful GPU/accelerator, accept extra installation disk space, and want a higher throughput. Hardware requirements:-- At least 16 GB total memory.-- A Volta-or-newer NVIDIA GPU with at least 8 GB available VRAM, or an `npu`, `gcu`, `musa`, `mlu`, or `sdaa` accelerator.-- Consumes ~5GB more disk space.+### Choose Local Backends-To use the `full` stack, install the `mineru[full]` extra.+The base package supplies ONNX small models and llama.cpp; Apple Silicon also installs Torch.+For Torch small models, use `mineru[torch]>=4.0,<5`. For higher-throughput serving, `mineru[full]>=4.0,<5`+adds vLLM on Linux or LMDeploy on Windows. Configure small models and the VLM independently as described above.+Do not use `model.stack` or `--stack`. Existing vendor accelerator guides stay on MinerU <4.-The following examples assume the current install tool is `uv tool`. If `mineru` was installed with another tool or environment, use the equivalent command for that actual tool/environment.--Installing extras with `uv tool install --force --prerelease allow` can replace the active `mineru` environment. Stop the MinerU server first, confirm `running=false`, and start it again after installing dependencies.+The following example assumes the actual installation is managed by `uv tool`; otherwise use the owning installer.+Preserve the current tool options and chosen extras. Stop services before replacing the environment:```bashmineru server stopmineru server status --json-uv tool install --force --prerelease allow "mineru[full]"+uv tool install --force "mineru[full]>=4.0,<5"mineru server startmineru server status --json```### Choose Local Tier-Managed local parsing has two startup tiers: `basic` and `standard`. A Standard server provides `basic`, `standard`, and `advanced` request tiers. Advanced uses the same Standard dependencies, model set, and hardware setup; it differs only by spending more inference compute when the request selects `--tier advanced`.--- `basic` tier with `light` stack, requires at least 4GB total memory.-- `standard` tier with `light` stack, requires at least 8GB total memory, recommended for GPU/Metal.-- `basic` tier with `full` stack, recommended for `npu`, `gcu`, `musa`, `mlu`, or `sdaa`.-- `standard` tier with `full` stack, recommended for high-end nvidia GPU.+Managed local parsing has two startup tiers: `basic` and `standard`. Standard capacity also serves Advanced requests.+Advanced shares Standard models and runtime but spends more inference compute. Basic can run with CPU small models.+For higher-throughput local quality parsing, plan for at least 16 GB system or unified memory and an engine-supported+accelerator with sufficient free memory. Exact requirements depend on documents, engine, and concurrency.### Recommend and Ask-After hardware was inspected, you already know the suitable stack and tier for current machine. Before asking the user to choose a tier/stack, summarize the detected hardware and identify each tier's hardware status.+After hardware was inspected, you already know the suitable backends and tier for current machine. Before asking the user to choose a tier/backends, summarize the detected hardware and identify each tier's hardware status.You should recommend a tier for user when the machine meets such requirements, otherwise offer remote `standard` when privacy rules allow, or use explicit `flash`.@@ -452,8 +458,8 @@ First, download the models for the target startup tier (`basic`, or `standard`).Replace `<tier>` with `basic` or `standard`.```bash-mineru-kit models download --tier <tier> --stack <stack>-mineru-kit models verify --tier <tier> --stack <stack>+mineru-kit models download --tier <tier> --small-backend <onnx|torch> --vlm-engine <llama-cpp|vllm|lmdeploy|mlx>+mineru-kit models verify --tier <tier> --small-backend <onnx|torch> --vlm-engine <llama-cpp|vllm|lmdeploy|mlx>```Then, enable managed local parse server for the startup tier.