Cross-Platform Support#
Docling officially supports macOS, Linux, and Windows on both x86_64 and arm64 architectures . A plain pip install docling works across all these targets; platform differences surface primarily in optional dependencies, OCR engine selection, and a small number of known runtime bugs.
Platform-Conditional Dependencies#
Platform markers in pyproject.toml enforce what gets installed per environment. Key cases:
| Extra / Package | Constraint | Effect |
|---|---|---|
feat-ocr-nemotron | python_version == "3.12" and sys_platform == "linux" and platform_machine == "x86_64" | Linux x86_64 + Python 3.12 + CUDA 13.x only |
feat-ocr-mac (ocrmac) | sys_platform == "darwin" | macOS only; uses Apple Vision framework |
models-onnxruntime | sys_platform == "darwin" → onnxruntime<1.24; linux or win32 → onnxruntime-gpu<1.24; both require Python < 3.14 | macOS gets CPU-only ONNX; Linux/Windows get GPU variant |
models-vlm-inline (mlx-vlm) | sys_platform == "darwin" and platform_machine == "arm64" | Apple Silicon only |
format-audio (mlx-whisper) | sys_platform == "darwin" and platform_machine == "arm64" | Apple Silicon only; whisper-s2t-reborn used everywhere else |
transformers version ceiling | sys_platform == "darwin" capped lower (<5.9.0) than non-Darwin (<6.0.0) | Temporary macOS-specific workaround pending upstream fix |
macOS Intel (x86_64) requires pinning PyTorch to 2.2.2 because PyTorch 2.6+ dropped Intel Mac wheels. Install via pip install "docling[mac_intel]" or pin manually .
ONNX Runtime is not installed on Python 3.14+ on any platform due to hard version ceiling .
Runtime OCR Engine Selection#
OcrAutoModel uses a cascading try/except ImportError loop to select an OCR engine — no platform crashes if an engine is absent . Selection order:
- macOS →
OcrMacModel(Apple Vision) - Linux →
NemotronOcrModel(if all constraints met) - All platforms → RapidOCR (ONNX) → EasyOCR → RapidOCR (torch)
Platform and architecture are probed at runtime via sys.platform and platform.machine() in auto_ocr_model.py and auto_inline_engine.py. Platform metadata (via platform.platform()) is also stamped into every output document's DoclingVersion record .
Container Images (docling-serve)#
docling-serve publishes hardware-targeted images on ghcr.io/docling-project/ :
| Image suffix | Architecture | Notes |
|---|---|---|
| (default) | linux/amd64, linux/arm64 | PyPI default torch |
-cpu | linux/amd64, linux/arm64 | CPU-only torch |
-cu128 / -cu130 | linux/amd64 only | CUDA; pin to explicit version tags |
-rocm / -rocm72 | linux/amd64 only | Not published; build locally |
All GPU-accelerated variants are AMD64-only .
Known Cross-Platform Bugs and Limitations#
Windows: Image path corruption in exports#
When using --image-export-mode referenced, image URIs are stored using OS-native path separators. On Windows, this produces %5C-encoded backslashes in HTML (<img src="...%5CfileName.png">) and literal backslashes in Markdown — both invalid in web contexts . Root cause: _with_pictures_refs() in docling_core/types/doc/document.py sets item.image.uri = Path(obj_path) without calling .as_posix(). A fix via docling-core PR #641 normalizes to forward slashes. Workaround until merged: patch document.py locally to use Path(obj_path).as_posix().
Windows / minimal containers: EPUB MIME type rejection#
DocumentOrigin.validate_mimetype falls back to the host's system MIME map. On Windows and slim Docker images, application/epub+zip is absent from the system map and is not in _extra_mimetypes in docling_core/types/doc/common/origin.py, causing both EPUB conversion and reloading saved EPUB documents to fail with a Pydantic ValidationError . Fix: add "application/epub+zip" to _extra_mimetypes.
macOS Intel: PyTorch compatibility#
PyTorch 2.6+ has no wheels for Intel Macs. Use pip install "docling[mac_intel]" which pins torch==2.2.2 and torchvision==0.17.2. Python must be ≤ 3.12 .
ARM64 (Termux/Android, non-standard)#
On Android aarch64 (Termux), libpdfium.so emits linker warnings for unknown processor-specific DT entries — these are non-fatal . If torchao is installed externally, it may cause a Bus error on older kernels (4.14) with Python 3.14; fix with pip uninstall torchao .
Key References#
| Resource | Purpose |
|---|---|
docs/getting_started/installation.md | Official install instructions with platform-specific notes |
pyproject.toml | All platform-conditional dependency markers |
docling/models/stages/ocr/auto_ocr_model.py | Runtime platform detection for OCR engine selection |
docling/models/inference_engines/vlm/auto_inline_engine.py | Runtime platform detection for VLM engine selection |
| docling-core PR #641 | Windows path fix (.as_posix()) |
| docling-core issue #691 | EPUB MIME type validation failure on Windows |
| docling issue #3617 | Windows image path corruption report |