agentleFS
28672032962867203296/hermes-agent/skills/productivity/mineru/SKILL.md

mineru

Skill0 starsChanged 3 months agoMITView on GitHub

MinerU PDF→Markdown: install, CLI usage, backend selection, Windows no-GPU notes.

  • Installs packages

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

MinerU — PDF → Markdown

Opendatalab 出品,magic-pdf 的后继者。v3.4.0 起是 namespace package,安装 mineru[core]。 约 2GB 依赖(torch + transformers + onnxruntime),无需 GPU 可用 pipeline 后端。

快速安装 (Windows, no GPU)

# 标准安装
uv pip install "mineru[core]" --python "D:/Hermes/hermes-agent/.venv/Scripts/python.exe"

# 国内网络用腾讯云镜像(2026-06 实测最稳)
uv pip install "mineru[core]" --python "D:/Hermes/hermes-agent/.venv/Scripts/python.exe" \
  -i https://mirrors.cloud.tencent.com/pypi/simple/

安装后验证:

uv pip list --python "<venv-python>" | grep mineru
# mineru 3.4.0, mineru-vl-utils 1.0.5

python -c "from mineru import version; print(version.__version__)"
# 3.4.0

CLI 核心用法

# 基础转换(pipeline 后端,中文 OCR)
python -m mineru.cli.client -p input.pdf -o ./output -b pipeline -l ch

# 高精度(hybrid engine,含图表分析)
python -m mineru.cli.client -p input.pdf -o ./output -b hybrid-engine --effort high -l ch

# 纯文本提取(跳过 OCR,最快)
python -m mineru.cli.client -p input.pdf -o ./output -m txt -b pipeline -l ch

# 指定页码范围(0-indexed)
python -m mineru.cli.client -p input.pdf -o ./output -s 0 -e 5 -b pipeline -l ch

# 远程 API(无需本地 GPU)
python -m mineru.cli.client -p input.pdf -o ./output -b vlm-http-client -u http://server:30000 -l ch

CLI 参数速查

Flag默认值说明
-p / --path(必填)输入文件或目录,支持 pdf/image/docx/pptx/xlsx
-o / --output(必填)输出目录
-b / --backendhybrid-enginepipeline / vlm-engine / hybrid-engine / vlm-http-client / hybrid-http-client
-m / --methodautoauto / txt / ocr(pipeline 和 hybrid 后端适用)
-l / --langchch, ch_server, korean, arabic, east_slavic, cyrillic, devanagari 等
--effortmediumhybrid 后端可用 high 开启图表/图片分析
-s / --start0起始页(0-indexed)
-e / --end末页结束页(0-indexed)

后端选型(无 GPU Windows)

后端需要适用场景
pipelineCPU only通用文档、中文 PDF首选
vlm-http-client远程 VLM 服务无本地 GPU,高精度
hybrid-http-client远程服务 + 本地 CPU无本地 GPU,平衡精度和速度
vlm-engine本地 GPU最高精度、复杂版面
hybrid-engine本地 GPU + CPU默认,速度与精度平衡

无 GPU 推荐:先用 pipeline(稳定),需要更高精度时切 vlm-http-client 指向远程 GPU 服务。

包结构(非显而易见)

  • mineru 是 namespace package:__init__.py 仅 50 字节,dir(mineru) 为空
  • 实际代码在子目录:mineru.cli.client(CLI 入口)、mineru.backend、mineru.model、mineru.utils
  • 没有 magic_pdf 包——v3.x 已将旧 magic-pdf 合并进 mineru
  • 正确的 import:from mineru.cli.client import ...(或直接用 CLI)

常见坑

uv 锁冲突

同时跑多个 uv pip install 会抢 D:\sofeware\cache\uv\ 的锁。错误信息:

Timeout (300s) when waiting for lock on `D:\sofeware\cache\uv\wheels-v6\pypi\...`

修法:kill 掉多余的进程,留一个就行。或设 UV_LOCK_TIMEOUT=600。

pip 不在 venv 里

Hermes 的 venv 精简过,没有 pip。用 uv pip install,不要用 python -m pip。

python -m mineru.cli.client --help 卡住

首次运行可能在做模型预热,用 --version 快速验证安装即可。

中文镜像不稳定

清华镜像 (tuna) 和阿里云镜像在 2026-06 实测超时。 腾讯云镜像 mirrors.cloud.tencent.com 可用。 PyPI 直连 files.pythonhosted.org 也可用(慢但不断)。

与其他工具对比

pymupdf (~25MB)marker-pdf (~3-5GB)MinerU (~2GB)
文本 PDF✅✅✅
复杂版面❌✅✅
表格基础✅✅
OCR 扫描件❌✅✅
远程 API❌❌✅
多后端无单一5 种
安装速度秒级分钟级5-15 分钟

MinerU 是 marker-pdf 的强力替代品——更多后端选择,原生支持远程推理。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.