Pure Rust Β· zero runtime deps Β· single ~29 MB binary

Turn any document into
citable, structured data

A fast, pure-Rust document parser built for agents & RAG. Extract positioned, structured content from 12+ formats β€” every chunk citable with page + bbox.

Like fast, dependency-free infra? β˜… a star helps others find it.

<10 ms
warm parse
~700
pages / sec
12+
formats in-process
~29 MB
one binary
100%
bbox coverage
One binary. Every format. No JVM Β· No C++ Β· No Python.
PDFDOCXHTML XLSXPPTXMarkdown CSVSRT / VTTLaTeX EMLPNG / JPEGAsciiDoc

Built for retrieval that cites its sources

It takes the structure-extraction fast path β€” interpreting PDF content streams for coordinates instead of rendering pages to pixels β€” so output is byte-identical and parses are sub-10 ms.

πŸ¦€

One pure-Rust binary

~29 MB, zero runtime deps, <10 ms warm parse (~700 pages/s). Drop it on a server, a laptop, or a CI box β€” no environment to set up.

πŸ“

RAG-native citations

Every chunk carries page + bbox + heading breadcrumbs. Reverse locate(x, y) lookup, with 100% coverage β€” answers that point back to the exact spot on the page.

πŸ”Œ

Four faces, one output

CLI Β· library Β· MCP (stdio) Β· REST β€” and the output is byte-identical across all four. Wire it straight into an agent.

πŸ”

In-process OCR

--ocr runs ONNX on tract (PP-OCRv6 tiny by default). Digital-text pages pass through; routed PDF pages use embedded pixels or render their final appearance on demand. ~7 MB fetched on first use.

🧠

Embedded models, opt-in

Merged-cell table structure, formula β†’ LaTeX, full-page transcription (UniRec-0.1B), plus PP-DocLayoutV2 / DocLayout-YOLO layout. None of it baked into the binary.

πŸ›‘οΈ

Safe by default

Hidden-text filtering (flagged & auditable, never silently dropped), zip-bomb & page-count guards, per-page complexity profiling. The deterministic core stands alone.

bash
# build once β€” no toolchain zoo, just cargo
$ cargo build --release

# full IR: provenance + coordinates
$ docparse input.pdf -f json

# clean Markdown
$ docparse input.pdf -f markdown

# RAG chunks β€” page + bbox + breadcrumbs
$ docparse input.pdf -f chunks

# OCR pages without machine-readable text
$ docparse scan.pdf --ocr

Up and running in one command

No JVM, no C++ build chain, no Python venv. Build the binary, point it at a file, pick an output format. Born-digital PDFs and every other format parse with zero downloads.

Full quick start β†’

Plug straight into your agent

Register it as an MCP server, or run the local REST endpoint. Same parser, same byte-identical output β€” pick the surface that fits your stack.

Integration docs β†’
agent
# MCP tools: parse_document / get_chunks / locate
$ claude mcp add docparse -- docparse mcp

# local REST (binds 127.0.0.1)
$ docparse serve --port 8642
$ curl -F "file=@doc.pdf" \
    "http://127.0.0.1:8642/parse?format=chunks"

# Python / LangChain β€” zero-dep thin client
from docparse_client.langchain import DocparseLoader
docs = DocparseLoader("paper.pdf").load()

Scored against human ground truth

Evaluated on OmniDocBench (CVPR 2025) using the embedded UniRec models. Text and formula land near paper level.

0.872
Text recognition
--transcribe-model Β· papers
0.874
Formula β†’ LaTeX
--formula-model Β· papers
0.810
Table structure
--table-model Β· median 0.895

A proxy β€œOverall” β‰ˆ 75 puts docparse-rs in the pipeline-tool tier (Marker 78, Docling ~80–85) β€” all from one zero-dependency binary. Full method, caveats & leaderboard β†’

How it compares

The same job other tools do with a JVM, PDFium/Tesseract C++ deps, or a multi-GB Python env β€” in one self-contained Rust binary.

docparse-rsliteparseDoclingMarkItDown
Deploypure-Rust ~29 MB, zero depsRust + PDFium/Tesseract (C++)Python + models (GB env)Python
PDF engineown content-stream interpreterwraps PDFiumowndelegates
Determinismbyte-identical default pathdeterministicnot strictlydeterministic
Citationspage+bbox both ways, 100%bbox per text elementelement-levelnone
OutputJSON / MD / text / RAG chunksJSON / text / PNGMarkdown / JSONMarkdown
Formats12, all in-processPDF native; rest external15+20+
Speed (born-digital)<10 ms / ~700 pg/sfastseconds/pagefast

Honest about tradeoffs: Docling's neural layout has a higher ceiling on the hardest layouts; MarkItDown covers more long-tail formats; non-zh/en OCR (RTL / Korean) isn't covered yet. Detailed comparison β†’

A core that owes nothing to the AI

A Cargo workspace of 17 crates. The deterministic core stands alone; neural models attach only where they earn their keep.

πŸ—οΈ Deterministic by design

  • core depends on no PDF library β€” reading order & output are format-agnostic; adding a format is one trait + one registry line.
  • A self-built PDF content-stream interpreter β€” a graphics/text matrix state machine emitting positioned chunks.
  • An independent font layer (ToUnicode CMap / AFM / Encoding), with veraPDF as the algorithmic reference only β€” no copied code.
  • Per-page rayon parallelism; identical input β†’ byte-identical output.

🧩 Models at the boundary

  • Neural models never enter the core β€” they attach per page through an Enhancer boundary.
  • Only a hard page routed to a model is ever rendered β€” on demand, in pure Rust.
  • Every model output carries a source tag + capped confidence, so provenance is always traceable.
  • All optional models are Apache-2.0, fetched as external files β€” never baked into the binary.

If this is the parser you wish you'd had,
give it a star

Open source, Apache-2.0, pure Rust. Stars help others find it β€” and tell us to keep pushing.