About this project
Marker is a document conversion tool from Datalab that turns PDFs and other document formats into Markdown, JSON, HTML, or chunks. According to the README, it supports PDF, image, PPTX, DOCX, XLSX, HTML, and EPUB inputs in all languages, and handles tables, forms, equations, inline math, links, references, and code blocks. It can extract and save images and remove headers, footers, and other artifacts.
The project offers two main conversion modes. Balanced mode is aimed at GPUs and uses a surya VLM for layout, OCRs inline math, and re-OCRs whole pages when embedded text is poor. Fast mode is optimized for CPU, uses a lightweight rf-detr layout detector with pdftext extraction, and keeps VLM use minimal. A --disable_ocr option turns off all VLM calls for pure text-layer extraction. Marker runs on GPU, CPU, or MPS.
An optional --use_llm flag enables hybrid mode for higher accuracy, supporting Gemini, Claude, OpenAI-compatible endpoints, Azure, Vertex, OpenRouter, and Ollama. The README states that balanced mode scores 76.0% overall on olmocr-bench, a third-party benchmark of 1,403 PDFs, and 83.5% on born-digital PDFs.
Installation is via pip install marker-pdf, with marker-pdf[full] for non-PDF formats. Usage includes a Streamlit GUI (marker_gui), single-file conversion (marker_single), and folder conversion (marker) with options for page ranges, output formats, workers, chunking across machines, and skipping existing files. A Python API exposes PdfConverter, TableConverter, and OCRConverter classes, plus a ConfigParser for custom configuration. Output formats include Markdown with image links and LaTeX equations, HTML, a tree-structured JSON with block types and polygons, and a flattened chunks format intended for RAG. A simple FastAPI server can be started with marker_server.
The code is Apache 2.0 licensed, while model weights use a modified AI Pubs Open Rail-M license. The README also mentions a managed platform running the Chandra model with higher accuracy, zero data retention by default, SOC 2 Type 2, and custom BAAs.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.