Docling Rust SDK (docling.rs / docling-rs)#
Overview#
docling.rs is the official full Rust port of the Python docling library, hosted under docling-project on GitHub . It converts documents (PDF, DOCX, HTML, XLSX, PPTX, EPUB, and many more) into DoclingDocument — the same unified format used by the Python pipeline — for downstream AI workflows. The project is experimentally available as a Python package (docling-rs) on PyPI , and also ships Node.js/Bun bindings (docling.rs on npm) and a WebAssembly build for in-browser conversion.
The repository originated from a community-contributed Rust rewrite and was officially adopted by the docling-project GitHub organization .
Format Support#
The format migration is described as complete in the README . Supported input/output formats include:
- Declarative: Markdown, CSV, HTML, AsciiDoc, DOCX, PPTX, XLSX, legacy DOC/XLS/PPT, EPUB, ODF, WebVTT, Email, MHTML, JATS, USPTO, XBRL, LaTeX, JSON, DocTags (
.doctags/.dt), DocLang (.dclg/.dclx) - ML pipeline: PDF, images, METS, audio (via Whisper ASR), video
- MHTML is a
docling.rs-only extension — Python docling has no MHTML backend . Requested in issue #659,docling-rswas cited as the solution .
Performance vs. Python#
Benchmarks from scripts/test/performance.sh (Python docling ÷ docling.rs — higher = Rust wins by more) :
| Format | Peak-memory ratio | Warm-conversion speedup |
|---|---|---|
| 2.3× less | 2.3× | |
| DOCX | 41× less | 21× |
| HTML | 57× less | 46× |
| JATS XML | 61× less | 10× |
| XLSX | 59× less | 12× |
| PPTX | 57× less | 4.4× |
Community benchmarks on a DOCX file showed 736× faster end-to-end (whole process) and 54× less peak memory; for a multi-page PDF, 4.3× faster end-to-end and 4.8× less memory .
For chunking: a large 14 MB HTML file that took ~2 hours with Python HybridChunker (O(N²) tokenization bottleneck) was chunked in ~2 min 49 s with docling-rs .
INT8 quantized models (fetched by default) give an additional ~2.4× layout-inference speedup on CPUs with AVX-512 VNNI, ~1.4–1.8× end-to-end .
GPU (docling-rs-cuda): 1.5–2.1× end-to-end on multi-page digital PDFs; 8.7× on a 1913-page manual .
Python Bindings (docling-rs on PyPI)#
Install (CPU):
pip install docling-rs
GPU (Linux x86-64, CUDA 12 + cuDNN 9):
pip install docling-rs-cuda
- Latest release: 0.52.4 (August 1, 2026)
- Wheels:
abi3(Python ≥ 3.9), Linux x86-64/arm64 (manylinux_2_28), Windows x86-64. macOS users install from the sdist (source build). - Only the document processor is Rust.
result.documentis a genuinedocling_core.DoclingDocument— all of docling's Python serializers (export_to_markdown(),export_to_dict(),export_to_doctags()) and chunkers work unchanged . - Models (~700 MB) are fetched on first use via
docling_rs.download_models()to~/.cache/docling.rs.
Migration from Python docling#
The migration guide in crates/docling-py/README.md describes a three-step process :
- Swap the package:
pip install docling-rs(coexists withdocling) - Rewrite imports:
docling.→docling_rs.(mechanical rename) - Fetch models:
python -c "import docling_rs; docling_rs.download_models()"
Known divergences: full-VLM pipeline (SmolDocling), per-format backend selection, and inline formatting rendered as text rather than structured formatting fields. HybridChunker(tokenizer=...) takes a path to a tokenizer.json (no transformers install required).
Crate Layout#
| Crate | Role |
|---|---|
docling-core | DoclingDocument model + serializers |
docling | DocumentConverter, source loading, backends |
docling-pdf | PDF/image ML pipeline (pdfium + ONNX) |
docling-asr | Audio/ASR pipeline (symphonia + ONNX Whisper) |
docling-cli | Command-line interface |
docling-serve | HTTP conversion API (warm pipeline) |
docling-node | Node.js/Bun N-API bindings |
docling-py | Python bindings (PyO3/maturin) |
docling-wasm | WebAssembly (declarative converters, no ML, browser-only) |
docling-rag | RAG layer: chunking, embeddings, vector search, REST API |
Key References#
- Repository: github.com/docling-project/docling.rs
- PyPI: pypi.org/project/docling-rs
- PyPI (GPU): pypi.org/project/docling-rs-cuda
- npm: npmjs.com/package/docling.rs
- Browser demo: docling-project.github.io/docling.rs
- Python migration guide:
crates/docling-py/README.md - PDF conformance / perf details:
docs/PDF_CONFORMANCE.md - Architecture & Python→Rust mapping:
docs/MIGRATION.md