# Repository Briefing: datalab-to/marker
> Source: https://repoforai.com/repo/datalab-to/marker (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/datalab-to/marker
- **Official Docs / Website**: https://www.datalab.to
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (96/100 · Maintenance 35/35 · Adoption 21/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v2.2.0 (2026-11-12) — https://github.com/datalab-to/marker/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: Local AI, CLI, GPU
- **Momentum**: 41,179 ★ total (+8 24h / +103 7d) · 2,984 forks
- **Topics**: `deep-learning`, `document-conversion`, `document-parsing`, `docx`, `epub`, `llm`, `markdown`, `ocr`, `pdf`, `pdf-converter`, `pdf-parser`, `pdf-to-markdown`
- **When to Use**: Best for: Teams that want local control over document ingestion, need structured output, and can route clean PDFs and difficult pages through different OCR paths. Skip if: 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.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Selective OCR: `balanced` retains usable PDF text on clean Latin prose pages and routes harder content to Surya 2.5.
- CPU-only path: `fast` runs Indra ONNX OCR in-process; `no_ocr` retains layout and reading order without recognizing text in scans.
- Integration: `ConfigParser` configures `PdfConverter`; `marker_single --stdout` streams converted output to shell pipelines.
- Batch scheduling: conversion workers share a Surya server, and the parent apportions VLM concurrency across them.
- Output inspection: `marker_gui` shows page-level layout, reading order, text lines, stage timings, and rendered output.
- Optional correction: `--use_llm` refines extracted structures such as cross-page tables and form values independently of the conversion mode.
```

## Quick Start / Clone
```bash
pip install marker-pdf
```
