Skip to main content

MinerU Rust

English | 简体中文

Rust client library, command-line tools, and local API server for parsing PDF, image, and Office documents with an external OpenAI-compatible MinerU VLM service. PDF rendering uses pure Rust; no model is downloaded or run locally.

Within the MinerU 3.4.4 VLM scope, MinerU Rust is a drop-in replacement for the MinerU Python SDK's vlm-http-client path and can replace that VLM workflow completely. It does not implement or claim compatibility with non-VLM backends. See the compatibility contract, the Chinese usage guide, and the English usage guide. Document-limit controls and their CLI/API applicability are summarized in the usage guides.

Requires Rust 1.89 or newer.

Quickstart

Configure the VLM service with three environment variables:

Variable Meaning Example
MINERU_VL_SERVER VLM service base URL https://host/v1
MINERU_VL_MODEL_NAME Model ID model-id
MINERU_VL_API_KEY Bearer token your-key

Install the mineru command with Cargo, pip, or npm:

cargo install mineru            # Rust
pip install mineru-rs           # Python
npm install @alexsun-top/mineru # Node.js

Then parse a document:

mineru -p input.pdf -o out/

Your markdown appears in out/.

Rust library

cargo add mineru
use mineru::{ClientConfig, MinerUClient, ParseOptions, PdfInput};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = MinerUClient::new(ClientConfig::new(
        "https://example.test/v1",
        "model-id",
    )?)?;
    let document = client
        .parse_pdf(PdfInput::Path("input.pdf".into()), ParseOptions::default())
        .await?;
    println!("{} pages", document.pages.len());
    Ok(())
}

Python

Wheels support CPython 3.9 and newer. Install with uv or pip:

uv add mineru-rs
# or: pip install mineru-rs

parse() returns the markdown string in memory; save it yourself:

import asyncio
from pathlib import Path

import mineru_rs


async def main() -> None:
    result = await mineru_rs.parse("input.pdf")
    Path("out.md").write_text(result.markdown, encoding="utf-8")


asyncio.run(main())

run() writes the full output tree to an output directory instead (see the English usage guide). The wheel installs two equivalent console commands, mineru and mineru-rs; prefer mineru-rs when the upstream Python mineru package is also installed, since both provide a mineru entry point and the one earlier on PATH wins. Releases are wheels only; there is no sdist or source fallback for unsupported platforms or PyPy.

Node.js

Requires Node.js 18 or newer. Install with pnpm or npm:

pnpm add @alexsun-top/mineru
# or: npm install @alexsun-top/mineru
const fs = require('fs')
const mineru = require('@alexsun-top/mineru')

async function main() {
  const { markdown } = await mineru.parse({ path: 'input.pdf' })
  fs.writeFileSync('out.md', markdown)
}

main()

run({ path, output }) writes the full output tree to output instead (see the English usage guide). The root package installs two equivalent binaries, mineru and mineru-rs, both pointing at bin/mineru.js; prefer mineru-rs if another mineru command is already on PATH.

CLI and API server

cargo install mineru
mineru --help

The package installs the mineru, mineru-api, mineru-vlm, and mineru-vlm-api binaries. To also install the mineru-office-convert Office conversion helper, build with --features office:

cargo install mineru --features office

--api-key can pass a Bearer token, but prefer MINERU_VL_API_KEY: a key on the command line is visible in the process list.

See the Chinese usage guide or English usage guide for service configuration and complete options.

Examples

License

Licensed under either Apache-2.0 or MIT, at your option.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mineru_rs-0.2.5-cp39-abi3-win_amd64.whl (35.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

mineru_rs-0.2.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (40.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

mineru_rs-0.2.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (38.9 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

mineru_rs-0.2.5-cp39-abi3-macosx_11_0_arm64.whl (37.7 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

mineru_rs-0.2.5-cp39-abi3-macosx_10_12_x86_64.whl (38.1 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file mineru_rs-0.2.5-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: mineru_rs-0.2.5-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 35.6 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mineru_rs-0.2.5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 43e8685d440ea53de79d69d25f222a3d412cef6d51d82da5767a0f210ff34f77
MD5 1a9ffab5a51908214092ab7da44176fe
BLAKE2b-256 dc7f8bcc345c2f1f496257bcc6d8f9c757580a7d789b2f79a54212cf2a166191

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.2.5-cp39-abi3-win_amd64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mineru_rs-0.2.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.2.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1448590e9bc236aa0401a8c875177afca7005abde46671036c811cad4b3f40a7
MD5 f6524ebf8a09bc35d70f63b2856e6eb3
BLAKE2b-256 00c23b2f42e1906bf468213647c4c417edd9db37a958d15d230f440e11c072ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.2.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mineru_rs-0.2.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.2.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6666e399cd5c21243dcdebd5bc81527eeb5d4b48d85b3ca9877255e9f6d253c5
MD5 5a969afd722026556ee8c62d908964a7
BLAKE2b-256 3e14f5bcf6d4d348f32745137c0125d776a258a06c98ff9f0585d0366d3ebf41

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.2.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mineru_rs-0.2.5-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.2.5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c78fa77192c883f080bcdd97b4e46f4e644bb35f09fb5ab44109c93e0d39a15d
MD5 4d408a2b715de8e8ac9b0547a1210b02
BLAKE2b-256 edff677171c284a2f819e8ebc44ad7a29de724d7fb28bcbae1ecd67a3b9d42dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.2.5-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mineru_rs-0.2.5-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.2.5-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4b979cfc51a12bef45d236d137f56a1829ade726c96e2edd95cdc92166531654
MD5 3e1128ef7a3f30642421785c5b49de53
BLAKE2b-256 ad56013eb212d0bd770ddc4885731667d4410c992acab938c2c4a2e887c2ac40

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.2.5-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.0

5 files

0.2.9

5 files

0.2.8

5 files

0.2.7

5 files

0.2.6

5 files

This release

0.2.5 This release

5 files

0.2.4

5 files

0.2.3

5 files

0.2.2

5 files

0.2.1

5 files

0.2.0

5 files

0.1.1

5 files

0.1.0

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page