Marker

datalab-to/marker β€” a document-intelligence converter from Datalab that turns PDF, image, PPTX, DOCX, XLSX, HTML, and EPUB files into clean markdown, JSON, chunks, or HTML, in all languages. It formats tables, forms, equations (inline + block math), links, references, and code blocks, and extracts/saves embedded images. Layout, OCR, and table recognition run through a single Surya VLM served by a local inference server (vLLM on NVIDIA GPUs, llama.cpp elsewhere).

In the LLM App Engineering Stack this is the ingestion / parsing lane: the front door that converts messy source documents into LLM-ready markdown before chunking (Chonkie) and indexing (Qdrant). Complements Crawl4AI (web β†’ markdown) on the file side, and sits alongside PageIndex / MinerU / Unlimited-OCR in the document-to-text tooling I track.

Description

  • Repo: https://github.com/datalab-to/marker
  • Managed platform: https://www.datalab.to
  • License: code Apache-2.0 (free incl. commercial); model weights under a modified AI Pubs Open Rail-M β€” free for research, personal use, and startups under $5M funding/revenue; commercial beyond that needs a Datalab license.

Download or use

pip install marker-pdf          # core
pip install marker-pdf[full]    # + all converters/deps
# convert a single file
marker_single /path/to/file.pdf --output_format markdown
# point at an already-running inference server instead of spawning one
export SURYA_INFERENCE_URL=http://host:port/v1
from marker.converters.pdf import PdfConverter
# output_format: markdown | json | html | chunks

πŸ—’οΈ Description

🧩 Modes & formats

  • Inputs: PDF, image, PPTX, DOCX, XLSX, HTML, EPUB.
  • Outputs: markdown, JSON (with page bounding boxes), HTML, or pre-chunked segments.
  • Hybrid mode β€” mixes fast heuristics with the VLM for a speed/accuracy trade-off; balanced and full-VLM paths available.
  • Tables emitted as HTML <table> blocks; force_layout_block=Table skips layout detection when every page is a table.

🧩 Backend

The Surya VLM inference server is spawned automatically on first use (Docker + NVIDIA Container Toolkit for GPU), or you point Marker at an existing server via SURYA_INFERENCE_URL.

✍️ Reasoning for

  • RAG ingestion quality β€” retrieval is only as good as the parse; Marker’s equation/table/reference fidelity beats naive pdf2text for technical PDFs, which is exactly the failure mode in document-heavy RAG.
  • Local + private β€” runs on-prem (no uploading client PDFs to a third party), important for Tech To The Rescue-style engagements.
  • Structured output β€” JSON with bounding boxes enables layout-aware chunking rather than blind splitting.

Weak points: GPU strongly recommended for throughput; the model-weight license restricts larger commercial use (code is fine); VLM parsing is heavier than regex extraction when documents are simple.

Alternatives considered

  • MinerU β€” similar PDFβ†’markdown VLM pipeline; benchmark both on your document mix.
  • PageIndex β€” solves retrieval over long docs (vectorless tree index), not the raw parse; downstream of Marker.
  • Docling (IBM) β€” strong structured-document extraction, Apache-2.0.
  • Unstructured.io β€” broad format coverage, more of an ETL framework.
  • Naive pdfplumber/pymupdf β€” fine for clean text PDFs, poor on tables/math/scans.

πŸ”— Resources


Template: tool