Docling
Parse documents into AI-ready structured formats
Docling parses diverse document formats including PDF, DOCX, and images into structured, AI-ready representations. It provides advanced layout understanding and integrates with popular RAG frameworks.
Key features
- Multi-format document parsing
- Advanced layout analysis
- RAG framework integrations
- Local processing
Pros & cons
Strengths
- Excellent PDF layout parsing
- Broad format support
- Runs fully locally
Trade-offs
- Large model downloads
- CPU parsing can be slow
Docling replaces
Last reviewed Aug 26, 2026 · 827 words
If your RAG pipeline answers badly, the model is usually innocent and the PDF extraction is guilty. Docling exists to fix exactly that step: it parses PDF, DOCX, PPTX, HTML, and scanned images into structured Markdown or JSON with reading order, headings, and tables intact, and it does the whole job on your own hardware. IBM Research released it in 2024, it is MIT-licensed Python, and at 65,567 GitHub stars it has become the default answer to "how do I get clean text out of documents without sending them to an API". The two things nobody tells you up front: the first run downloads sizeable models, and CPU-only parsing is slow enough to change how you deploy it.
Layout analysis is the point, not text extraction
Plain-text extractors have existed for decades; what they produce from a two-column paper with tables is word salad. Docling runs actual layout models over each page — detecting columns, headers, footnotes, figures — plus a dedicated table-structure model that reconstructs rows and cells rather than flattening them into tab-separated mush. The output preserves document structure, which is precisely what chunking strategies need: splitting on real headings beats splitting every 1,000 characters, every time. It exports to Markdown, HTML, or a lossless JSON document format, and ships integrations for the popular RAG frameworks (LangChain and LlamaIndex among them), so it slots into an existing pipeline as the ingestion stage.
The first run is a download, then it's offline forever
Docling fetches its layout and table models from Hugging Face on first use — the catalogue's "large model downloads" con, in practice a one-time cost of a few GB. After that it is genuinely offline-first: air-gapped machines work once you pre-fetch the models, and no document ever leaves your box. That is the entire pitch over cloud parsing APIs when the input is contracts, medical records, or anything else you self-host to keep private. The 4 GB minimum RAM is real and is mostly the models plus per-page working memory; give it less and large PDFs will OOM rather than degrade gracefully.
CPU works; a GPU changes what's feasible
On a decent desktop CPU, expect processing to be measured in seconds per page — fine for a nightly batch of invoices, painful for a 10,000-document backlog. OCR on scanned input (Docling can call Tesseract or EasyOCR for that) slows things further. A modest GPU cuts per-page time dramatically and is worth it the moment your corpus stops fitting in an overnight run. My rule: under roughly 1,000 documents, don't bother with special hardware; above that, either borrow a GPU machine for the initial ingest or accept that backfilling takes days. Incremental daily additions are cheap either way.
It's a pipeline stage, not a document manager
Docling has no UI, no storage, no search — it reads files and emits structure. If what you actually want is "scan, OCR, file, and find my paperwork", that product is Paperless-ngx; if you want page-level PDF surgery like merging and rotating, that is Stirling-PDF. Docling's natural neighbors are RAG applications: parse with Docling, embed the chunks, and let something like AnythingLLM handle chat over the results. Whether that retrieval setup beats fine-tuning for your use case is a separate question — the RAG vs fine-tuning breakdown covers it — but ingestion quality is upstream of both.
Three ways to run it
Installation is pip install docling, and the CLI is as plain as docling report.pdf, which prints Markdown. For anything recurring you have three sane shapes: a Python script or cron job calling the library directly; the official Docker image, which is the tidy choice when the 4 GB footprint should live on a server instead of your laptop; or the project's API-server deployment, which turns Docling into an HTTP service other containers can call. Difficulty is Medium mostly because of Python environment wrangling and model caching, not because any single step is hard — mount the model cache as a volume so containers don't re-download on every rebuild.
What I'd do
Run the Docker image on whatever box already hosts your AI stack, mount a persistent volume for the model cache, and front it as an internal HTTP service so every future project gets document parsing for free. Do the initial bulk ingest on the strongest machine you can borrow, then let the CPU handle the daily trickle. Pair it with Paperless-ngx rather than instead of it: Paperless owns the archive, Docling feeds the clean Markdown into your retrieval layer. And test it on your five ugliest real PDFs before believing anyone's benchmarks, including mine — table-heavy scans are where parsers go to die, and it is where Docling most consistently earns its stars.
Compare Docling
1 head-to-head comparisons.
Similar self-hosted ai apps
OpenClaw
Self-Hosted AIThe AI that actually does things
Hermes Agent
Self-Hosted AIThe AI agent that grows with you
OpenCode
Self-Hosted AIThe open source AI coding agent
Replaces Claude Code, Cursor
Hugging Face Transformers
Self-Hosted AIState-of-the-art machine learning model library
Replaces OpenAI API
Dify
Self-Hosted AIOpen-source platform for building production LLM apps
Replaces OpenAI Assistants, Vertex AI Agent Builder
Langflow
Self-Hosted AIVisual framework for building AI agents and RAG pipelines
Replaces Vertex AI Agent Builder