Package Architecture#
Docling ships two PyPI distributions from a single monorepo: docling-slim (the real implementation) and docling (a backwards-compatible meta-package). The split was introduced in PR #3285 (April 2026) to allow leaner installs without breaking existing pip install docling workflows.
The Two-Package Model#
| Package | Role | Ships Python modules? |
|---|---|---|
docling-slim | Implementation — all source code, all extras | Yes |
docling | Meta-package — depends on docling-slim[standard] | No |
docling-slim is defined at the repository root pyproject.toml. Its minimal base install pulls in ~50 MB across 8 packages: pydantic, docling-core, pydantic-settings, filetype, requests, certifi, pluggy, and tqdm .
docling is a pure dependency wheel defined at packages/docling/pyproject.toml. It ships no Python modules to prevent collisions on install , and simply pins docling-slim[standard] as its sole dependency .
The repository is a UV workspace with docling as the only explicit workspace member:
[tool.uv.workspace]
members = ["packages/docling"]
Note: the root pyproject.toml is the docling-slim package definition — there is no separate packages/docling-slim/pyproject.toml.
Backwards Compatibility#
The docling meta-package re-exports slim extras under their legacy names so existing installs keep working :
Legacy extra (docling[…]) | Maps to |
|---|---|
easyocr | docling-slim[feat-ocr-easyocr] |
tesserocr | docling-slim[feat-ocr-tesserocr] |
ocrmac | docling-slim[feat-ocr-mac] |
vlm | docling-slim[models-vlm-inline] |
rapidocr | docling-slim[feat-ocr-rapidocr-onnx] |
asr | docling-slim[format-audio] |
htmlrender | docling-slim[format-html-render] |
remote-serving | docling-slim[models-remote] |
onnxruntime | docling-slim[models-onnxruntime] |
xbrl | docling-slim[format-xml-xbrl] |
CLI entry points (docling, docling-tools) are re-declared in both wheels so that uv tool install docling correctly links them into ~/.local/bin; at runtime, both launchers resolve their modules from the docling-slim dependency .
Format Extras#
All format extras are defined in docling-slim's pyproject.toml:
| Extra | Key dependencies | Notes |
|---|---|---|
format-pdf | pypdfium2, docling-parse | Bundle of format-pdf-pypdfium2 + format-pdf-docling |
format-office | python-docx, python-pptx, openpyxl | Bundle of docx + pptx + xlsx |
format-web | beautifulsoup4, marko | Bundle of html + markdown |
format-opendocument | odfdo | ODT, ODS, ODP |
format-latex | pylatexenc | |
format-email | mail-parser (+ html) | |
format-xml-jats | lxml, beautifulsoup4 | JATS/NLM scientific XML |
format-xml-xbrl | arelle-release | Financial XBRL |
format-xml-uspto | defusedxml, beautifulsoup4 | USPTO patent XML |
format-html-render | playwright | Headless browser rendering |
format-audio | mlx-whisper (Apple Silicon), openai-whisper + whisper-s2t (others) | Platform-conditional |
OCR Engine Extras#
OCR engines are fully optional and installed independently :
| Extra | Engine | Platform / Python constraint |
|---|---|---|
feat-ocr-rapidocr | RapidOCR (no inference backend) | Any |
feat-ocr-rapidocr-onnx | RapidOCR + onnxruntime | Python < 3.14 |
feat-ocr-easyocr | EasyOCR + scikit-image | Any |
feat-ocr-tesserocr | tesserocr + pandas | Any |
feat-ocr-mac | ocrmac (Apple Vision) | macOS only |
feat-ocr-nemotron | Nemotron OCR | Linux x86_64, Python == 3.12, CUDA 13.x |
At runtime, OcrAutoModel selects an engine via a cascading try/except ImportError loop: macOS → Nemotron (Linux) → RapidOCR-ONNX → EasyOCR → RapidOCR-torch . If no engine is available, conversion proceeds without OCR rather than crashing.
Platform and Python Version Constraints#
Several extras carry python_version, sys_platform, or platform_machine markers that constrain installation :
feat-ocr-nemotron:python_version == "3.12" and sys_platform == "linux" and platform_machine == "x86_64"feat-ocr-mac:sys_platform == "darwin"models-onnxruntime:onnxruntime<1.24on macOS;onnxruntime-gpu<1.24on Linux/Windows; both gates requirepython_version < "3.14"— effectively not installed on Python 3.14+feat-ocr-rapidocr-onnx: onnxruntime dependency guardedpython_version < "3.14"models-vlm-inline: mlx-vlm only ondarwin arm64; transformers version ceiling differs on macOS vs other platformsformat-audio: mlx-whisper ondarwin arm64; whisper-s2t-reborn on all others
Convenience Bundles#
Two aggregate extras reduce install complexity :
standard:format-pdf+models-local+feat-ocr-rapidocr+format-office+format-web+format-latex+format-email+feat-chunking+extract-core+service-client+cliall:standard+ VLM + audio + HTML render + all XML formats + remote models + ONNX + EasyOCR + tesserocr + macOS OCR
Installing pip install docling resolves to docling-slim[standard] — the same as pip install docling-slim[standard].
Key Files#
pyproject.toml—docling-slimdefinition: all extras, format support, OCR engines, platform markerspackages/docling/pyproject.toml—doclingmeta-package: backwards-compat re-exports and CLI entry points