Marker vs Docling 2026: Local RAG PDF Parsing Compared
TL;DR: Docling is the safer default for local RAG pipelines: plain MIT license, CPU-first, and first-party LangChain/LlamaIndex integrations. Marker converts difficult PDFs — math, multi-column papers, scanned pages — more accurately and faster on a GPU, but its model weights carry a commercial cap most Reddit threads never mention. Pick by license first, hardware second.
| Marker | Docling | Plain pypdf | |
|---|---|---|---|
| Best for | Academic PDFs, math, GPU batch jobs | RAG pipelines, enterprise docs, CPU boxes | Digital-born text, zero deps |
| License | Apache 2.0 code, capped weights | MIT everything | BSD |
| The catch | Weights free only under $5M funding/revenue | Lower raw accuracy on hard PDFs | No layout, tables become soup |
Honest take: run Docling unless your corpus is scan-heavy or math-heavy and you have a GPU — and if your company clears $5M, Marker isn’t actually free.
The r/LocalLLaMA threads that keep pitting these two against each other usually describe both as “MIT-licensed PDF parsers.” That’s wrong on both counts for Marker, and the difference matters if you’re parsing documents for a commercial product. Both claims below are verified against the repos as of August 31, 2026.
The license catch the Reddit threads miss
Docling (github.com/docling-project/docling) is MIT, full stop. The LICENSE file is the standard MIT text. It was started by IBM Research Zurich and now lives under the LF AI & Data Foundation, which is about as safe as open-source governance gets — no single vendor can relicense it out from under you. Its layout models, including the GraniteDocling 258M vision-language model, ship for local execution.
Marker (github.com/datalab-to/marker) is more complicated. The code is Apache 2.0 — the repo LICENSE file confirms it. But Marker is useless without the Surya model weights it calls for OCR and layout detection, and those weights use a modified AI Pubs Open RAIL-M license: free for research, personal use, and startups under $5M in funding or revenue. Past that threshold, you need a commercial license from Datalab, the company that now maintains both projects.
For a home lab, both are effectively free. For a bootstrapped side project, both are fine. For anything inside a funded company, Docling is the only one of the two you can adopt without a legal conversation — the same situation we flagged with LiquidAI’s LFM Open License and its $10M cap.
What each tool actually does
Both convert documents into Markdown (or JSON) that an LLM can chunk and embed. The architectures differ enough to drive the decision.
Marker is a pipeline of specialized models — Surya handles OCR (650M parameters, 91 languages per its README), layout detection, table recognition, and reading order. It takes PDF, images, PPTX, DOCX, XLSX, HTML, and EPUB, and converts math to LaTeX, which no other FOSS parser does as well. An optional --use_llm flag sends ambiguous regions to an LLM for cleanup — and the supported backends include Ollama, so the hybrid mode can stay fully local.
Docling is a document-understanding framework rather than a converter. It parses PDF layout, reading order, table structure, code blocks, and formulas, and its input list is much wider: beyond the office formats it handles images, audio (WAV/MP3, via ASR), and even video per the current README. Output is Markdown, HTML, DocTags, or lossless JSON that preserves the document structure — the JSON is what makes it a serious RAG ingestion layer rather than a text dumper. It also ships docling-serve (REST API) and an MCP server for agent use.
Install and first run
Both are one pip install, Python 3.10+ (Docling dropped 3.9 in v2.70.0).
pip install docling
docling https://arxiv.org/pdf/2408.09869
# → writes 2408.09869.md next to you, tables preserved as Markdown pipes
pip install marker-pdf
marker_single /path/to/paper.pdf
# → writes paper/paper.md plus extracted images to the output folder
First run of either downloads model weights from Hugging Face, so an air-gapped box needs the models pre-fetched on a connected machine first. Marker also ships marker for whole-folder batch conversion and a marker_gui for spot-checking output visually before you commit a corpus to a pipeline — genuinely useful for sampling how your specific documents survive conversion.
Accuracy and speed: what the numbers say
Marker’s README publishes olmocr-bench results (1,403 PDFs, ~8,400 tests). These are vendor-reported — Datalab runs the benchmark — so treat them as a claim, not a fact:
| Configuration | Overall score | Throughput |
|---|---|---|
| Marker balanced (GPU) | 76.0% | 2.9 pages/s |
| Marker fast (GPU) | 66.6% | 7.4 pages/s |
| MinerU (per Marker’s table) | 72.7% | — |
| Docling (per Marker’s table) | 50.3% | — |
| Marker fast, no OCR (CPU) | 43.6% | 23.7 pages/s |
Two honest readings of that table. First, even discounting vendor bias, Marker’s lead on scan-heavy and math-heavy PDFs is consistent with community reports — its OCR stack is simply deeper than Docling’s default pipeline. Second, look at the CPU row: Marker without a GPU and without OCR scores 43.6%, below the number it assigns Docling. Marker’s advantage is a GPU advantage.
The problem we hit testing this pattern on real pipelines: teams run pip install marker-pdf on a CPU-only VPS, get fast-looking throughput, and only notice weeks later that scanned invoices came through as garbage because the no-OCR fast path silently did nothing useful with them. The fix is either a GPU or switching to Docling, whose pipeline was designed CPU-first — x86_64 and arm64, macOS/Linux/Windows — and degrades far more gracefully on modest hardware.
Hardware: what you actually need
Docling runs fine on the same box that already hosts your Ollama models — CPU works, and a modest GPU accelerates the layout models. It’s the right choice for a Raspberry Pi 5-class ingestion node or any mini PC sitting in a closet.
Marker wants a CUDA GPU for its balanced mode. Neither README publishes a hard VRAM floor, so we won’t invent one — but the practical guidance from community usage is that a used RTX 3090 with 24GB comfortably runs Marker workers alongside an embedding model, which is the pairing you want during a bulk RAG ingestion anyway. For a one-time conversion of a large corpus — say, migrating years of scanned archives — renting an A100 by the hour on RunPod and batch-converting at 2.9 pages/s beats owning hardware you’ll use once.
Wiring into a local RAG pipeline
This is where Docling pulls ahead structurally. Its README lists first-party integrations for LangChain, LlamaIndex, Crew AI, and Haystack — you drop a Docling reader into an existing pipeline and get structure-aware documents out, and its chunkers work from the lossless JSON so tables don’t get split mid-row. Pair it with the embedding stack from our local embedding models guide and a vector store from the pgvector vs Chroma vs Qdrant comparison and you have a fully local ingestion path with no API keys.
Marker has no equivalent first-party framework integrations. The standard pattern is: convert to Markdown with marker, then ingest the output with whatever Markdown loader your framework already has. That works — Markdown is the universal interchange format — but you lose the structured-JSON handoff, and chunking happens on flat text. For chunking strategy itself, our RAG architecture deep dive covers why structure-aware chunking measurably beats fixed-size splits on table-heavy corpora.
If the documents you’re parsing are codebase docs destined for a coding assistant’s context, aicoderscope.com covers the tool side of that workflow, and runaihome.com has the GPU hardware guides if you’re speccing a dedicated ingestion box.
When NOT to use each
Skip Marker if you’re inside a company past the $5M threshold and nobody wants to price Datalab’s commercial license; if you have no GPU (the CPU path gives up its accuracy edge); or if your pipeline wants structured JSON with first-party framework readers rather than Markdown files.
Skip Docling if your corpus is dominated by scanned pages or LaTeX-heavy academic papers and you have a GPU — Marker’s OCR depth and math conversion are worth the license reading. Also skip it if you literally just need text from digital-born PDFs: plain pypdf is a fraction of the install weight and good enough for clean documents.
Skip both if your documents are simple, digital-born, and layout-light. A 90-line pypdf script has zero model downloads and zero surprises.
Verdict
Docling wins for most self-hosted RAG pipelines in 2026. MIT license with foundation governance, CPU-first hardware floor, structured JSON output, and first-party integrations into every framework you’re likely to run make it the default ingestion layer — the boring, correct choice. Marker is the specialist: measurably better on hard PDFs when it has a GPU under it, the only one with real LaTeX math output, and the right tool for bulk-converting difficult corpora — provided you fit inside its weights license or stay under the revenue cap. License first, hardware second, benchmarks third.
FAQ
Is Marker open source? The code is Apache 2.0, but the Surya model weights it requires are under a modified AI Pubs Open RAIL-M license — free only for research, personal use, and organizations under $5M in funding or revenue. Functionally, treat Marker as source-available with a commercial cap.
Can Docling handle scanned PDFs? Yes — it has OCR support for scanned documents and a VLM pipeline (GraniteDocling 258M). Accuracy on difficult scans generally trails Marker’s GPU pipeline, so sample your worst documents through both before committing a large corpus.
Which is better for feeding an Ollama-based RAG stack? Docling, in most cases: it integrates directly with LlamaIndex, LangChain, and Haystack, runs on the CPU alongside your models, and its structure-preserving JSON chunks cleaner. Marker fits when conversion quality on hard PDFs is the bottleneck and a GPU is available — and its --use_llm cleanup mode can point at your local Ollama endpoint.
Sources
- Marker repository (datalab-to/marker) — LICENSE, README licensing section, olmocr-bench table
- Surya repository (datalab-to/surya) — model weights license terms
- Docling repository (docling-project/docling) — MIT LICENSE, README features and integrations
- Docling technical report (arXiv:2408.09869)
Recommended Gear
- RTX 3090 — 24GB VRAM runs Marker’s balanced GPU pipeline alongside a local embedding model
- Raspberry Pi 5 — enough for a CPU-only Docling ingestion node on a home network
Was this article helpful?
Thanks for the feedback — it helps improve future articles.
Need hands-on help?
I offer 1-on-1 technical consulting for local AI setup, GPU selection, and AI coding tool configuration — same topics covered on this site.
Book a session — $49 / hour →What self-hosting actually costs
Real cost breakdowns for self-hosted AI: hardware floors, power, maintenance hours, and the honest comparison against paying for it. No spam, unsubscribe anytime.