Command-line utility to parse documents using VLM backends (vlm-sglang-engine or vlm-sglang-client)
Project description
MinerU CLI
MinerU CLI is a command-line wrapper around the OpenDataLab MinerU library. It provides:
- Robust error handling to isolate and report failures per document without halting the entire batch.
- PDF preprocessing via PyMuPDF, avoiding pdfmium decoding/encoding errors and improving stability.
🚀 Features
-
Flexible Input: Accepts single files, directories, or glob patterns (
*.pdf). -
Multiple Backends: Choose between local (
vlm-sglang-engine) or client/server (vlm-sglang-client) modes. -
Rich Outputs:
- Original PDF copy
- Markdown summary
- Content list JSON
- Middle-layer JSON
- Raw model output text
-
Visualizations:
- Layout bounding boxes
- Span bounding boxes
-
Configurable via command-line flags for fine control over what gets generated.
-
Isolated Processing: Each document is processed independently with detailed logging.
📦 Installation
MinerU CLI is available via pip. From the project root:
pip install .
Or install directly from GitHub:
pip install git+https://github.com/DotIN13/mineru-cli.git
This will install the mineru-cli executable in your environment.
⚙️ Usage
Basic Command
mineru-cli \
--input path/to/doc.pdf \
--output ./out_dir
Users can choose between two processing modes:
-
Local processing with the built-in engine:
mineru-cli --backend vlm-sglang-engine --input file.pdf --output out_dir
-
Client/server mode for improved performance:
-
First, start the server:
export MINERU_MODEL_SOURCE=modelscope # modelscope, huggingface or local mineru-sglang-server
-
Then run:
mineru-cli --backend vlm-sglang-client \ --server-url http://127.0.0.1:30000 \ --input docs/*.pdf \ --output results
-
Options
| Flag | Description |
|---|---|
-i, --input |
Files, directories, or glob patterns to parse (required) |
-o, --output |
Directory to write output files (required) |
-b, --backend |
vlm-sglang-engine or vlm-sglang-client (default: engine) |
-u, --server-url |
URL for client backend mode |
--no-layout-box |
Disable layout bounding box visualizations |
--span-box |
Enable span bounding box visualizations |
--no-md |
Do not dump Markdown output |
--no-middle-json |
Do not dump intermediate JSON |
--no-model-output |
Do not dump raw model output |
--no-orig-pdf |
Do not copy original PDF to output |
--no-content-list |
Do not dump content list JSON |
🛠️ Development
Clone the repo and install:
git clone https://github.com/DotIN13/mineru-cli.git
cd mineru
pip install -e .
🤝 Contributing
Contributions are welcome! Please open issues or pull requests for:
- Feature requests
- Bug reports
- Improvements to CLI or documentation
Be sure to follow existing code style and add tests where appropriate.
📄 License
This project is licensed under the AGPL-3.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mineru_cli-0.1.1.tar.gz.
File metadata
- Download URL: mineru_cli-0.1.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ac10ec189e7caf24afa9a7ef331d2f3f014b9404bba9bce0d31c9489a9ea1eb
|
|
| MD5 |
9b872174334ef66e62bd840f039a75b2
|
|
| BLAKE2b-256 |
e95750ad3f6ff90e564e0fcd3f07f3b791da3ff51660df3bcf7bbd19f1122cb9
|
File details
Details for the file mineru_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mineru_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
292fb833ad528f4d318a2f3e878aff15e6bf93c8175fa0bd84734854970dadac
|
|
| MD5 |
a2cd02dd60775c0e2eecb3bd2a5e7143
|
|
| BLAKE2b-256 |
aedbeb42c765834a62cede5ad222dc8a098407c7f664927822369d3aade633e0
|