datalab-to/marker
Hybrid OCR and layout parsing for document ingestion in RAG pipelines
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Marker is a Python document-conversion stage for RAG ingestion, not the index or retrieval layer. Its CPU paths combine pdftext with in-process Indra ONNX layout and reading-order analysis. no_ocr uses the embedded text layer without recognizing images, while fast adds Indra OCR. balanced keeps clean Latin prose on the text-layer path and sends difficult content to Surya 2.5; vllm sends every page through full-page Surya OCR, bypassing pdftext and Indra.
The package depends on pdftext, indra-ocr, and surya-ocr. For Python integration, marker.converters.pdf.PdfConverter takes model artifacts from create_model_dict() and configuration from ConfigParser, which selects processors, a renderer, and an optional LLM service. This separates document extraction from output formatting and LLM correction, so an integration can change renderers or correction settings without replacing the extraction pipeline.
Key Capabilities & Differentiators
Marker converts PDF, image, PPTX, DOCX, XLSX, HTML, and EPUB inputs to Markdown, JSON, chunks, or HTML. It extracts images, removes running headers and footers by default, and formats tables, equations, and forms. The interactive viewer exposes layout blocks, reading order, text lines, stage timings, and rendered output page by page, making it possible to distinguish extraction failures from rendering problems.
The four-mode comparison reports OmniParseBench score and throughput, respectively: no_ocr 42.4 and 57.0 pages/s, fast 78.6 and 23.6 pages/s, balanced 80.5 and 16.9 pages/s, and vllm 85.9 and 4.5 pages/s. These are benchmark results, not capacity guarantees. Separately, --use_llm can improve cross-page table merges, inline math, and form-value extraction using providers such as Gemini, Claude, OpenAI-compatible endpoints, or Ollama.
Trade-offs & Limitations
Routing pays off when much of a corpus is clean and born-digital. balanced is substantially faster than full-page Surya OCR in the mode comparison, but its table score is 72.9 versus 78.3 for vllm. MinerU 2.5-Pro scores 92.1 on tables at a reported 0.54 pages/s, a useful comparison for table-heavy collections where throughput is secondary. Datalab's hosted accurate tier scores 94.1 overall versus 85.9 for Marker vllm in the comparison table, but has no listed throughput there.
Do not extrapolate the no_ocr throughput to mixed scan batches, or size a fleet from one headline rate: fast is separately reported at roughly 33 pages/s on digital PDFs and 7.4 on a mixed workload. Local parsing avoids a hosted parser dependency, but Surya modes add server operations, while hosted LLM correction adds network, cost, and data-governance considerations. Apache-2.0 covers the code, not the separately licensed weights.
Hardware & Deployment Guide
Start with Python 3.10+ and PyTorch, then install marker-pdf; use marker-pdf[full] for the additional non-PDF format dependencies. fast and no_ocr do not require a separate VLM server. For Surya-backed modes, Marker can launch a local inference server on first use: vLLM via Docker and the NVIDIA Container Toolkit on NVIDIA, or the llama-server binary through llama.cpp on CPU or Apple Silicon. Set SURYA_INFERENCE_URL to use an existing server instead.
For directory batches, marker shares a single inference server across workers and apportions VLM requests against server capacity. Use --skip_existing to resume and tune --workers against CPU, memory, and inference capacity rather than assuming more processes will help. The v2.0.0 rewrite focused on CPU support and rebuilt the extraction stack; v2.1.0 adopted Surya 2.5; v2.2.0 added the four-mode interface, in-process Indra ONNX, and the interactive viewer. Release metadata lists v2.2.0, while the supplied manifest says 2.2.1; pin and test the artifact you deploy.
balanced retains usable PDF text on clean Latin prose pages and routes harder content to Surya 2.5.fast runs Indra ONNX OCR in-process; no_ocr retains layout and reading order without recognizing text in scans.ConfigParser configures PdfConverter; marker_single --stdout streams converted output to shell pipelines.marker_gui shows page-level layout, reading order, text lines, stage timings, and rendered output.--use_llm refines extracted structures such as cross-page tables and form values independently of the conversion mode.Teams that want local control over document ingestion, need structured output, and can route clean PDFs and difficult pages through different OCR paths.
You need an integrated vector database, cannot support a Surya server for hard documents, or require complex-table fidelity that Marker has not met on your own test corpus.
Quick Start & Installation
pip install marker-pdfComparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| marker ★ | 41.2k | +103 | Python | Apache-2.0 | Hybrid OCR and layout parsing for document ingestion in RAG pipelines |
| MinerU | 84.7k | +326 | Python | — | Local document parser and library for structured RAG ingestion and page-level ci |
| docling | 71.4k | +285 | Python | MIT | Local-first document parser for structure-aware RAG ingestion |
| markitdown | 199.7k | +909 | Python | MIT | Python library and CLI that turn mixed-format documents into Markdown for RAG in |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/datalab-to/marker.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about marker
How should I connect Marker to a RAG pipeline?
marker_single for individual documents or marker for directory batches. Chunks are convenient for a first ingestion pass; use JSON when downstream code needs to inspect document structure or apply its own chunking rules. Python services can configure PdfConverter through ConfigParser. Marker produces ingestion artifacts; embedding, indexing, and retrieval belong downstream.Do I need a GPU, and how should I size a batch worker?
fast runs Indra OCR in-process on CPU/MPS, and no_ocr is CPU-only. On NVIDIA, balanced and vllm can launch a Docker-backed Surya server that batch workers share. There is no fixed VRAM figure in the supplied specifications; measure peak memory and throughput on representative documents while tuning worker count and VLM concurrency separately.Can I self-host Marker commercially and keep documents on-premises?
When should I benchmark Marker against Docling or MinerU?
balanced scored 80.5 at 16.9 pages/s versus Docling at 67.5 and 2.1 pages/s. MinerU 2.5-Pro scored 92.1 on tables versus 78.3 for Marker vllm, despite lower reported throughput. If tables dominate retrieval quality, inspect table structure on your own files before choosing on overall score or speed.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy