mineru
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMinerU
MinerU
MinerU is a command-line document reader for agents. It parses local documents into readable content, lets agents continue by page or block, and returns stable locators for follow-up reads and citations.
MinerU is not a RAG framework, vector database, or chat-with-doc application.
This skill mainly uses the command.
mineruMinerU 是面向 Agent 的命令行文档阅读器。它会将本地文档解析为可读内容,允许 Agent 按页面或区块继续读取,并返回稳定的定位符,供后续读取和引用。
MinerU 不是 RAG 框架、向量数据库或 chat-with-doc 应用。
此 skill 主要使用 命令。
mineruWhen To Use MinerU
何时使用 MinerU
Use MinerU as the preferred tool when reading or parsing supported PDFs, images, and Office documents. Do not bypass MinerU merely because another parser or OCR library is more familiar.
Use this skill when the user asks an agent to:
- Read, inspect, summarize, quote, cite, or answer questions about a local document.
- Convert document content into Markdown for analysis.
- OCR scanned PDFs or images.
- Extract content from PDFs, images, Word, PowerPoint, Excel, RTF, OpenDocument, EPUB, OFD, HTML, CSV, or other MinerU-supported document formats.
- Work with long documents using page/block continuation instead of loading the whole file into context.
- Search documents MinerU has already indexed.
- Retrieve page or block images for visual inspection.
- Keep stable references to document locations using locators.
doc:{short_id}/tier:{tier}/page:{page_no}/block:{block_no}
Use another tool only when the user explicitly requests it, the format is unsupported, the MinerU CLI is unavailable, or all user-approved MinerU recovery paths have failed. Treat recoverable engine and configuration errors, including , , , and , as user-choice points rather than immediate authorization to fall back.
quality_tier_unavailableno_engineparse_server_unavailableremote_not_allowed读取或解析受支持的 PDF、图像和 Office 文档时,应优先使用 MinerU。不要仅仅因为其他解析器或 OCR 库更为熟悉就绕过 MinerU。
当用户要求 Agent 执行以下操作时,使用此 skill:
- 读取、检查、总结、引用本地文档,或回答与本地文档相关的问题。
- 将文档内容转换为 Markdown 以供分析。
- 对扫描版 PDF 或图像执行 OCR。
- 从 PDF、图像、Word、PowerPoint、Excel、RTF、OpenDocument、EPUB、OFD、HTML、CSV 或其他受 MinerU 支持的文档格式中提取内容。
- 使用页面或区块续读来处理长文档,而不是将整个文件加载到上下文中。
- 搜索 MinerU 已经建立索引的文档。
- 获取页面或区块图像以进行视觉检查。
- 使用 定位符保持对文档位置的稳定引用。
doc:{short_id}/tier:{tier}/page:{page_no}/block:{block_no}
仅当用户明确要求使用其他工具、格式不受支持、MinerU CLI 不可用,或所有用户认可的 MinerU 恢复路径均已失败时,才使用其他工具。包括 、、 和 在内的可恢复引擎及配置错误,应作为需要用户选择的节点处理,而不是立即获得回退授权。
quality_tier_unavailableno_engineparse_server_unavailableremote_not_allowedSupported Inputs
支持的输入
Use MinerU for local document files such as:
| Type | Extensions |
|---|---|
| |
| Images | |
| Word | |
| PowerPoint | |
| Excel | |
| Rich text | |
| OpenDocument | |
| EPUB | |
| OFD | |
| HTML | |
| CSV / TSV | |
PDF and images support every quality tier (, , , ). Office, HTML, CSV, EPUB, and OFD files are parsed locally at the tier. Plain-text files (, , , , ) are not parsed; read them directly.
flashbasicstandardadvancedflash.txt.md.markdown.rst.texMinerU is especially useful when documents contain OCR text, tables, formulas, figures, or complex page layouts.
使用 MinerU 处理如下本地文档文件:
| 类型 | 扩展名 |
|---|---|
| |
| 图像 | |
| Word | |
| PowerPoint | |
| Excel | |
| 富文本 | |
| OpenDocument | |
| EPUB | |
| OFD | |
| HTML | |
| CSV / TSV | |
PDF 和图像支持所有质量层级(、、、)。Office、HTML、CSV、EPUB 和 OFD 文件在本地以 层级解析。纯文本文件(、、、、)不会被解析,应直接读取。
flashbasicstandardadvancedflash.txt.md.markdown.rst.tex当文档包含 OCR 文本、表格、公式、图形或复杂页面布局时,MinerU 尤其有用。
Do Not
禁止事项
- Summarize a document before reading it with .
mineru - Reimplement PDF/OCR extraction when can read the document.
mineru
- 在使用 读取文档之前,不要先总结文档。
mineru - 当 能够读取文档时,不要重新实现 PDF/OCR 提取逻辑。
mineru
Agent Contract
Agent 契约
- Use as the command entrypoint.
mineru - Use when making control-flow decisions.
--json - Follow continuation commands and .
next_request - Preserve locators for citations and follow-up reads.
- Ask before using , changing persistent config, adding watches, stopping or restarting the server, invalidating caches, or running destructive maintenance such as
--remoteorforget --no-dry-run.cleanup --no-dry-run - When a recoverable engine or configuration error requires a quality, privacy, download, or configuration choice, present the applicable MinerU recovery paths and wait for the user's choice before using another document parser.
- 使用 作为命令入口。
mineru - 需要进行控制流决策时,使用 。
--json - 遵循续读命令和 。
next_request - 保留定位符,以供引用和后续读取使用。
- 使用 、修改持久化配置、添加 watch、停止或重启服务器、使缓存失效,或执行
--remote、forget --no-dry-run等破坏性维护操作前,必须征得用户同意。cleanup --no-dry-run - 当可恢复的引擎或配置错误需要在质量、隐私、下载或配置方案之间作出选择时,应向用户提供适用的 MinerU 恢复路径,并在改用其他文档解析器之前等待用户选择。
Core Decision Tree
核心决策树
Use this decision tree before running commands:
- User provided a file path and wants content: read plain-text formats directly; otherwise run .
mineru parse <file> - User provided a locator: run
doc:....mineru read <locator> - User asks to continue from a previous output: follow the command exactly.
<!-- Next: ... --> - User asks for a specific page or block after parsing: use , not a fresh parse.
mineru read <locator> - User asks to find a document by filename: use .
mineru find - User asks to search inside known indexed documents: use .
mineru search - User asks for parse/file/doc status: use or
mineru show.mineru list - User asks to add or refresh a watched folder: use or
mineru watch.mineru scan - User asks MinerU to forget a file or folder without deleting it: use .
mineru forget - User asks to force a reparse: use or
mineru parse --force.mineru invalidate - User asks for Remote API usage or limits: use .
mineru usage --json
运行命令前,使用此决策树:
- 用户提供了文件路径并需要内容:直接读取纯文本格式;否则运行 。
mineru parse <file> - 用户提供了 定位符:运行
doc:...。mineru read <locator> - 用户要求从之前的输出继续:严格遵循 命令。
<!-- Next: ... --> - 用户要求在解析后读取特定页面或区块:使用 ,不要重新解析。
mineru read <locator> - 用户要求按文件名查找文档:使用 。
mineru find - 用户要求搜索已知已索引文档中的内容:使用 。
mineru search - 用户要求查看解析、文件或文档状态:使用 或
mineru show。mineru list - 用户要求添加或刷新被监视的文件夹:使用 或
mineru watch。mineru scan - 用户要求 MinerU 忘记某个文件或文件夹但不删除文件:使用 。
mineru forget - 用户要求强制重新解析:使用 或
mineru parse --force。mineru invalidate - 用户要求了解 Remote API 的使用情况或限制:使用 。
mineru usage --json
Common Workflows
常见工作流
First read from a file
首次从文件读取
bash
mineru parse "document.pdf" --jsonThen answer from . If exists and the question needs more context, continue.
content.contentnext_requestbash
mineru parse "document.pdf" --json然后根据 回答。如果存在 且问题需要更多上下文,则继续读取。
content.contentnext_requestContinue progressively
渐进式续读
bash
mineru parse "book.pdf" --pages 1-10 --limit 12000 --json
mineru read "doc:ab12cd3/tier:standard/page:11" --limit 12000 --jsonContinue with returned .
next_request.locatorbash
mineru parse "book.pdf" --pages 1-10 --limit 12000 --json
mineru read "doc:ab12cd3/tier:standard/page:11" --limit 12000 --json使用返回的 继续读取。
next_request.locatorRead or inspect a known location
读取或检查已知位置
bash
mineru read "doc:ab12cd3/tier:standard/page:42" --context 1 --json
mineru read "doc:ab12cd3/tier:standard/page:12/block:5" --format image --output ./page12-block5.pngbash
mineru read "doc:ab12cd3/tier:standard/page:42" --context 1 --json
mineru read "doc:ab12cd3/tier:standard/page:12/block:5" --format image --output ./page12-block5.pngSearch local library, then read
搜索本地文档库,然后读取
bash
mineru search "liquidated damages" --min-tier basic --json
mineru read "doc:ab12cd3/tier:standard/page:18" --jsonbash
mineru search "liquidated damages" --min-tier basic --json
mineru read "doc:ab12cd3/tier:standard/page:18" --jsonInstallation And Setup
安装与设置
This skill requires MinerU . Before using any workflow, check whether the CLI is installed:
>=4.0,<5bash
command -v mineruIf is not installed, install it with the first available isolated CLI installer. If it is installed, check its version:
minerubash
mineru version --jsonIf fails, try 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 version --jsonmineru --versionMinerU requires Python .
>=3.10,<3.15此 skill 要求 MinerU 。使用任何工作流前,检查是否已安装 CLI:
>=4.0,<5bash
command -v mineru如果未安装 ,使用首个可用的隔离式 CLI 安装工具进行安装。如果已经安装,则检查其版本:
minerubash
mineru version --json如果 失败,请尝试使用 兼容旧版 CLI。如果检测到的版本不满足要求,应告知用户当前版本,并在升级前征得用户同意。如果用户批准,则使用相同的安装工具和环境进行升级,然后再次检查版本。如果用户拒绝,则停止操作,不运行此 skill 的命令。无法确定版本时,绝不能假定兼容性。
mineru version --jsonmineru --versionMinerU 要求 Python 。
>=3.10,<3.15Upgrade An Existing Installation
升级现有安装
Before upgrading, determine which tool owns the resolved executable. Check , then ; otherwise, identify the Python environment containing the executable. Do not use an unrelated or install a second copy.
mineruuv tool listpipx list --shortpipBefore an in-place upgrade or reinstall, stop the MinerU server. On Windows, confirm that status reports before modifying the environment:
running=falsebash
mineru server stop
mineru server status --jsonUse the matching upgrade command only after the user approves the upgrade:
bash
uv tool upgrade "mineru>=4.0,<5"
pipx upgrade "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.
If a failed Windows reinstall has already broken the CLI, locate and stop the residual process by PID in Task Manager or PowerShell, then rerun the full install command. Do not delete the tool directory while that process is running.
python.exe -m mineru.doclib.app升级前,确定哪个工具管理解析后的 可执行文件。先检查 ,再检查 ;否则,识别包含该可执行文件的 Python 环境。不要使用无关的 ,也不要安装第二份副本。
mineruuv tool listpipx list --shortpip原地升级或重新安装前,停止 MinerU 服务器。在 Windows 上,修改环境前确认状态显示 :
running=falsebash
mineru server stop
mineru server status --json只有在用户批准升级后,才使用匹配的升级命令:
bash
uv tool upgrade "mineru>=4.0,<5"
pipx upgrade "mineru>=4.0,<5"
"<environment-python>" -m pip install --upgrade "mineru>=4.0,<5"如果无法确定管理工具、存在多个安装,或者 MinerU 是从源代码或以 editable 模式安装的,应询问用户,而不是直接升级。升级后,再次检查解析后的可执行文件及其版本。
如果之前失败的 Windows 重装已经导致 CLI 损坏,应通过任务管理器或 PowerShell 按 PID 查找并停止残留的 进程,然后重新运行完整安装命令。进程仍在运行时,不要删除工具目录。
python.exe -m mineru.doclib.appInstall with uv
(preferred)
uv使用 uv
安装(首选)
uvIf is available, use any supported Python version for the tool environment.
If no supported interpreter is available, install Python 3.12 with as a conservative fallback:
uvuvbash
command -v uv
uv python find 3.12
uv python find 3.13
uv python find 3.14
uv python find 3.11
uv python find 3.10If all commands failed, download Python 3.12 with :
uv python finduvbash
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 "mineru>=4.0,<5"如果可以使用 ,则使用工具环境支持的任意 Python 版本。
如果没有可用的受支持解释器,应保守地回退并使用 安装 Python 3.12:
uvuvbash
command -v uv
uv python find 3.12
uv python find 3.13
uv python find 3.14
uv python find 3.11
uv python find 3.10如果所有 命令均失败,则使用 下载 Python 3.12:
uv python finduvbash
uv python install 3.12然后使用找到的受支持解释器安装 MinerU;如果安装的是回退版本,则使用 Python 3.12:
bash
uv tool install --python 3.12 "mineru>=4.0,<5"Install with pipx
pipx使用 pipx
安装
pipxIf is unavailable but is available, inspect 's default Python before installing:
uvpipxpipxbash
command -v pipx
pipx environment --value PIPX_DEFAULT_PYTHON
PIPX_DEFAULT_PYTHON="$(pipx environment --value PIPX_DEFAULT_PYTHON)"
"$PIPX_DEFAULT_PYTHON" --versionCheck the path reported by . If that interpreter satisfies , install with :
PIPX_DEFAULT_PYTHONpipx>=3.10,<3.15pipxbash
pipx install "mineru>=4.0,<5"If is unsupported, but a supported Python interpreter can be found on the current system, pass it explicitly. is an example; use any interpreter that satisfies .
PIPX_DEFAULT_PYTHONpython3.12>=3.10,<3.15bash
command -v python3.12
python3.12 --version
pipx install --python python3.12 "mineru>=4.0,<5"If no supported system interpreter is available and supports Python fetching, ask for approval before downloading a standalone Python:
pipxbash
pipx install --python 3.12 --fetch-python=missing "mineru>=4.0,<5"如果无法使用 ,但可以使用 ,请先检查 的默认 Python,再进行安装:
uvpipxpipxbash
command -v pipx
pipx environment --value PIPX_DEFAULT_PYTHON
PIPX_DEFAULT_PYTHON="$(pipx environment --value PIPX_DEFAULT_PYTHON)"
"$PIPX_DEFAULT_PYTHON" --version检查 报告的 路径。如果该解释器满足 ,则安装 MinerU:
pipxPIPX_DEFAULT_PYTHON>=3.10,<3.15bash
pipx install "mineru>=4.0,<5"如果默认 Python 不受支持,但当前系统中可以找到受支持的 Python 解释器,请显式传入该解释器。 只是一个示例,也可以使用任何满足 的解释器。
python3.12>=3.10,<3.15bash
command -v python3.12
python3.12 --version
pipx install --python python3.12 "mineru>=4.0,<5"如果系统上没有可用的受支持解释器,但 支持获取 Python,应在下载独立 Python 之前征得用户批准:
pipxbash
pipx install --python 3.12 --fetch-python=missing "mineru>=4.0,<5"Install with global pip
pip使用全局 pip
安装
pipIf neither nor is available, but or is available, check the Python version of the command, and ask the user before installing into the global python environment:
uvpipxpippip3pipbash
which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pips
pip --versionIf a command reports Python , and the user confirms, install with the exact supported command that was verified. Replace below with the verified pip command if needed:
pip>=3.10,<3.15pippipbash
pip install "mineru>=4.0,<5"如果 和 均不可用,但可以使用 或 ,请检查 命令使用的 Python 版本,并在安装到全局 Python 环境之前征得用户同意:
uvpipxpippip3pipbash
which -a pip pip3 pip3.10 pip3.11 pip3.12 pip3.13 pip3.14 # find all available pips
pip --version如果某个 命令使用 Python ,并且用户已确认,则使用经过验证的确切 命令进行安装。必要时,将下面的 替换为已验证的命令:
pip>=3.10,<3.15pippipbash
pip install "mineru>=4.0,<5"If No Supported Installer Is Available
如果没有可用的安装工具
If , , , and are all unavailable, or none of them can install with Python , recommend that the user install first.
uvpipxpippip3>=3.10,<3.15uv如果 、、 和 均不可用,或者它们都无法安装使用 Python 的 MinerU,建议用户先安装 。
uvpipxpippip3>=3.10,<3.15uvAfter Installation
安装完成后
Verify the installed CLI:
bash
mineru --help验证已安装的 CLI:
bash
mineru --helpPrivacy Rules
隐私规则
MinerU is privacy-first.
- By default, parses documents locally. A document is sent for remote parsing only when the command uses the
mineruCLI parameter.--remote - Use local parsing first. If local parsing is not configured or cannot satisfy the request, and the document does not involve private or sensitive content, ask the user before retrying with .
--remote - Even if remote parsing is configured, do not upload a document until the user agrees.
- Local failure cannot silently fall back to remote.
- Remote failure may fall back to local if the request can still be satisfied locally.
When remote parsing is acceptable:
bash
mineru parse "document.pdf" --remoteIf the request is sensitive, confidential, legal, medical, financial, personal, or proprietary, stay local unless the user gives explicit remote permission.
MinerU 优先保护隐私。
- 默认情况下,会在本地解析文档。只有命令使用
mineruCLI 参数时,文档才会发送到远程解析。--remote - 优先使用本地解析。如果本地解析未配置或无法满足请求,并且文档不包含私密或敏感内容,应在尝试使用 重试之前征得用户同意。
--remote - 即使已经配置远程解析,也必须等到用户同意后才能上传文档。
- 本地解析失败时,不得静默回退到远程解析。
- 如果本地仍能满足请求,远程解析失败后可以回退到本地解析。
可以接受远程解析时:
bash
mineru parse "document.pdf" --remote如果请求涉及敏感、机密、法律、医疗、财务、个人或专有内容,除非用户明确允许远程解析,否则应保持本地处理。
Telemetry
遥测
MinerU may collect anonymous, locally aggregated usage and diagnostic telemetry to understand command usage, success or failure rates, tier choices, coarse environment categories, and performance timing buckets.
Telemetry 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.
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. If the user asks about telemetry, use:
bash
mineru telemetry status
mineru telemetry enable
mineru telemetry disable
mineru telemetry preview
mineru telemetry flushMinerU 可能收集匿名且在本地聚合的使用情况和诊断遥测数据,用于了解命令使用情况、成功或失败率、层级选择、粗略的环境类别以及性能耗时区间。
遥测不会收集文档内容、提取的文本或图像、文件名、文件路径、搜索查询、提示词、摘要片段、API 密钥、用户名、主机名、原始堆栈跟踪或精确的硬件标识符。
用户可以检查遥测状态,并明确启用或禁用遥测。要阻止遥测上传,请显式禁用;禁用后还会停止新的数据聚合并删除尚未发送的本地遥测数据。如果用户询问遥测,请使用:
bash
mineru telemetry status
mineru telemetry enable
mineru telemetry disable
mineru telemetry preview
mineru telemetry flushQuality Tiers
质量层级
MinerU has four tiers:
| Tier | Chinese name | Quality and speed | Use for |
|---|---|---|---|
| 极速解析 | Lowest quality; fastest | Discovery, preview, and indexing; never default final reading quality |
| 基础解析 | Basic quality; moderate speed | Private local reading or lower-resource local parsing |
| 标准解析 | Standard high quality; similar speed to | Default for normal active reading and complex documents |
| 高级解析 | Standard quality on ordinary documents and better quality on difficult documents; slowest | Difficult documents and maximum-quality work when the user accepts a longer wait |
Default tier behavior:
- Omit when the user wants normal reading quality.
--tier - For parse-server based parsing, MinerU chooses , then
standard;basicis not selected implicitly, andadvancedis not a default final reading tier.flash - For , MinerU reads the best cached result rather than starting a new parse.
mineru read doc:{short_id} - If normal reading quality is unavailable, inspect , then present the applicable choices to the user:
mineru server status --json- Use remote parsing with , which uploads the document and requires explicit permission.
--remote - Start or configure a local parse server if the hardware supports it, which may require dependency and model downloads plus persistent configuration changes.
- Explicitly accept the lower-quality local tier.
flash - Explicitly authorize fallback to a non-MinerU parser.
- Use remote parsing with
- Stop and wait for the user's choice. Do not select a non-MinerU parser merely to finish the task without asking.
- Use only when the user explicitly asks for fastest/preview/low-cost parsing or accepts lower quality.
--tier flash - Before asking the user to choose a parsing tier or a managed parse-server tier for the first time in the current conversation, introduce the tier system rather than presenting tier names without context. Do not assume that the user has read this skill, knows that MinerU uses tiers, knows which tiers are available, or understands how they differ.
- For a parsing-tier choice, explain that the tier controls parsing quality, speed, and compute requirements. Briefly describe the tiers available in the current situation and their relevant trade-offs.
- For a managed parse-server-tier choice, explain that the server tier is a deployment capability level rather than the tier selected for an individual parsing request. Briefly describe the available server tiers, their setup and hardware requirements, and which parsing tiers each server tier enables.
- In either case, recommend one option based on the user's goal and environment, and explain the reason for the recommendation.
- When communicating in Chinese, use the Chinese tier name together with its identifier on first mention, for example, 标准解析 ().
standard
Examples:
bash
mineru parse "paper.pdf"
mineru parse "paper.pdf" --tier basic
mineru parse "paper.pdf" --tier standard
mineru parse "paper.pdf" --tier advanced
mineru parse "paper.pdf" --tier flashMinerU 提供四个层级:
| 层级 | 中文名称 | 质量与速度 | 适用场景 |
|---|---|---|---|
| 极速解析 | 质量最低;速度最快 | 发现、预览和索引;绝不作为默认的最终阅读质量 |
| 基础解析 | 基础质量;速度适中 | 注重隐私的本地阅读或资源较低的本地解析 |
| 标准解析 | 标准高质量;在合适硬件上的速度与 | 默认用于常规主动阅读和复杂文档 |
| 高级解析 | 普通文档达到标准质量,困难文档质量更高;速度最慢 | 困难文档,以及用户愿意等待更长时间时的最高质量工作 |
默认层级行为:
- 当用户需要正常阅读质量时,省略 。
--tier - 对于基于 parse server 的解析,MinerU 优先选择 ,其次选择
standard;不会隐式选择basic,且advanced不是默认的最终阅读层级。flash - 对于 ,MinerU 会读取最佳缓存结果,而不是启动新的解析。
mineru read doc:{short_id} - 如果正常阅读质量不可用,检查 ,然后向用户提供以下适用选项:
mineru server status --json- 使用 进行远程解析,这会上传文档并需要明确许可。
--remote - 在硬件支持的情况下启动或配置本地 parse server,这可能需要下载依赖和模型,并修改持久化配置。
- 明确接受质量较低的本地 层级。
flash - 明确授权回退到非 MinerU 解析器。
- 使用
- 停止操作并等待用户选择。不得为了完成任务而自行选择非 MinerU 解析器。
- 只有当用户明确要求最快、预览或低成本解析,或者接受较低质量时,才使用 。
--tier flash - 在当前对话中第一次要求用户选择解析层级或托管 parse server 层级之前,应先介绍层级系统,不要在缺少上下文的情况下直接列出层级名称。不要假定用户已经阅读过此 skill、知道 MinerU 使用层级、了解当前有哪些可用层级,或理解层级之间的差异。
- 选择解析层级时,说明该层级控制解析质量、速度和计算资源需求。简要介绍当前情况下可用的层级及其相关权衡。
- 选择托管 parse server 层级时,说明服务器层级代表部署能力级别,而不是单次解析请求选择的层级。简要介绍可用的服务器层级、其设置和硬件要求,以及每个服务器层级可启用哪些解析层级。
- 在两种情况下,都应根据用户目标和当前环境推荐一个选项,并说明推荐理由。
- 使用中文沟通时,首次提及层级应同时使用中文名称和标识符,例如:标准解析 ()。
standard
示例:
bash
mineru parse "paper.pdf"
mineru parse "paper.pdf" --tier basic
mineru parse "paper.pdf" --tier standard
mineru parse "paper.pdf" --tier advanced
mineru parse "paper.pdf" --tier flashModel Engines with Extras
附加组件与模型引擎
MinerU use neural network models for local , , and parsing.
To better support different hardwares, MinerU provide different model engines with two extras: and .
basicstandardadvancedtorchfull| Extra | Model engines installed | How to install |
|---|---|---|
| (base) | ONNX + llama.cpp | Already in |
| ONNX + PyTorch + llama.cpp | Install with |
| ONNX + PyTorch + llama.cpp + vLLM/lmdeploy/mlx | Install with |
Model engines control resource use and download size:
| Tier | Model engines | Model download | Min RAM required | Accelerator |
|---|---|---|---|---|
| ONNX | ~0.8 GB | 2GB | None (CPU works) |
| PyTorch | ~0.8 GB | 8 GB | GPU/MPS recommended |
| ONNX + llama.cpp | ~2 GB | 8 GB | CPU works, Vulkan recommended |
| PyTorch + llama.cpp | ~2 GB | 16 GB | GPU/MPS required, 8 GB+ VRAM |
| PyTorch + vLLM/lmdeploy/mlx | ~3 GB | 16 GB | GPU/MPS required, 8 GB+ VRAM |
MinerU 使用神经网络模型进行本地 、 和 解析。
为了更好地支持不同硬件,MinerU 提供两种附加组件: 和 。
basicstandardadvancedtorchfull| 附加组件 | 安装的模型引擎 | 安装方式 |
|---|---|---|
| (基础) | ONNX + llama.cpp | 已包含在 |
| ONNX + PyTorch + llama.cpp | 使用 |
| ONNX + PyTorch + llama.cpp + vLLM/lmdeploy/mlx | 使用 |
模型引擎控制资源使用量和下载大小:
| 层级 | 模型引擎 | 模型下载量 | 最低 RAM | 加速器 |
|---|---|---|---|---|
| ONNX | 约 0.8 GB | 2GB | 无需加速器(CPU 可运行) |
| PyTorch | 约 0.8 GB | 8 GB | 推荐使用 GPU/MPS |
| ONNX + llama.cpp | 约 2 GB | 8 GB | CPU 可运行,推荐使用 Vulkan |
| PyTorch + llama.cpp | 约 2 GB | 16 GB | 必须使用 GPU/MPS,VRAM 至少 8GB |
| PyTorch + vLLM/lmdeploy/mlx | 约 3 GB | 16 GB | 必须使用 GPU/MPS,VRAM 至少 8GB |
Server Rules
服务器规则
Most commands use the local MinerU background service. If a command fails with , start it:
mineruserver_not_runningbash
mineru server startCheck status when MinerU is not responding, parsing is stuck, or you need to see available tiers:
bash
mineru server status
mineru server status --jsonServer commands:
bash
mineru server start
mineru server stop
mineru server restart
mineru server statusAgent rules:
- Start the server when reports it is not running.
mineru - Do not restart the server repeatedly without a reason.
- Use when you need machine-readable status.
server status --json - If high-quality local parsing is unavailable, report the error and suggested action. Do not switch to remote without permission.
大多数 命令使用本地 MinerU 后台服务。如果命令返回 ,应启动服务器:
mineruserver_not_runningbash
mineru server start当 MinerU 无响应、解析卡住或需要查看可用层级时,检查状态:
bash
mineru server status
mineru server status --json服务器命令:
bash
mineru server start
mineru server stop
mineru server restart
mineru server statusAgent 规则:
- 当 报告服务器未运行时,启动服务器。
mineru - 不要在没有明确原因时反复重启服务器。
- 需要机器可读状态时,使用 。
server status --json - 如果高质量本地解析不可用,应报告错误和建议操作。未经许可,不得切换到远程解析。
Local Parse Server
本地 Parse Server
Use a local parse server when the user wants , , or quality without sending the document to remote parsing.
basicstandardadvanced当用户希望获得 、 或 质量,同时又不将文档发送到远程解析时,使用本地 parse server。
basicstandardadvancedInspect Local Hardware
检查本地硬件
When no local quality tier is available, inspect the current machine before presenting the recovery choices. shows which tiers are currently configured and available. An empty local list may simply mean that the local parse server is disabled or not configured, so inspect the hardware before deciding whether local quality tiers can run.
mineru server status --jsonsupported_tiersUse available read-only system commands to inspect the OS, architecture, total memory, accelerator model, and accelerator memory. Common options include:
- macOS: ,
uname -m, andsysctl -n hw.memsize.system_profiler SPHardwareDataType SPDisplaysDataType - Linux: ,
uname -mor/proc/meminfo,free -b, andlscpuwhen available.nvidia-smi - Windows PowerShell: ,
(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory, andGet-CimInstance Win32_Processorwhen available.nvidia-smi - Other accelerators: use an already-installed vendor tool if available; do not install software merely to inspect hardware.
当没有可用的本地质量层级时,在提供恢复选项之前检查当前机器。 会显示当前已配置和可用的层级。空的本地 列表可能仅表示本地 parse server 被禁用或尚未配置,因此应先检查硬件,再判断是否可以运行本地质量层级。
mineru server status --jsonsupported_tiers使用可用的只读系统命令检查操作系统、架构、总内存、加速器型号和加速器内存。常见选项包括:
- macOS:、
uname -m和sysctl -n hw.memsize。system_profiler SPHardwareDataType SPDisplaysDataType - Linux:、
uname -m或/proc/meminfo、free -b,以及可用时的lscpu。nvidia-smi - Windows PowerShell:、
(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory,以及可用时的Get-CimInstance Win32_Processor。nvidia-smi - 其他加速器:使用已安装的厂商工具;不要仅为检查硬件而安装软件。
Choose Extra
选择附加组件
The base package is suitable for most hardwares, including CPU-only machines, Apple Silicon, and low-end iGPU/GPU machines.
Install and use extra only when you have enough RAM and powerful NVIDIA GPU, accept extra installation disk space, and want a higher throughput. Hardware requirements:
full- At least 16 GB total memory.
- A Volta-or-newer NVIDIA GPU with at least 8 GB available VRAM.
- Consumes ~5GB more disk space.
If you have an , , , , or accelerator, you must install a suitable torch/vllm by yourself. Otherwise, only CPU are used by default package.
npugcumusamlusdaamineruThe following example shows how to install the extra. It assumes the current install tool is . If was installed with another tool or environment, use the equivalent command for that actual tool/environment. Installing extra will replace the active environment. Stop the MinerU server first, confirm , and start it again after installing dependencies.
mineru[full]uv toolmineruminerurunning=falsebash
mineru server stop
mineru server status --json
uv tool install --force "mineru[full]>=4.0,<5"
mineru server start
mineru server status --json基础包适合大多数硬件,包括纯 CPU 机器、Apple Silicon 和低端 iGPU/GPU 机器。
只有在内存充足、配备强大的 NVIDIA GPU、能够接受额外安装磁盘空间并希望获得更高吞吐量时,才安装并使用 附加组件。硬件要求:
full- 总内存至少 16 GB。
- Volta 或更新架构的 NVIDIA GPU,至少具有 8 GB 可用 VRAM。
- 额外占用约 5GB 磁盘空间。
如果拥有 、、、 或 加速器,则必须自行安装合适的 torch/vllm。否则,默认的 包仅使用 CPU。
npugcumusamlusdaamineru下面的示例展示了如何安装 附加组件。示例假设当前安装工具为 。如果 使用其他工具或环境安装,请使用与实际工具或环境对应的命令。安装附加组件会替换当前活动的 环境。安装依赖前先停止 MinerU 服务器,确认 ,安装完成后再重新启动。
mineru[full]uv toolmineruminerurunning=falsebash
mineru server stop
mineru server status --json
uv tool install --force "mineru[full]>=4.0,<5"
mineru server start
mineru server status --jsonChoose Local Tier
选择本地层级
Managed local parsing has two startup tiers: and . A Standard server provides , , and 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 .
basicstandardbasicstandardadvanced--tier advancedPlease refer to the following rules to select a suitable extra and tier.
| Hardware | Recommended startup tier | Model engines | Extra |
|---|---|---|---|
| MacOS with Apple Silicon | | PyTorch + llama.cpp | |
| MacOS with Intel CPU | | ONNX | (base) |
| Linux/Windows with NVIDIA GPU and 8GB+ VRAM | | PyTorch + vLLM/lmdeploy | |
| Linux/Windows with NVIDIA GPU and 4GB+ VRAM | | PyTorch | |
| Linux/Windows with other accelerator | (depends) | PyTorch / vLLM | install custom torch/vllm by yourself |
| Linux/Windows with modern iGPU | | ONNX + llama.cpp | (base) |
| Linux/Windows w/o modern accelerator | | ONNX | (base) |
托管式本地解析提供两个启动层级: 和 。Standard 服务器支持 、 和 请求层级。Advanced 使用与 Standard 相同的依赖、模型集合和硬件设置;区别仅在于请求选择 时会消耗更多推理计算资源。
basicstandardbasicstandardadvanced--tier advanced请根据以下规则选择合适的附加组件和层级。
| 硬件 | 推荐启动层级 | 模型引擎 | 附加组件 |
|---|---|---|---|
| 搭载 Apple Silicon 的 MacOS | | PyTorch + llama.cpp | |
| 搭载 Intel CPU 的 MacOS | | ONNX | (基础) |
| 搭载 NVIDIA GPU 且 VRAM 不低于 8GB 的 Linux/Windows | | PyTorch + vLLM/lmdeploy | |
| 搭载 NVIDIA GPU 且 VRAM 不低于 4GB 的 Linux/Windows | | PyTorch | |
| 搭载其他加速器的 Linux/Windows | 视情况而定 | PyTorch / vLLM | 自行安装自定义 torch/vllm |
| 搭载现代 iGPU 的 Linux/Windows | | ONNX + llama.cpp | (基础) |
| 未搭载现代加速器的 Linux/Windows | | ONNX | (基础) |
Recommend and Ask
推荐并询问
After hardware was inspected, you already know the suitable extra and tier for current machine. Before asking the user to choose a tier/extra, 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 when privacy rules allow, or use explicit .
standardflashMention only when the user wants maximum quality and accepts the extra time. Do not install dependencies, download models, change config, or restart services without approval.
advanced检查硬件后,应已经了解适合当前机器的附加组件和层级。在要求用户选择层级或附加组件之前,应总结检测到的硬件,并说明每个层级的硬件状态。
如果机器满足相关要求,应向用户推荐一个层级;否则,在隐私规则允许时提供远程 选项,或使用需要明确接受的 。
standardflash只有在用户需要最高质量并愿意花费额外时间时,才提及 。未经批准,不得安装依赖、下载模型、修改配置或重启服务。
advancedConfigure Managed Parse Server
配置托管式 Parse Server
First, download the models for the target startup tier (, or ).
Replace with or .
basicstandard<tier>basicstandardbash
mineru-kit models download --tier <tier>
mineru-kit models verify --tier <tier>Then, enable managed local parse server for the startup tier.
bash
mineru config set parse_server.local.managed_tier <tier>
mineru config set parse_server.local.mode managed
mineru server status --jsonRules:
- Change local parse-server config or restart the server only when the user asks for or approves.
- Download and verify models for the startup tier (or
basic) before enabling managed mode.standard - Set before
parse_server.local.managed_tier.parse_server.local.mode=managed - Poll and use managed parsing only after the target tier is healthy.
mineru server status --json - If local quality parsing cannot start, do not add automatically; ask the user first.
--remote
首先为目标启动层级( 或 )下载模型。
将 替换为 或 。
basicstandard<tier>basicstandardbash
mineru-kit models download --tier <tier>
mineru-kit models verify --tier <tier>然后,为该启动层级启用托管式本地 parse server。
bash
mineru config set parse_server.local.managed_tier <tier>
mineru config set parse_server.local.mode managed
mineru server status --json规则:
- 只有当用户要求或批准时,才修改本地 parse server 配置或重启服务器。
- 启用托管模式前,下载并验证启动层级(或
basic)对应的模型。standard - 先设置 ,再设置
parse_server.local.managed_tier。parse_server.local.mode=managed - 轮询 ,仅在目标层级状态健康后使用托管解析。
mineru server status --json - 如果本地质量解析无法启动,不得自动添加 ;应先询问用户。
--remote
First Read From A File
首次从文件读取
Use for the first active read from a local file path.
mineru parsebash
mineru parse "report.pdf"By default, readable content is printed to stdout. Use only when the user wants the result saved to a file.
--outputUse JSON when you need structured status, tier, content, and continuation:
bash
mineru parse "report.pdf" --jsonPDF page selection is shared across CLI, Doclib, API, Gradio and Python. See the page-range syntax and historical result compatibility. New requests use the current syntax; stored positive page ranges using ASCII remain readable without rebuilding Doclib caches. Fullwidth and negative page-number notation are not supported.
~~For a specific page range (1-based, inclusive; is the last page, selects every page):
r1allbash
mineru parse "report.pdf" --pages 1-10
mineru parse "report.pdf" --pages allFor bounded context:
bash
mineru parse "report.pdf" --limit 12000For no synchronous wait:
bash
mineru parse "report.pdf" --no-wait --jsonFor longer wait:
bash
mineru parse "report.pdf" --wait 180 --jsonFor output to a file:
bash
mineru parse "report.pdf" --output ./report.mdRules:
- Quote paths with spaces.
- For paged documents, the default active read range is the first page window, usually ; continue with the returned marker or
1-10instead of reading the whole document by default.next_request - Use the default tier unless the user has a quality/speed/privacy preference.
- Use only when the user asks for the whole document or the document is known to be small enough.
--pages all - Prefer and continuation for long documents.
--limit - Once you have a locator, switch to .
mineru read
首次主动读取本地文件路径时,使用 。
mineru parsebash
mineru parse "report.pdf"默认情况下,可读内容会输出到 stdout。只有当用户希望将结果保存到文件时,才使用 。
--output需要获取结构化状态、层级、内容和续读信息时,使用 JSON:
bash
mineru parse "report.pdf" --jsonPDF 页面选择方式在 CLI、Doclib、API、Gradio 和 Python 中保持一致。请参阅页面范围语法和历史结果兼容性。新请求使用当前语法;已存储的正数页面范围如果使用 ASCII ,无需重建 Doclib 缓存即可继续读取。不支持全角 和负数页码表示法。
~~对于特定页面范围(从 1 开始,包含首尾; 表示最后一页, 表示所有页面):
r1allbash
mineru parse "report.pdf" --pages 1-10
mineru parse "report.pdf" --pages all限制上下文长度:
bash
mineru parse "report.pdf" --limit 12000不进行同步等待:
bash
mineru parse "report.pdf" --no-wait --json延长等待时间:
bash
mineru parse "report.pdf" --wait 180 --json将输出保存到文件:
bash
mineru parse "report.pdf" --output ./report.md规则:
- 对包含空格的路径加引号。
- 对于分页文档,默认主动读取范围是首个页面窗口,通常为 ;应继续使用返回的标记或
1-10,而不是默认读取整个文档。next_request - 除非用户有质量、速度或隐私偏好,否则使用默认层级。
- 只有当用户要求整个文档,或已知文档足够小时,才使用 。
--pages all - 对于长文档,优先使用 和续读功能。
--limit - 获得定位符后,切换到 。
mineru read
Continue Reading
继续读取
MinerU output may include a command to continue reading:
text
<!-- Next: mineru read doc:ab12cd3/tier:standard/page:11 -->or:
text
<!-- Next: mineru parse report.pdf --pages 11-20 -->Run the suggested command exactly unless the user asks for a different page, block, format, or limit.
Agent rules:
- Do not guess the next page or block if MinerU provides a next command.
- Do not restart parsing from page 1 when continuing.
- For non-paged long documents, continuation may use an cursor from
--after; use that exact cursor.next_request.after - Prefer when the next command or JSON output gives a locator.
mineru read - Use to keep output within the conversation budget.
--limit - Preserve locators for citations and follow-up reads.
MinerU 输出可能包含用于继续读取的命令:
text
<!-- Next: mineru read doc:ab12cd3/tier:standard/page:11 -->或者:
text
<!-- Next: mineru parse report.pdf --pages 11-20 -->除非用户指定其他页面、区块、格式或限制,否则严格运行建议的命令。
Agent 规则:
- 如果 MinerU 提供了下一条命令,不要猜测下一页或下一区块。
- 续读时,不要从第 1 页重新开始解析。
- 对于非分页长文档,续读可能使用 中的
next_request.after游标;应使用该确切游标。--after - 当下一条命令或 JSON 输出提供定位符时,优先使用 。
mineru read - 使用 ,使输出保持在对话预算范围内。
--limit - 保留定位符,以供引用和后续读取使用。
Read By Locator
按定位符读取
Use when a document has already been parsed or when the user gives a locator.
mineru readLocator forms:
text
doc:{short_id}
doc:{short_id}/tier:{tier}
doc:{short_id}/tier:{tier}/page:{page_no}
doc:{short_id}/tier:{tier}/page:{page_no}/block:{block_no}
doc:{short_id}/tier:{tier}/page:{page_no}/block:{block_no}/char:{offset}Examples:
bash
mineru read "doc:ab12cd3/tier:standard/page:4"
mineru read "doc:ab12cd3/tier:standard/page:4/block:7"
mineru read "doc:ab12cd3/tier:standard/page:4/block:7" --context 2
mineru read "doc:ab12cd3/tier:standard/page:4" --limit 8000 --jsonRules:
- Page and block numbers are 1-based.
- Character offsets are 0-based within the block text.
- means surrounding pages for page locators and surrounding blocks for block locators.
--context N - If only is provided, MinerU should choose the highest cached result. If none exists, parse the document first or report the error.
doc:{short_id}
文档已经解析完成或用户提供了定位符时,使用 。
mineru read定位符形式:
text
doc:{short_id}
doc:{short_id}/tier:{tier}
doc:{short_id}/tier:{tier}/page:{page_no}
doc:{short_id}/tier:{tier}/page:{page_no}/block:{block_no}
doc:{short_id}/tier:{tier}/page:{page_no}/block:{block_no}/char:{offset}示例:
bash
mineru read "doc:ab12cd3/tier:standard/page:4"
mineru read "doc:ab12cd3/tier:standard/page:4/block:7"
mineru read "doc:ab12cd3/tier:standard/page:4/block:7" --context 2
mineru read "doc:ab12cd3/tier:standard/page:4" --limit 8000 --json规则:
- 页面和区块编号从 1 开始。
- 字符偏移量从 0 开始,在区块文本范围内计算。
- 对页面定位符,表示周围的页面;对区块定位符,表示周围的区块。
--context N - 如果只提供了 ,MinerU 应选择质量最高的缓存结果。如果不存在缓存,应先解析文档或报告错误。
doc:{short_id}
Read Page Or Block Images
读取页面或区块图像
Use image output only when the user needs visual inspection, layout evidence, cropped figures, page screenshots, or block-level visual verification.
bash
mineru read "doc:ab12cd3/tier:standard/page:4" --format image
mineru read "doc:ab12cd3/tier:standard/page:4/block:7" --format image
mineru read "doc:ab12cd3/tier:standard/page:4/block:7" --format image --output ./block-7.pngRules:
- PDF page image is supported for page locators.
- PDF block image requires a valid non-empty bbox.
- Office block image is only expected for image blocks.
- Multi-page image export is not the default reading workflow.
- If no is provided, MinerU prints the generated asset path.
--output
只有当用户需要视觉检查、布局证据、裁剪后的图形、页面截图或区块级视觉验证时,才使用图像输出。
bash
mineru read "doc:ab12cd3/tier:standard/page:4" --format image
mineru read "doc:ab12cd3/tier:standard/page:4/block:7" --format image
mineru read "doc:ab12cd3/tier:standard/page:4/block:7" --format image --output ./block-7.png规则:
- 页面定位符支持 PDF 页面图像。
- PDF 区块图像要求提供有效且非空的 bbox。
- Office 区块图像仅适用于图像区块。
- 多页面图像导出不是默认阅读工作流。
- 如果未提供 ,MinerU 会打印生成的资源路径。
--output
Search And Find
搜索与查找
Use for filenames and local paths:
findbash
mineru find "annual report"
mineru find "contract" --ext pdf
mineru find "invoice" --jsonUse for parsed document content:
searchbash
mineru search "revenue recognition"
mineru search "transformer architecture" --type pdf
mineru search "appendix" --min-tier basic --limit 10 --jsonRules:
- does not search document content.
find - only searches content MinerU has already indexed.
search - If search returns only low-quality or snippets and the user needs an answer, parse or read the target document at default quality before relying on the content.
flash - Do not repeat sensitive search snippets in final output unless needed to answer the user.
使用 查找文件名和本地路径:
findbash
mineru find "annual report"
mineru find "contract" --ext pdf
mineru find "invoice" --json使用 搜索已解析的文档内容:
searchbash
mineru search "revenue recognition"
mineru search "transformer architecture" --type pdf
mineru search "appendix" --min-tier basic --limit 10 --json规则:
- 不搜索文档内容。
find - 仅搜索 MinerU 已经建立索引的内容。
search - 如果搜索结果只包含低质量或 摘要,而用户需要据此得到答案,应先以默认质量解析或读取目标文档,然后再依赖其内容。
flash - 除非回答用户确有必要,否则不要在最终输出中重复敏感搜索摘要。
Inspect Status
检查状态
Use for one resource:
showbash
mineru show file "report.pdf"
mineru show file "report.pdf" --json
mineru show parse 123 --json
mineru show doc "<sha256>" --json
mineru show scan 456 --jsonUse for collections:
listbash
mineru list docs
mineru list files --ext pdf
mineru list parses --status parsing
mineru list scans --status running
mineru list docs --jsonRules:
- Use after parse timeout to see active parses and cached tiers.
show file - Use to inspect queued, parsing, failed, or done parse tasks.
list parses - Use JSON modes when you need structured output.
使用 查看单个资源:
showbash
mineru show file "report.pdf"
mineru show file "report.pdf" --json
mineru show parse 123 --json
mineru show doc "<sha256>" --json
mineru show scan 456 --json使用 查看集合:
listbash
mineru list docs
mineru list files --ext pdf
mineru list parses --status parsing
mineru list scans --status running
mineru list docs --json规则:
- 解析超时后,使用 查看活动解析任务和缓存层级。
show file - 使用 检查排队中、正在解析、失败或已完成的解析任务。
list parses - 需要结构化输出时,使用 JSON 模式。
Watch, Scan, And Local Library Maintenance
Watch、扫描与本地文档库维护
Use for one-time discovery or refresh:
scanbash
mineru scan "~/Documents/report.pdf"
mineru scan "~/Documents/project"
mineru scan "~/Documents/project" --no-wait --jsonUse for persistent folders:
watchbash
mineru watch add "~/Documents"
mineru watch add "/Volumes/Archive" --removable
mineru watch list
mineru watch rescan "~/Documents"
mineru watch remove "~/Documents"Watch rules:
- Watch is for discovery and search indexing.
- Watch defaults to .
flash - Watch results are not final reading quality.
- Active reading should still use or
mineru parse.mineru read - The CLI normalizes local path arguments with user-home expansion, absolute paths, and normalized separators.
- For and
watch rescan, use either a watch id or the watch root path.watch remove - Watch will not trigger remote parsing unless a parsing rule explicitly allows remote.
Use parsing rules only when the user wants automatic parse policy for paths:
bash
mineru config parsing-rules add "*/papers/*" --tier standard --pages all
mineru config parsing-rules add "*/contracts/*" --tier standard --remote
mineru config parsing-rules list
mineru config parsing-rules remove 3Use exclude rules to prevent discovery:
bash
mineru config exclude-rules add "*/node_modules/*"
mineru config exclude-rules list
mineru config exclude-rules remove 5Use to forget a file or folder from MinerU without deleting source files:
forgetbash
mineru forget "~/Documents/old.pdf"
mineru forget "~/Documents/project"
mineru forget "~/Documents/project" --no-dry-runUse cleanup for local maintenance:
bash
mineru cleanup deleted-files
mineru cleanup deleted-files --no-dry-run
mineru cleanup orphan-docs
mineru cleanup orphan-docs --no-dry-run
mineru cleanup temp
mineru cleanup temp --older-than 14Rules:
- does not delete source files.
forget - does not prevent a watched path from being rediscovered.
forget - If the target is a watch root, remove the watch first. If the target is inside an active watch, warn that a later scan may rediscover it.
- does not create a watch.
scan - refreshes file discovery state only; it does not mean ingest or parsing has completed.
scan - and
cleanup deleted-filesdefault to dry-run; addcleanup orphan-docsonly when the user wants actual cleanup.--no-dry-run - can delete cached parsed content for documents no longer linked to any known file path; use it only for maintenance.
cleanup orphan-docs --no-dry-run
使用 进行一次性发现或刷新:
scanbash
mineru scan "~/Documents/report.pdf"
mineru scan "~/Documents/project"
mineru scan "~/Documents/project" --no-wait --json使用 监视持久化文件夹:
watchbash
mineru watch add "~/Documents"
mineru watch add "/Volumes/Archive" --removable
mineru watch list
mineru watch rescan "~/Documents"
mineru watch remove "~/Documents"Watch 规则:
- Watch 用于发现和搜索索引。
- Watch 默认使用 。
flash - Watch 结果不是最终阅读质量。
- 主动阅读仍应使用 或
mineru parse。mineru read - CLI 会统一处理本地路径参数,包括用户主目录展开、绝对路径和路径分隔符规范化。
- 对于 和
watch rescan,可以使用 watch id 或 watch 根路径。watch remove - 除非解析规则明确允许远程解析,否则 Watch 不会触发远程解析。
仅当用户希望为特定路径设置自动解析策略时,才使用解析规则:
bash
mineru config parsing-rules add "*/papers/*" --tier standard --pages all
mineru config parsing-rules add "*/contracts/*" --tier standard --remote
mineru config parsing-rules list
mineru config parsing-rules remove 3使用排除规则阻止发现:
bash
mineru config exclude-rules add "*/node_modules/*"
mineru config exclude-rules list
mineru config exclude-rules remove 5使用 让 MinerU 忘记某个文件或文件夹,但不删除源文件:
forgetbash
mineru forget "~/Documents/old.pdf"
mineru forget "~/Documents/project"
mineru forget "~/Documents/project" --no-dry-run使用 cleanup 进行本地维护:
bash
mineru cleanup deleted-files
mineru cleanup deleted-files --no-dry-run
mineru cleanup orphan-docs
mineru cleanup orphan-docs --no-dry-run
mineru cleanup temp
mineru cleanup temp --older-than 14规则:
- 不会删除源文件。
forget - 无法阻止被监视路径再次被发现。
forget - 如果目标是 watch 根路径,请先移除 watch。如果目标位于活动 watch 内,应警告用户之后的扫描可能再次发现它。
- 不会创建 watch。
scan - 只刷新文件发现状态;这并不表示摄取或解析已经完成。
scan - 和
cleanup deleted-files默认执行 dry-run;只有当用户确实希望执行实际清理时,才添加cleanup orphan-docs。--no-dry-run - 可以删除不再关联任何已知文件路径的文档缓存解析内容;仅在维护期间使用。
cleanup orphan-docs --no-dry-run
Reparse And Cache Control
重新解析与缓存控制
MinerU caches parse results for the same document and tier.
Force a new parse for the current request:
bash
mineru parse "report.pdf" --forceInvalidate cached parse results:
bash
mineru invalidate "report.pdf"
mineru invalidate "report.pdf" --tier standardRules:
- Prefer cached results for normal reading.
- Use when the user asks to reparse or when cached output is known stale or wrong; it skips done cache for this request but does not invalidate or delete old results.
--force - Use when the user wants future parses and reads to avoid existing done results; invalidation does not automatically start a new parse.
invalidate - Do not delete user files as part of cache control.
MinerU 会按文档和层级缓存解析结果。
强制为当前请求创建新的解析结果:
bash
mineru parse "report.pdf" --force使缓存的解析结果失效:
bash
mineru invalidate "report.pdf"
mineru invalidate "report.pdf" --tier standard规则:
- 正常阅读时优先使用缓存结果。
- 当用户要求重新解析,或者已知缓存输出过期或错误时,使用 ;它会跳过当前请求中已完成的缓存,但不会使旧结果失效或将其删除。
--force - 当用户希望未来的解析和读取避开现有已完成结果时,使用 ;使缓存失效不会自动启动新解析。
invalidate - 缓存控制过程中不要删除用户文件。
Configuration
配置
Show configuration:
bash
mineru config show
mineru config show --jsonSet or unset a value only when the user gives an explicit configuration key:
bash
mineru config get "<key>"
mineru config set "<key>" "<value>"
mineru config unset "<key>"Important environment variables:
| Variable | Meaning |
|---|---|
| MinerU home, default |
| API key for remote parsing when remote is explicitly allowed |
Rules:
- Remote URL/API key configuration does not authorize upload by itself.
- or a remote-enabled parsing rule is still required.
--remote - Avoid printing secrets from config.
显示配置:
bash
mineru config show
mineru config show --json仅当用户提供明确的配置键时,才设置或取消设置对应值:
bash
mineru config get "<key>"
mineru config set "<key>" "<value>"
mineru config unset "<key>"重要环境变量:
| 变量 | 含义 |
|---|---|
| MinerU 主目录,默认为 |
| 明确允许远程解析后用于远程解析的 API 密钥 |
规则:
- 配置远程 URL 或 API 密钥本身并不代表获得上传授权。
- 仍然需要使用 或启用远程的解析规则。
--remote - 避免打印配置中的敏感信息。
Remote API Usage
Remote API 使用情况
Query usage and limits for the configured Remote API:
bash
mineru usage
mineru usage --json查询已配置 Remote API 的使用情况和限制:
bash
mineru usage
mineru usage --jsonJSON Output
JSON 输出
Use when an agent needs stable machine-readable fields.
--jsonmineru parse --jsonjson
{
"parse": { "...": "parse summary" },
"content": { "...": "readable content and continuation data" }
}If parsing is still pending, timed out, or is used, may be .
--no-waitcontentnullErrors use:
json
{
"error": {
"type": "engine_error",
"code": "quality_tier_unavailable",
"message": "...",
"param": "tier",
"retryable": false,
"user_action": "...",
"docs_url": null
}
}Agent rules:
- Branch on , not on prose in
error.code.message - Respect .
retryable - Use to decide the next command or user-facing suggestion.
user_action - Do not strip locator fields from parsed content; they are needed for continuation and citation.
当 Agent 需要稳定的机器可读字段时,使用 。
--jsonmineru parse --jsonjson
{
"parse": { "...": "parse summary" },
"content": { "...": "readable content and continuation data" }
}如果解析仍在等待中、已经超时或使用了 ,则 可能为 。
--no-waitcontentnull错误使用以下格式:
json
{
"error": {
"type": "engine_error",
"code": "quality_tier_unavailable",
"message": "...",
"param": "tier",
"retryable": false,
"user_action": "...",
"docs_url": null
}
}Agent 规则:
- 根据 分支处理,而不是根据
error.code中的自然语言描述。message - 遵循 。
retryable - 使用 决定下一条命令或面向用户的建议。
user_action - 不要从解析内容中删除定位符字段;续读和引用需要这些字段。
Error Recovery
错误恢复
Normal-Quality Recovery Gate
正常质量恢复门控
When or is returned for an active document-reading request:
quality_tier_unavailableno_engine- Run to inspect locally available tiers and parse-server state.
mineru server status --json - If no local quality tier is available, follow Assess Local Hardware. Do not treat an unconfigured or disabled local parse server as proof that the hardware is unsupported.
- Present the currently available tiers. If hardware was assessed, also present the detected hardware and each applicable local tier's hardware status. Then follow the tier-choice guidance in the Quality Tiers section.
- Stop and wait for the user to choose a recovery path.
- Run only the selected path. If that path fails, report the failure and return to this decision gate with the remaining applicable choices.
Do not use another document parser before this gate unless the user already requested or authorized that fallback. A recoverable MinerU setup or tier error does not by itself mean that MinerU is unavailable.
Use this table for common error codes:
| Code | Meaning | Agent action |
|---|---|---|
| MinerU background service is unavailable | Run |
| Normal reading quality is unavailable | Follow the Normal-Quality Recovery Gate; do not fall back automatically |
| Requested tier is unavailable locally | Follow the Normal-Quality Recovery Gate; do not fall back automatically |
| Engine process unavailable | Retry if |
| Parsing service cannot be reached | Check |
| Requested tier unsupported | Ask user to choose a supported tier |
| MinerU could not parse the file | Report failure; suggest a different tier only if privacy rules allow |
| Parse exceeded timeout | Retry with longer |
| Memory or VRAM exhausted | Suggest lower quality, smaller |
| Remote might be needed but was not authorized | Ask user whether uploading is acceptable; do not add |
| API key invalid | Ask user to set a valid key |
| Remote quota exhausted | Suggest waiting or using local |
| Remote rate limit | Retry later if appropriate |
| Path or file id missing | Ask for correct path or run |
| Local file unreadable | Ask user to fix permissions |
| Format unsupported | Report unsupported type |
| Password-protected file | Ask user for an unlocked copy |
| File cannot be read | Ask for a valid copy |
| Bad PDF | Correct the PDF range or omit it for full-document parsing |
| The input is a directly readable text file | Read the source file directly; do not retry |
| Requested cached content does not exist | Run |
Retry rules:
- Retry once for transient server startup or explicitly retryable errors.
- Do not retry parse failures indefinitely.
- Do not change tier, pages, or remote/local privacy boundary without a reason.
- Do not add during recovery without user permission.
--remote
当活动文档读取请求返回 或 时:
quality_tier_unavailableno_engine- 运行 ,检查本地可用层级和 parse server 状态。
mineru server status --json - 如果没有可用的本地质量层级,请遵循检查本地硬件。不要将未配置或已禁用的本地 parse server 当作硬件不受支持的证据。
- 提供当前可用的层级。如果已经检查硬件,还应提供检测到的硬件信息及各适用本地层级的硬件状态。随后遵循质量层级章节中的层级选择指导。
- 停止操作并等待用户选择恢复路径。
- 仅运行用户选择的路径。如果该路径失败,报告失败情况,并返回此决策门控,提供其余适用选项。
除非用户已经要求或授权回退,否则在此门控之前不要使用其他文档解析器。可恢复的 MinerU 设置或层级错误本身并不表示 MinerU 不可用。
常见错误代码如下:
| 代码 | 含义 | Agent 操作 |
|---|---|---|
| MinerU 后台服务不可用 | 运行 |
| 正常阅读质量不可用 | 遵循正常质量恢复门控;不要自动回退 |
| 请求的层级在本地不可用 | 遵循正常质量恢复门控;不要自动回退 |
| 引擎进程不可用 | 如果 |
| 无法连接解析服务 | 检查 |
| 不支持请求的层级 | 要求用户选择受支持的层级 |
| MinerU 无法解析文件 | 报告失败;仅当隐私规则允许时才建议使用其他层级 |
| 解析超过超时时间 | 使用更长的 |
| 内存或 VRAM 耗尽 | 建议使用较低质量、更小的 |
| 可能需要远程解析,但尚未获得授权 | 询问用户是否允许上传;不要自行添加 |
| API 密钥无效 | 要求用户设置有效密钥 |
| 远程配额已用尽 | 建议等待或使用本地解析 |
| 触发远程速率限制 | 适当时稍后重试 |
| 缺少路径或文件 ID | 要求提供正确路径或运行 |
| 无法读取本地文件 | 要求用户修复权限 |
| 不支持该格式 | 报告不支持的文件类型 |
| 文件受密码保护 | 要求用户提供已解锁副本 |
| 无法读取文件 | 要求用户提供有效副本 |
| PDF | 更正 PDF 页面范围,或省略该参数以解析完整文档 |
| 输入是可直接读取的文本文件 | 直接读取源文件;不要重试 |
| 请求的缓存内容不存在 | 运行 |
重试规则:
- 对于临时性的服务器启动问题或明确标记为可重试的错误,只重试一次。
- 不要无限重试解析失败。
- 不要在没有明确原因的情况下更改层级、页面范围或远程/本地隐私边界。
- 恢复期间未经用户许可,不得添加 。
--remote
Answering Users With MinerU Output
使用 MinerU 输出回答用户
When answering after reading a document:
- Use the parsed content, not assumptions about the document.
- Cite locators when the user needs traceability.
- Prefer concise quotations and page/block references over large copied passages.
- If content was truncated, say that the answer is based on the pages/blocks read so far.
- Continue reading before making claims that require unread sections.
- For tables, formulas, figures, or layout-sensitive questions, read the relevant page/block and use image output if needed.
Citation style examples:
text
The warranty period is 24 months (doc:ab12cd3/tier:standard/page:7/block:3).text
The method is described across pages 4-5; I checked doc:ab12cd3/tier:standard/page:4 and doc:ab12cd3/tier:standard/page:5.读取文档后回答问题时:
- 使用解析后的内容,而不是对文档进行推测。
- 当用户需要可追溯性时,引用定位符。
- 优先使用简洁引文和页面或区块引用,而不是复制大段内容。
- 如果内容被截断,应说明答案仅基于目前已读取的页面或区块。
- 在作出依赖尚未读取部分的结论前,继续读取相关内容。
- 对于表格、公式、图形或与布局相关的问题,读取相关页面或区块,并在必要时使用图像输出。
引用样式示例:
text
The warranty period is 24 months (doc:ab12cd3/tier:standard/page:7/block:3).text
The method is described across pages 4-5; I checked doc:ab12cd3/tier:standard/page:4 and doc:ab12cd3/tier:standard/page:5.Operating Rules
操作规则
- Do not use as default final reading quality.
flash - Do not reparse when a valid locator and cached result are enough.
- Do not ignore continuation commands.
- Do not load a whole long document when page/block continuation can answer the question.
- Do not delete source files.
- Do not expose secrets, API keys, or unnecessary local paths.
- Do not branch on human prose when JSON or
error.codeis available.next_request
- 不要将 作为默认的最终阅读质量。
flash - 当有效定位符和缓存结果已足够时,不要重新解析。
- 不要忽略续读命令。
- 当可以通过页面或区块续读回答问题时,不要加载整个长文档。
- 不要删除源文件。
- 不要暴露敏感信息、API 密钥或不必要的本地路径。
- 当 JSON 中的 或
error.code可用时,不要根据自然语言描述进行分支判断。next_request