Skip to content
Back to search

docling.rs

Full Rust port of Python docling

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/docling-project/docling.rs with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/docling-project/docling.rs'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/docling-project--docling-rs/badge.svg)](/listings/docling-project--docling-rs)

HTML

<a href="/listings/docling-project--docling-rs"><img src="/api/listings/docling-project--docling-rs/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

# CLI + models (Linux x64/arm64 prebuilt; builds from source elsewhere)
curl -fsSL https://raw.githubusercontent.com/docling-project/docling.rs/master/scripts/install/install.sh | bash
docling-rs example.pdf          # Markdown on stdout

# or from crates.io; --cli puts the models where the installed binary looks
cargo install docling-cli
curl -fsSL https://raw.githubusercontent.com/docling-project/docling.rs/master/scripts/install/download_dependencies.sh | sh -s -- --cli

pip install docling-rs          # Python — drop-in for docling's and MarkItDown's APIs
npm install docling.rs          # Node.js / Bun
cargo add docling               # Rust library

# containers, models baked in (-cuda variants for NVIDIA)
docker run --rm -v "$PWD:/data" ghcr.io/docling-project/docling-rs paper.pdf
docker run -p 127.0.0.1:5001:5001 ghcr.io/docling-project/docling-rs-serve

Office, HTML, Markdown and e-mail need no models. PDF, images and audio need the ONNX models (layout, OCR, TableFormer, Whisper; under 1 GB): `install.sh`, `--cli` and the containers bring them along; with `pip`, run `python -c "import docling_rs; docling_rs.download_models()"` once; with `npm` or a checkout, run `download_dependencies.sh` where you convert ([details](#getting-the-ml-models)). Windows: [`docs/WINDOWS.md`](./docs/WINDOWS.md).

**▶ [Try it in your browser](https://docling-project.github.io/docling.rs/)** first — the converter as wasm, OCR included; nothing leaves your device.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 569 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # docling.rs
  2. <p align="center">
  3. <img src="https://raw.githubusercontent.com/docling-project/docling.rs/refs/heads/master/docs/assets/logo.svg" alt="docling.rs — a duck feeding a document into a meat grinder" width="240">
  4. </p>
  5. <p align="center">
  6. <a href="https://github.com/docling-project/docling.rs/actions/workflows/ci.yml"><img src="https://github.com/docling-project/docling.rs/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
  7. <a href="https://docling-project.github.io/docling.rs/"><img src="https://img.shields.io/badge/demo-live-brightgreen" alt="Live browser demo"></a>
  8. <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/github/license/docling-project/docling.rs" alt="License MIT"></a>
  9. <a href="https://crates.io/crates/docling"><img src="https://img.shields.io/crates/v/docling?logo=rust" alt="crates.io version"></a>
  10. <a href="https://pypi.org/project/docling-rs/"><img src="https://img.shields.io/pypi/v/docling-rs?logo=pypi&logoColor=fff" alt="PyPI version"></a>
  11. <a href="https://www.npmjs.com/package/docling.rs"><img src="https://img.shields.io/npm/v/docling.rs?logo=npm&logoColor=fff" alt="npm version"></a>
  12. <a href="https://github.com/docling-project/docling.rs/releases"><img src="https://img.shields.io/github/v/release/docling-project/docling.rs?label=release&logo=github" alt="GitHub release"></a>
  13. <a href="https://crates.io/crates/docling"><img src="https://img.shields.io/crates/d/docling?label=crates.io%20downloads" alt="crates.io downloads"></a>
  14. <a href="https://pepy.tech/projects/docling-rs"><img src="https://static.pepy.tech/badge/docling-rs/month" alt="PyPI downloads/month"></a>
  15. <a href="https://www.npmjs.com/package/docling.rs"><img src="https://img.shields.io/npm/dm/docling.rs?label=npm%20downloads" alt="npm downloads/month"></a>
  16. </p>
  17. **docling.rs** converts documents — PDF, Office, HTML, scans, audio — into
  18. Markdown, docling JSON and the other shapes an LLM or a RAG pipeline can
  19. read. It is a Rust port of IBM's
  20. [docling](https://github.com/docling-project/docling): the same output,
  21. byte-for-byte, from one static binary. No Python, no PyTorch.
  22. Pulling text out of a PDF is easy. Keeping its *structure* — headings in
  23. order, tables as tables, scanned pages read — takes layout analysis, table
  24. recognition and OCR. docling has the models for that, and a Python stack to
  25. match. docling.rs runs the same models from a single binary: PDF 4.3× faster
  26. than Python docling at under half the RAM, Office and HTML 20–60× faster, and
  27. tables that survive — cell recall 0.94 where MarkItDown gets 0.31
  28. ([numbers](#conformance-with-microsoft-markitdown),
  29. [method](./docs/PERFORMANCE.md#review--profiling-notes)).
  30. **Coming from [MarkItDown](https://github.com/microsoft/markitdown)?**
  31. `pip install docling-rs`, swap one import —
  32. `from docling_rs.markitdown import MarkItDown` — and keep its API, every
  33. format it converts included, with real layout analysis, tables and OCR
  34. behind it: [guide](./docs/MARKITDOWN.md),
  35. [measured side by side](#conformance-with-microsoft-markitdown).
  36. **Coming from [Marker](https://github.com/datalab-to/marker)?**
  37. `pip install docling-rs`, swap the imports —
  38. `from docling_rs.marker.converters.pdf import PdfConverter` — and keep its
  39. API: `create_model_dict`, `text_from_rendered`, the JSON block tree, chunks,
  40. `marker_single`'s CLI and output layout, with docling's layout analysis,
  41. TableFormer and OCR behind it and no PyTorch or inference server:
  42. [guide](./docs/MARKER.md), [measured side by side](#conformance-with-marker).
  43. **Coming from [MinerU](https://github.com/opendatalab/MinerU)?**
  44. `pip install docling-rs`, swap the imports —
  45. `from docling_rs.mineru.parser import parse` — and keep MinerU 4's SDK:
  46. `ParseResult`, `markdown()`, the Middle JSON, Content Lists and Structured
  47. Content, `save()`'s layout and `mineru-kit parse`, with docling's layout
  48. analysis, TableFormer and OCR behind it and no DocVortex or llama.cpp:
  49. [guide](./docs/MINERU.md), [measured side by side](#conformance-with-mineru).
  50. ## Install
  51. ```bash
  52. # CLI + models (Linux x64/arm64/s390x + macOS arm64 prebuilt; builds from source elsewhere)
  53. curl -fsSL https://raw.githubusercontent.com/docling-project/docling.rs/master/scripts/install/install.sh | bash
  54. docling-rs example.pdf # Markdown on stdout
  55. # or from crates.io; --cli puts the models where the installed binary looks
  56. cargo install docling-cli
  57. curl -fsSL https://raw.githubusercontent.com/docling-project/docling.rs/master/scripts/install/download_dependencies.sh | sh -s -- --cli
  58. pip install docling-rs # Python — drop-in for docling's, MarkItDown's, Marker's and MinerU's APIs
  59. npm install docling.rs # Node.js / Bun
  60. cargo add docling # Rust library
  61. # containers, models baked in (-cuda variants for NVIDIA)
  62. docker run --rm -v "$PWD:/data" ghcr.io/docling-project/docling-rs paper.pdf
  63. docker run -p 127.0.0.1:5001:5001 ghcr.io/docling-project/docling-rs-serve
  64. ```
  65. Office, HTML, Markdown and e-mail need no models. PDF, images and audio need
  66. the ONNX models (layout, OCR, TableFormer, Whisper; under 1 GB): `install.sh`,
  67. `--cli` and the containers bring them along; with `pip`, run
  68. `python -c "import docling_rs; docling_rs.download_models()"` once; with `npm`
  69. or a checkout, run `download_dependencies.sh` where you convert
  70. ([details](#getting-the-ml-models)). Windows: [`docs/WINDOWS.md`](./docs/WINDOWS.md).
  71. **▶ [Try it in your browser](https://docling-project.github.io/docling.rs/)**
  72. first — the converter as wasm, OCR included; nothing leaves your device.
  73. ## Use
  74. ```bash
  75. docling-rs report.pdf > report.md # Markdown (streamed page by page)
  76. docling-rs report.pdf --to json # docling JSON; also html, text, latex, dclx, chunks, images
  77. docling-rs --input ./docs --output ./out # a directory tree; --jobs N in parallel
  78. docling-rs https://example.com/paper.pdf # URLs, data: URIs and stdin (`-`) too
  79. docling-rs https://www.youtube.com/watch?v=ID # a YouTube video: title, description, caption transcript (--to vtt keeps the timing)
  80. docling-rs --help # every flag: OCR, page ranges, images, enrichment, redaction …
  81. ```
  82. ```python
  83. from docling_rs import DocumentConverter # was: from docling.document_converter import …
  84. doc = DocumentConverter().convert("report.pdf").document
  85. print(doc.export_to_markdown())
  86. ```
  87. ```js
  88. import { convertFileAsync } from 'docling.rs'
  89. const { content } = await convertFileAsync('report.pdf', { to: 'markdown' })
  90. ```
  91. ```rust
  92. use docling::{DocumentConverter, SourceDocument};
  93. let result = DocumentConverter::new().convert(SourceDocument::from_file("report.pdf")?)?;
  94. println!("{}", result.document.export_to_markdown());
  95. ```
  96. ```bash
  97. curl -F file=@report.pdf 'localhost:5001/v1/convert?to=md' # the server; OpenAPI at /openapi.yaml
  98. ```
  99. Same options, same outputs on every surface — every option in
  100. [`docs/OPTIONS.md`](./docs/OPTIONS.md).
  101. ## Highlights
  102. - **From Python docling:** `from docling_rs import DocumentConverter`;
  103. `result.document` is a genuine `DoclingDocument`
  104. ([migration notes](./crates/docling-py/README.md#migrating-from-python-docling)).
  105. - **Every docling format, and a few it lacks** — the table under
  106. [Status](#status), each validated against live docling
  107. ([Conformance](#conformance-with-python-docling)).
  108. - **Every output docling has:** Markdown (docling's, or a stricter dialect),
  109. docling JSON, HTML, plain text, DocLang, LaTeX, Pandoc AST (→ DOCX, EPUB,
  110. Typst… through pandoc), WebVTT subtitles, RAG chunks and page images
  111. ([output formats](./crates/docling/README.md#output-formats)).
  112. - **From any language:** Rust, Python, Node.js / Bun, the browser (wasm,
  113. fully client-side), C, C++, C#, Go, Java and Swift through one C header,
  114. any HTTP client, the shell
  115. ([Integration](#integration--using-doclingrs-from-your-language)).
  116. - **A drop-in server for docling-serve:** Open WebUI uses it as its Docling
  117. content-extraction engine — point *Docling Server URL* at
  118. `http://<host>:5001` — and n8n, Dify and LangChain clients work unchanged
  119. ([`docling-rs serve`](#http-conversion-api--docling-rs-serve),
  120. [Open WebUI setup](./crates/docling-serve/README.md#open-webui)).
  121. - **AI agents (MCP):** `docling-rs mcp` gives Claude Desktop, Claude Code,
  122. Cursor or VS Code MarkItDown's `convert_to_markdown` tool, plus `convert`
  123. for JSON, chunks and the rest — `uvx docling-rs-mcp`, or
  124. `claude mcp add docling -- docling-rs mcp` ([MCP server](#mcp-server--docling-rs-mcp)).
  125. - **LangChain:** `pip install "docling-rs[langchain]"` — langchain-docling's
  126. `DoclingLoader` on the Rust engine, one import to swap
  127. ([details](./crates/docling-py/README.md#langchain)).
  128. - **AutoGen:** `pip install "docling-rs[autogen]"` — `DoclingIndexer` fills
  129. any AutoGen memory with chunks that carry their pages, `DoclingConvertTool`
  130. lets an agent read documents ([details](./crates/docling-py/README.md#autogen)).
  131. - **Microsoft Agent Framework:** `pip install "docling-rs[agent-framework]"` —
  132. AutoGen's successor: `DoclingIndexer` fills any Agent Framework vector
  133. store, `DoclingContextProvider` puts the relevant chunks with their pages
  134. into each turn ([details](./crates/docling-py/README.md#microsoft-agent-framework)).
  135. - **Your own formats:** register a backend for a format docling.rs does not
  136. read — or to read one of its formats your way — from Rust, Python
  137. (`@docling_rs.register_backend(extensions=["rtf2"])`, and MarkItDown's
  138. `register_converter` and plugins) or Node.js, ahead of the built-in formats
  139. ([pluggable backends](./crates/docling/README.md#pluggable-backends)).
  140. - **RAG:** `docling-rag` — chunk, embed and search with a REST API and a web
  141. UI ([RAG subsystem](#rag-subsystem)).
  142. - **Runs where you are:** Linux x64 / arm64 / s390x, macOS (Apple Silicon)
  143. and Windows prebuilt (CLI, wheels, npm), Intel macs from source, containers
  144. for amd64 and arm64; NVIDIA
  145. CUDA and TensorRT, DirectML (a prebuilt Windows CLI), CoreML and WebGPU in the browser as opt-in
  146. accelerators ([GPU](./docs/MODELS.md#gpu-execution-providers-optional-off-by-default),
  147. [IBM Z](./docs/IBMZ.md)).
  148. Developed with **Claude Code** and _[TENET](https://github.com/artiz/tenet/tree/master)_ (minimalistic AI-driven development framework).
  149. ## Status
  150. Every format in docling's pipeline converts — plus a few docling lacks. A
  151. file with no or an unknown extension, stdin, an upload or a `data:` URL is
  152. typed by its content (`InputFormat::detect`, `docling_rs.detect_format`,
  153. `detectFormat`: the packages, the OLE files, PDF, images, audio and video,
  154. iWork, XML, JSON, notebooks, messages, …), and a file that fails under its
  155. extension is checked by content and converted as what it really is, with a
  156. warning.
  157. | Category | Formats |
  158. |---|---|
  159. | Text & markup | Markdown, AsciiDoc, HTML, MHTML, LaTeX (multi-file arXiv projects, math, tables); plain text and source code (`.py`, `.yaml`, `.log`, … — any text file, as a code block or paragraphs), generic JSON / JSON Lines and XML (kept as code blocks); RSS / Atom / RDF feeds (`.rss`, `.atom`, `.rdf` or a bare `.xml`: the feed's title, each item's heading, date and body); Jupyter notebooks (`.ipynb`: markdown cells, code cells in the kernel's language, outputs on request) |
  160. | Word processing | DOCX, Word 97–2004 `.doc` (and Word 6/95, 1.x/2.0), ODT, OpenOffice / StarWriter, AbiWord, WordPerfect, MS Works, Hancom HWP / HWPX, Lotus Word Pro, MacWrite / Word for Mac / ClarisWorks, T602, Palm e-texts, print files (`.prn`), EPUB, RTF |
  161. | Presentations | PPTX, PowerPoint 97–2003, ODP, OpenOffice / StarImpress |
  162. | Spreadsheets | XLSX, XLSB, Excel 97–2004, ODS, CSV / TSV, dBase, DIF, SYLK, Lotus 1-2-3, Quattro Pro, MS Works, Kingsoft `.et` |
  163. | Diagrams · Apple iWork | Visio, SVG, CGM (its text) · Pages, Numbers, Keynote |
  164. | PDF & images | PDF (layout, TableFormer, OCR), PNG, JPEG, TIFF, BMP, WebP, GIF, HEIC (opt-in), METS/GBS scans, DjVu |
  165. | XML · docling native | JATS, USPTO, XBRL, RIS (Austrian legal XML), DocLang · docling JSON, DocTags, DCLX |
  166. | Email · notes · calendars · subtitles · mainframe | `.eml`, Outlook `.msg` · Box Notes (`.boxnote`) · iCalendar `.ics` (events, tasks, journal entries, free/busy) · WebVTT · EBCDIC records through a COBOL copybook, AFP / MO:DCA print streams |
  167. | Audio · video | WAV, MP3, M4A, AAC, OGG, FLAC; MP4, AVI, MOV, MKV, WebM, MPEG — local Whisper or Parakeet, plus scene frames from video; a YouTube watch URL — the video's title, description and caption transcript as timed items (`--asr-lang` picks the language) |
  168. Every extension, with what each backend does:
  169. [`docs/MIGRATION.md`](./docs/MIGRATION.md#every-extension-by-category).
  170. <details>
  171. <summary><b>Installing ffmpeg</b> (optional — only for video frame sampling)</summary>
  172. Any ffmpeg ≥ 4.x on `PATH` works; docling.rs shells out to the binary and
  173. parses its output, so no dev headers/libraries are needed.
  174. - **Debian/Ubuntu**: `sudo apt-get install ffmpeg`
  175. - **Fedora**: `sudo dnf install ffmpeg-free` (or `ffmpeg` from RPM Fusion)
  176. - **Alpine**: `apk add ffmpeg`
  177. - **macOS**: `brew install ffmpeg`
  178. - **Windows**: `winget install ffmpeg` (or `choco install ffmpeg`, or
  179. `scoop install ffmpeg`). Installing from a downloaded zip
  180. ([gyan.dev](https://www.gyan.dev/ffmpeg/builds/) /
  181. [BtbN](https://github.com/BtbN/FFmpeg-Builds/releases)) also works — either
  182. add the extracted `bin\` folder to `PATH`, or skip `PATH` entirely and point
  183. `DOCLING_FFMPEG` at the exe:
  184. `set DOCLING_FFMPEG=C:\tools\ffmpeg\bin\ffmpeg.exe`
  185. Check with `ffmpeg -version`. `DOCLING_FFMPEG` overrides the binary used on
  186. any OS; the docling-rs-serve Docker image ships ffmpeg preinstalled.
  187. A trimmed, decode-only build (`--disable-everything --enable-…`) works too
  188. (#853); docling.rs needs only: the `file` protocol; the demuxers of your
  189. containers (`mov` for mp4/mov/m4v, `matroska` for mkv/webm, `avi`, `mpeg`);
  190. the video decoders of your tracks (`h264`, `hevc`, `vp8`, `vp9`, `av1`,
  191. `mpeg4`, `mpeg2video`, …) with their parsers; the filters `select`,
  192. `metadata`, `fps`, `scale`, `showinfo`; the encoders `png` and
  193. `wrapped_avframe`; the muxers `image2` and `null`. No audio component is
  194. used — the transcript is decoded in Rust — and the scene scan maps the
  195. video stream alone. Missing a component, ffmpeg fails the scene scan
  196. (`Encoder not found`, `Invalid argument`) and the video converts as
  197. transcript only; `DOCLING_RS_DEBUG=1` shows the message.
  198. </details>
  199. ## Conformance with Microsoft MarkItDown
  200. [MarkItDown](https://github.com/microsoft/markitdown) converts the same kinds
  201. of documents to Markdown for LLMs. Measured side by side — MarkItDown 0.1.9
  202. (`markitdown[all]`) and docling.rs master after 2.51.3 (release build), 4 vCPU,
  203. no GPU, 2026-10-25 — on this repository's test corpus and on MarkItDown's own
  204. OCR test set
  205. ([`scripts/conformance/markitdown_compare.py`](./scripts/conformance/markitdown_compare.py)):
  206. | Corpus (files) | MarkItDown, warm | docling.rs, warm | Cold CLI call, MarkItDown / docling.rs | Word F1 | Table-cell recall | Heading recall |
  207. |---|---|---|---|---|---|---|
  208. | DOCX (38) | 9.32 s | **0.57 s** | 1360 / **31** ms | 0.93 / **1.00** | 0.81 / **1.00** | 0.78 / **1.00** |
  209. | PPTX (8) | 0.28 s | **0.04 s** | 1277 / **11** ms | 0.81 / **0.97** | 0.62 / **1.00** | 0.86 / **1.00** |
  210. | XLSX (14) | 2.44 s | **0.30 s** | 1472 / **14** ms | 0.60 / **0.95** | 0.78 / **0.98** | — ¹ |
  211. | HTML (32) | 0.53 s | **0.05 s** | 1248 / **11** ms | 0.98 / **1.00** | 0.88 / **1.00** | 0.96 / **1.00** |
  212. | CSV (9) | 0.07 s | **0.01 s** | 1250 / **6** ms | 1.00 / 1.00 | 0.78 / **1.00** | — |
  213. | EPUB (1) | 0.07 s | **0.02 s** | 1473 / **17** ms | 0.99 / **1.00** | — | 1.00 / 1.00 |
  214. | PDF (18), full layout + tables + OCR | **19.0 s** | 60.3 s | **1442** / 1652 ms | 0.63 / **0.997** | 0.31 / **0.94** | 0.00 / **0.91** |
  215. | PDF (18), text layer only (`--text-layer-only`) | 19.0 s | **0.8 s** | — | 0.63 / **0.97** | 0.31 / 0.00 | 0.00 / 0.00 |
  216. Accuracy is scored against Python docling's groundtruth, which favours
  217. docling.rs by construction; the timings do not depend on it. Text drawn into
  218. images (MarkItDown's own OCR test set) reads at 1.00 with docling.rs' local
  219. OCR, against 0.00–0.33 for MarkItDown without an LLM. Method, caveats and the full
  220. OCR comparison: [`docs/MARKITDOWN.md`](./docs/MARKITDOWN.md#how-the-comparison-is-scored).
  221. ## Conformance with Marker
  222. [Marker](https://github.com/datalab-to/marker) (datalab's `marker-pdf`)
  223. converts PDFs and, through a PDF render, Office files to Markdown for LLMs
  224. with a layout model and OCR. Measured side by side — Marker 2.0.0
  225. (`marker-pdf[full]`, its CPU default `fast` mode, llama.cpp for its OCR) and
  226. docling.rs master after 2.51.3 (release build), 4 vCPU, no GPU, 2026-10-25 ³ —
  227. on this repository's test corpus
  228. ([`scripts/conformance/marker_compare.py`](./scripts/conformance/marker_compare.py)):
  229. | Corpus (files) | Marker, warm | docling.rs, warm | Cold CLI call, Marker / docling.rs | Peak RSS, Marker (client + servers) / docling.rs | Word F1 | Table-cell recall | Heading recall |
  230. |---|---|---|---|---|---|---|---|
  231. | PDF (18), full layout + tables + OCR | 1356 s | **64 s** | 32.6 s / **1.5 s** | 10.3 GB / **2.8 GB** | 0.93 / **0.997** | 0.41 / **0.94** | 0.66 / **0.91** |
  232. | PDF (18), text layer only (`--text-layer-only`) | 1356 s | **0.75 s** | — | — / 74 MB | 0.93 / **0.97** | 0.41 / 0.00 | 0.66 / 0.00 |
  233. | DOCX (38) | 707 s (1 failed) | **0.54 s** | 36.3 s / **23 ms** | 7.7 GB / **41 MB** | 0.89 / **1.00** | 0.57 / **1.00** | 0.73 / **1.00** |
  234. | PPTX (8) | 4.6 s (3 failed) | **0.03 s** | 33.7 s / **13 ms** | 2.7 GB / **20 MB** | 0.49 / **0.97** | 0.41 / **1.00** | 0.43 / **1.00** |
  235. | XLSX (14) | 379 s (2 failed) | **0.33 s** | 34.4 s / **12 ms** | 17.2 GB / **53 MB** | 0.66 / **0.95** | 0.58 / **0.98** | — ¹ |
  236. | HTML (32) ³ | 1514 s | **0.06 s** | 29 min ² / **8 ms** | 8.8 GB / **21 MB** | 0.94 / **1.00** | 0.50 / **1.00** | 0.84 / **1.00** |
  237. | EPUB (1) | 13.5 s | **0.08 s** | 69.9 s / **21 ms** | 6.0 GB / **19 MB** | 0.98 / **1.00** | — | 1.00 / 1.00 |
  238. A failed file scores 0. ¹ Only one XLSX groundtruth carries a heading.
  239. ² The median HTML file needs OCR in Marker: a cold call starts its llama.cpp
  240. server and loads the 1.2 GB OCR model first.
  241. ³ The HTML row is the earlier run's (docling.rs 2.46.2, another host): its
  242. re-run here was stopped after 3 h 45 min — its warm pass done, the first cold
  243. `marker_single` call had spent 97 minutes on one 855-byte file, Marker's OCR model
  244. looping on one render (5,000+ tokens for a single block).
  245. Accuracy is scored against Python docling's groundtruth, which favours
  246. docling.rs by construction; the timings and memory do not depend on it.
  247. Marker reads Office files, HTML and EPUB by rendering them to PDF and
  248. running its vision models on the render; on CPU every page its text check
  249. flags goes through a 1.2 GB vision-language OCR model in a llama.cpp server
  250. that `pip install marker-pdf` does not bring (without it 4 PDFs, 9 DOCX, 10
  251. HTML and the EPUB fail outright). Peak RSS counts Marker's client and its
  252. inference servers. Marker's `balanced` mode (its published benchmarks) needs
  253. a GPU. Method, caveats and the API map:
  254. [`docs/MARKER.md`](./docs/MARKER.md#how-the-comparison-is-scored).
  255. ## Conformance with MinerU
  256. [MinerU](https://github.com/opendatalab/MinerU) (OpenDataLab) converts PDFs,
  257. images and Office files to Markdown and JSON for LLMs in four tiers — `flash`
  258. (text layer, no models), `basic` (ONNX layout / table / OCR models),
  259. `standard` and `advanced` (a vision-language model through llama.cpp).
  260. Measured side by side — MinerU 4.0.12 and docling.rs master after 2.51.3
  261. (release build), 4 vCPU, no GPU, 2026-10-25 — on this repository's test corpus
  262. ([`scripts/conformance/mineru_compare.py`](./scripts/conformance/mineru_compare.py)):
  263. | Corpus (files) | MinerU `flash`, warm | MinerU `basic`, warm | docling.rs, warm | Cold CLI call, MinerU `flash` / `basic` / docling.rs | Peak RSS, MinerU `flash` / `basic` / docling.rs | Word F1 (`flash` / `basic` / docling.rs) | Table-cell recall | Heading recall |
  264. |---|---|---|---|---|---|---|---|---|
  265. | PDF (18), full layout + tables + OCR | 38.8 s | 190 s (+ 78 s model load) | **62.7 s** | 5.7 s / 11.1 s / **1.7 s** | 1.4 GB / 4.4 GB / 2.9 GB | 0.87 / 0.74 / **0.997** | 0.28 / 0.44 / **0.94** | 0.57 / 0.58 / **0.91** |
  266. | PDF (18), text layer only (`--text-layer-only`) | 38.8 s | — | **0.82 s** | — / — / — | — / — / 73 MB | 0.87 / — / **0.97** | 0.28 / — / 0.00 | 0.57 / — / 0.00 |
  267. | DOCX (38) | 4.36 s | flash only | **0.70 s** | 3331 ms / — / **23 ms** | 164 MB / — / **41 MB** | 0.97 / — / **1.00** | 0.82 / — / **1.00** | 0.96 / — / **1.00** |
  268. | PPTX (8) | 0.26 s (1 failed) | flash only | **0.02 s** | 3340 ms / — / **11 ms** | 110 MB / — / **20 MB** | 0.79 / — / **0.97** | 0.91 / — / **1.00** | 1.00 / — / 1.00 |
  269. | XLSX (14) | 1.00 s | flash only | **0.20 s** | 1519 ms / — / **13 ms** | 130 MB / — / **55 MB** | 0.83 / — / **0.95** | 0.77 / — / **0.98** | — ¹ |
  270. | HTML (32) | 1.07 s | flash only | **0.07 s** | 3039 ms / — / **9 ms** | 141 MB / — / **22 MB** | 0.94 / — / **1.00** | 0.80 / — / **1.00** | 0.96 / — / **1.00** |
  271. | EPUB (1) | 0.12 s | flash only | **0.03 s** | 3144 ms / — / **24 ms** | 89 MB / — / **19 MB** | 1.00 / 1.00 | — | 1.00 / 1.00 |
  272. A failed file scores 0. ¹ Only one XLSX groundtruth carries a heading.
  273. Accuracy is scored against Python docling's groundtruth, which favours
  274. docling.rs by construction; the timings and memory do not depend on it.
  275. MinerU parses Office files, HTML and EPUB at `flash` only; `basic` is its
  276. model tier on CPU; its `standard` tier (a 1.2 B vision-language model through llama.cpp) took 138 s for one page on a 4 vCPU CPU in the earlier run and is not in the table. Method, caveats and the API map:
  277. [`docs/MINERU.md`](./docs/MINERU.md#how-the-comparison-is-scored).
  278. ## Conformance with Python docling
  279. Every declarative format is compared against the live library — Markdown
  280. byte for byte, JSON structurally (every key and value but `origin`/`version`
  281. and re-encoded image bytes). Latest sweep, docling **2.142.1** with the
  282. docling-core 2.103.1 it locks, over its mirrored test corpus
  283. (`scripts/conformance/full_conformance.py`; ✅ all = every file matches):
  284. | Format | Files | Markdown | JSON | Format | Files | Markdown | JSON |
  285. |---|---|---|---|---|---|---|---|
  286. | DOCX | 38 | ✅ all | ✅ all | iWork Pages | 1 | ✅ all | ✅ all |
  287. | HTML | 32 | 30 ³ | ✅ all | iWork Keynote | 5 | ✅ all | ✅ all |
  288. | PPTX | 8 | 7 ⁶ | 7 ⁶ | EBCDIC | 3 | ✅ all | ✅ all |
  289. | XLSX | 14 | 13 ² | 13 ² | JATS | 7 | 4 ⁴ | ✅ all |
  290. | ODF | 7 | ✅ all | ✅ all | DocLang | 15 | ✅ all | ✅ all |
  291. | CSV | 9 | ✅ all | ✅ all | AsciiDoc | 5 | ✅ all | ✅ all |
  292. | Markdown | 11 | ✅ all | 10 ⁵ | USPTO | 9 | ✅ all | ✅ all |
  293. | DeepSeek-OCR Markdown | 3 | ✅ all | n/a | EPUB | 1 | ✅ all | ✅ all |
  294. | WebVTT | 4 | ✅ all | ✅ all | LaTeX | 8 | ✅ all | 7 ¹ |
  295. | Email (`.eml`) | 2 | ✅ all | ✅ all | | | | |
  296. ¹ Deliberate: in `1706.03762` a `\multirow` / `\multicolumn` cell's `row_span` / `col_span` agree with its offsets, where upstream leaves them at 1 (docling#4817's LaTeX rewrite is ported in full, PDF figures rendered at 144 dpi like upstream's).
  297. ² `xlsx_02_sample_sales_data`: 20 date cells print by docling PR #4628's number-format rules (#634), which the released docling does not apply yet.
  298. ³ Deliberate: a table inside a list item stays a table after the item (upstream prints its grid right under the item line); two Wikipedia links keep docling-core 2.104's `%28`/`%29` escaping.
  299. ⁴ Whitespace only: a one-run footnote prints on its bullet, where docling 2.142 leaves the bullet empty and puts the text on the next line.
  300. ⁵ Deliberate: a code span keeps its literal text (`&amp;`), which upstream decodes when a raw HTML block sends the file through its HTML backend.
  301. ⁶ Ahead of the release: `pptx_chart`'s 3-D column chart is read as a bar chart with its data, as docling `main` reads it since docling#4811 (after 2.142.1).
  302. The residuals, with the exact files: [`docs/MIGRATION.md`](./docs/MIGRATION.md).
  303. The PDF/image pipeline is pinned by a deterministic snapshot baseline and
  304. scored against docling's groundtruth in
  305. [`docs/PDF_CONFORMANCE.md`](./docs/PDF_CONFORMANCE.md).
  306. ## Performance
  307. One fixture per format through published Python docling and the Rust release
  308. binary (`scripts/test/performance.sh`); docling ÷ docling.rs, so bigger means
  309. Rust wins by more. Measured 2026-10-25: docling 2.142.1 (the default PyPI
  310. install, torch included) against docling.rs master after 2.51.3, 4 vCPU, no
  311. GPU.
  312. | File | Size | Peak-memory ratio | CPU ratio | Warm-conversion speedup |
  313. |---|---:|---:|---:|---:|
  314. | `picture_classification.pdf` (PDF) | 208 KB | **4.8× less** | 0.7× | 11.6× |
  315. | `docx_rich_tables_01.docx` (DOCX) | 3.1 MB | **28× less** | 1.1× | 12× |
  316. | `wiki_duck.html` (HTML) | 240 KB | **33× less** | 1.1× | 27× |
  317. | `elife-56337.nxml` (JATS XML) | 180 KB | **39× less** | 1.2× | 11× |
  318. | `xlsx_04_inflated.xlsx` (XLSX) | 168 KB | **32× less** | 0.9× | 11× |
  319. | `powerpoint_with_image.pptx` (PPTX) | 80 KB | **36× less** | 1.1× | 2.7× |
  320. | `wiki.md` (Markdown) | 8 KB | **43× less** | 1.1× | 2.3× |
  321. | `csv-comma.csv` (CSV) | 4 KB | **44× less** | 1.3× | 0.4× † |
  322. † A 4 KB CSV converts in microseconds, so Rust's own process startup dominates
  323. its number; end to end it is 780× faster.
  324. Declarative formats hold 17–28 MB against docling's 750–780 MB (it imports
  325. torch even for them) and finish 200–890× sooner end to end; the PDF peaks at
  326. 0.46 GB against 2.2 GB and converts 19× faster end to end. Where the time
  327. goes, and what was measured not to help:
  328. [`docs/PERFORMANCE.md`](./docs/PERFORMANCE.md#where-the-time-goes).
  329. ## Integration — using docling.rs from your language
  330. One engine, several front doors, the same options and outputs everywhere.
  331. | You write… | Use | Install |
  332. |---|---|---|
  333. | Rust | the [`docling`](./crates/docling/README.md) crate | `cargo add docling` |
  334. | a shell / CI job | the [`docling-rs` CLI](./crates/docling-cli/README.md), batch mode included | release binaries · `cargo install docling-cli` · `ghcr.io/docling-project/docling-rs` |
  335. | anything that speaks HTTP | [`docling-serve`](./crates/docling-serve/README.md), OpenAPI 3.1 | `ghcr.io/docling-project/docling-rs-serve` · `cargo install docling-serve` |
  336. | Node.js / Bun / Electron | [`docling.rs`](./crates/docling-node/README.md), an N-API addon | `npm i docling.rs` (`docling.rs-cuda`) |
  337. | Python | [`docling-rs`](./crates/docling-py/README.md): docling's, MarkItDown's, Marker's and MinerU's APIs | `pip install docling-rs` (`docling-rs-cuda`) |
  338. | LangChain / LlamaIndex | [`DoclingLoader`](./crates/docling-py/README.md#langchain) (langchain-docling's API) · [`DoclingReader`](./crates/docling-py/README.md#llamaindex) (llama-index-readers-docling's API) | `pip install langchain-docling-rs` · `pip install llama-index-readers-docling-rs` |
  339. | the browser / Tauri / a PWA | [`docling.rs-wasm`](./crates/docling-wasm/README.md), fully client-side | `npm i docling.rs-wasm` |
  340. | C, C++, C#, Go, Java, Swift, Zig | [`docling-ffi`](./crates/docling-ffi/README.md): one `docling.h` | release archives `docling-ffi-<tag>-<target>` |
  341. **Rust** when you're already in Cargo; the **CLI** for scripts and batch jobs;
  342. **serve** when several services share one warm pipeline; **Node / Python**
  343. in-process; **wasm** when the document must not leave the user's machine;
  344. **FFI** for anything that can call C.
  345. ## Rust API
  346. ```rust
  347. use docling::{DocumentConverter, SourceDocument};
  348. let converter = DocumentConverter::new();
  349. let result = converter.convert(SourceDocument::from_file("input.md")?)?;
  350. println!("{}", result.document.export_to_markdown()); // Markdown
  351. println!("{}", result.document.export_to_json()); // docling DoclingDocument JSON
  352. ```
  353. Every conversion knob is one serializable struct, `docling::ConvertOptions`,
  354. filled the same way by every surface ([`docs/OPTIONS.md`](./docs/OPTIONS.md)).
  355. The [library guide](./crates/docling/README.md) covers the output formats,
  356. error handling, chunking, image extraction, streaming, OCR, the PDF switches,
  357. the remote VLM pipeline and registering your own backends (#680).
  358. ## HTTP conversion API — `docling-rs serve`
  359. [`docling-serve`](./crates/docling-serve/README.md) exposes the converter over
  360. HTTP with one warm PDF/image pipeline shared across requests (repeat PDFs skip
  361. the model load), streamed Markdown, batches, ZIP inputs, async jobs, an
  362. interactive test form at `GET /` and an OpenAPI 3.1 description at
  363. `GET /openapi.yaml`. It also serves Python docling-serve's routes, so Open
  364. WebUI, n8n, Dify and LangChain clients work unchanged.
  365. ```bash
  366. docker run -p 127.0.0.1:5001:5001 ghcr.io/docling-project/docling-rs-serve
  367. curl -F file=@paper.pdf localhost:5001/v1/convert # Markdown
  368. curl -F file=@report.docx 'localhost:5001/v1/convert?to=json' # docling JSON
  369. curl -F file=@a.pdf -F file=@b.docx localhost:5001/v1/convert # a batch
  370. ```
  371. Request options, server flags, async jobs, the docling-serve routes and the
  372. Open WebUI setup: [`crates/docling-serve/README.md`](./crates/docling-serve/README.md);
  373. containers and sizing: [`docs/DEPLOYMENT.md`](./docs/DEPLOYMENT.md).
  374. ## MCP server — `docling-rs mcp`
  375. `docling-rs mcp` is a [Model Context Protocol](https://modelcontextprotocol.io)
  376. server in the default `docling-rs` binary and image. Agents get MarkItDown's
  377. `convert_to_markdown(uri)` tool — same name and contract, so a
  378. `markitdown-mcp` setup switches by changing the command — plus
  379. `convert(uri, to, options)` and `list_input_formats()`.
  380. ```json
  381. {
  382. "mcpServers": {
  383. "docling": { "command": "docling-rs", "args": ["mcp", "--root", "/Users/me/Documents"] }
  384. }
  385. }
  386. ```
  387. ```bash
  388. claude mcp add docling -- docling-rs mcp --root ~/Documents # Claude Code
  389. uvx docling-rs-mcp --root ~/Documents # the same server from PyPI
  390. ```
  391. Local reads stay under `--root`; URLs need `--allow-url-fetch`. Listed in the
  392. [official MCP registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.docling-project/docling-rs)
  393. and on [Smithery](https://smithery.ai/servers/artem-kustikov/docling-rs). The PyPI
  394. launcher, Docker, Streamable HTTP (`--http`), the security model and memory
  395. behaviour:
  396. [`crates/docling-cli/README.md`](./crates/docling-cli/README.md#mcp-server--docling-rs-mcp).
  397. ## RAG subsystem
  398. [`crates/docling-rag`](./crates/docling-rag/README.md) turns documents into
  399. chunks, embeds them (Ollama, Gemini or a local ONNX model), stores them
  400. (SQLite + sqlite-vec or PostgreSQL + pgvector) and searches them — hybrid,
  401. multi-query and HyDE retrieval, an evaluation harness, a REST API and a
  402. built-in search UI.
  403. ## In the browser — `docling-wasm`
  404. The declarative converters and the PDF text layer compile to WebAssembly:
  405. `npm i docling.rs-wasm`, then `convert(bytes, filename, to)` runs **fully
  406. client-side** — no server, a ~3.4 MB gzipped module, optional in-browser OCR.
  407. Details and the demo page: [`crates/docling-wasm`](./crates/docling-wasm/README.md).
  408. ## Node.js, Python and C
  409. - **Node.js / Bun** — [`docling.rs`](./crates/docling-node/README.md) on npm, a
  410. prebuilt N-API addon: sync and async conversion, streaming, chunking, ZIP
  411. batches, a warm `Pipeline`.
  412. - **Python** — [`docling-rs`](./crates/docling-py/README.md) on PyPI
  413. (`docling-rs-cuda` for NVIDIA): docling's `DocumentConverter` with a genuine
  414. docling-core `DoclingDocument`, MarkItDown's API, and the LangChain,
  415. AutoGen and Microsoft Agent Framework integrations.
  416. - **C ABI** — [`docling-ffi`](./crates/docling-ffi/README.md): one library and
  417. one `docling.h` for C, C++, C#/.NET, Go, Java, Swift and Zig, prebuilt in
  418. every published release.
  419. ## Deploy in a container
  420. | Image | What it is |
  421. |---|---|
  422. | [`ghcr.io/docling-project/docling-rs-serve`](https://github.com/docling-project/docling.rs/pkgs/container/docling-rs-serve) | the HTTP API, models baked in (`linux/amd64`, `linux/arm64`) |
  423. | [`ghcr.io/docling-project/docling-rs`](https://github.com/docling-project/docling.rs/pkgs/container/docling-rs) | the CLI, entrypoint `docling-rs`, working directory `/data` |
  424. | `…-serve-cuda` · `…-rs-cuda` | the same on CUDA 13 + cuDNN 9 (`linux/amd64`) |
  425. Compose files (standalone, Caddy TLS, CUDA), environment variables, sizing
  426. and observability: [`docs/DEPLOYMENT.md`](./docs/DEPLOYMENT.md).
  427. ## Getting the ML models
  428. The PDF/image pipeline needs ONNX models — RT-DETR layout, PP-OCR, and
  429. TableFormer — and audio needs Whisper. `download_dependencies.sh` fetches
  430. them from this repository's
  431. [releases](https://github.com/docling-project/docling.rs/releases) into
  432. `./.models`, where every surface looks (`--cli`: beside a cargo-installed
  433. binary instead):
  434. ```bash
  435. scripts/install/download_dependencies.sh # from a checkout
  436. curl -fsSL https://raw.githubusercontent.com/docling-project/docling.rs/master/scripts/install/download_dependencies.sh | sh # anywhere
  437. ```
  438. Every asset and option (ASR presets, enrichment models, NER for PII
  439. redaction, INT8, fonts), GPU execution providers and the environment
  440. overrides: [`docs/MODELS.md`](./docs/MODELS.md). IBM Z and other targets
  441. without a prebuilt ONNX Runtime: [`docs/IBMZ.md`](./docs/IBMZ.md).
  442. ## Contributing
  443. Bug reports and pull requests are welcome — see
  444. [CONTRIBUTING.md](./CONTRIBUTING.md) for the build and test commands, the
  445. conformance workflow, and the conventions a change is expected to follow.
  446. ## License
  447. MIT, matching upstream docling.
  448. The CID → Unicode tables in
  449. [`crates/docling-pdf/data/mapping-resources-pdf/`](./crates/docling-pdf/data/mapping-resources-pdf/)
  450. are Adobe's, under the BSD-3-Clause
  451. [`LICENSE.txt`](./crates/docling-pdf/data/mapping-resources-pdf/LICENSE.txt)
  452. there. The native builds compile them in (docling-pdf's `cid-collections`
  453. feature), so the published binaries carry that licence as
  454. `LICENSE-mapping-resources-pdf.txt`: the CLI and FFI archives and the Node.js
  455. packages next to the binary, the wheels in their `.dist-info/licenses/`
  456. (maturin includes `crates/docling-py/LICENSE-*`), the container images in
  457. `/usr/share/doc/docling.rs/`, and `install.sh` in its prefix. The wasm package
  458. and demo leave the tables out. A binary you build and redistribute yourself
  459. with the feature on needs the licence beside it too.
  460. The glyph-name tables are Adobe's as well. The
  461. [Adobe Glyph List](./crates/docling-pdf/data/adobe-glyph-list/) (BSD-3-Clause)
  462. is compiled into the native builds by docling-pdf's `glyph-list` feature, and
  463. the Symbol / ZapfDingbats encodings and standard-14 metrics in
  464. `symbol_fonts.rs` / `std14.rs` are derived from Adobe's Core 14 AFM files,
  465. which every build of the PDF text parser contains. One notice,
  466. [`LICENSE.txt`](./crates/docling-pdf/data/adobe-glyph-list/LICENSE.txt),
  467. covers both and travels as `LICENSE-adobe-glyph-list.txt` in the same places
  468. — plus the wasm package and the demo site, which leave the list out but carry
  469. the AFM-derived tables.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.