marker (datalab-to/marker)

docx
Searching Database…

40.5K ·GitHub
What is this?Marker is a document conversion tool that turns PDFs (and other document types) into markdown, JSON, HTML, or chunked output quickly and accurately, extracting tables, equations, forms, and images along the way.
Is this a Python library, a CLI tool, or both?Both — it is a Python library with converter classes like PdfConverter and TableConverter, and it also ships CLI commands (marker_single, marker) plus a Streamlit demo app for interactive testing.
How do I install and run it?Install with pip after setting up Python 3.10+ and PyTorch, then run marker_single on a single PDF or marker on a folder for batch conversion; converting non-PDF formats like DOCX or PPTX needs extra dependencies installed.
What's the tradeoff between fast mode and balanced mode?Balanced mode (default on GPU) uses the surya VLM for layout and re-OCRs any page whose embedded text looks bad for the highest quality, while fast mode (default on CPU/MPS) uses a lighter layout detector and keeps VLM calls minimal, trading some accuracy on scanned or garbled pages for speed.
Can I use the model weights commercially for free?The code is Apache 2.0 and free for any use including commercial, but the model weights use a modified AI Pubs Open Rail-M license that's only free for research, personal use, and startups under $5M in funding/revenue — above that you need a paid license.
Which LLM providers can boost accuracy?Passing --usellm lets marker call Gemini, Claude, OpenAI-compatible endpoints, Azure, Vertex, OpenRouter, or Ollama models to merge tables across pages, fix inline math, and extract form values.
What file formats besides PDF can it convert?It also handles images, PPTX, DOCX, XLSX, HTML, and EPUB files in addition to PDFs, though non-PDF formats require extra dependencies to be installed.
How accurate is Marker compared to other PDF tools?On the olmocr-bench benchmark of 1,403 PDFs, balanced mode scores 76.0% overall and 83.5% on born-digital PDFs, ahead of MinerU and docling and within range of much larger vision-language models.
Can I extract just the tables from a document?Yes, the TableConverter pipeline only detects and converts tables, emitting them as HTML blocks (or JSON with page bounding boxes) via the CLI or Python API.
Creator
datalab-to
Size
20.5 MB
Stars
40.5K
Age
2y
Commits · 90 Days