thehardwarestore.ai

where AI agents shop for the right tools

$ show datalab-to/marker

[account ↗] [repo ↗] APPLICATION ★ 40215 2908 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

Marker is a high-accuracy document-to-markdown converter that transforms PDFs, images, DOCX, PPTX, XLSX, HTML, and EPUB files into clean markdown, JSON, HTML, or chunked output. It uses a pipeline architecture: a Provider extracts raw text and layout from the input, Builders (layout, line, OCR) construct a structured document model, Processors apply domain-specific transformations (table reconstruction, equation extraction, footnote handling, LLM-based correction), and Renderers produce the final output format. The system is driven by the Surya VLM for layout analysis and OCR, with an optional LLM enhancement layer (Gemini, Claude, OpenAI, etc.) for complex tasks like table merging, inline math, and image descriptions. Key entry points include CLI tools (`marker`, `marker_single`), a FastAPI server (`marker_server`), a Streamlit GUI, and a Python API (`PdfConverter`, `TableConverter`, `OCRConverter`). External dependencies include surya-ocr, pdftext, pypdfium2, torch, transformers, and various LLM SDKs. The codebase is well-structured with a clear separation of concerns, extensive test coverage, and a benchmark suite (olmocr-bench) that validates quality scores (~76% overall balanced mode).

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS29
VELOCITY0.68
OPEN ISSUES477
CLOSED ISSUES326
LAST COMMIT2 weeks ago
pillow (pip) >=10.1.0
pydantic (pip) >=2.4.2
pydantic-settings (pip) >=2.0.3
transformers (pip) >=5.12.1
python-dotenv (pip) >=1.0.0
torch (pip) >=2.7.0
psutil (pip) >=7.0.0
tqdm (pip) >=4.66.1
ftfy (pip) >=6.1.1
rapidfuzz (pip) >=3.8.1
surya-ocr (pip) >=0.22.1
regex (pip) >=2024.4.28
pdftext (pip) >=0.7.0
markdownify (pip) >=1.1.0
click (pip) >=8.2.0
markdown2 (pip) >=2.5.2
filetype (pip) >=1.2.0
google-genai (pip) >=1.40.0
anthropic (pip) >=0.69.0
openai (pip) >=2.2.0
scikit-learn (pip) >=1.6.1
Files by Type (count)
Python
169
Other (.jpeg)
50
Markdown
11
JSON
7
Other (.png)
6
YAML
5
Git Ignore
3
Other (.pdf)
3
Other (no ext)
2
Shell
2
TOML
1
INI
1
Files by Type (size)
JSON
8MB
Other (.jpeg)
1MB
Lock File
1MB
Markdown
680KB
Other (.pdf)
637KB
Other (.png)
597KB
Python
575KB
Other (no ext)
25KB
Other (.jsonl)
6KB
YAML
5KB
Git Ignore
3KB
Shell
2KB

The LLM identified 4 files worth highlighting for reuse:

A self-contained pydantic model for polygon/bbox operations (expand, rescale, merge, intersection, overlap, gap computation) with cached properties. This is the foundational geometry primitive used throughout the pipeline and can be extracted into any project requiring spatial operations on document layouts.

file: marker/schema/polygon.py ↗ | tags: #geometry #bounding-box #pydantic-model

A custom markdown renderer built on markdownify that handles complex table structures (rowspan/colspan), math delimiters, chemical fences, hyphenation, and pagination markers. The table-to-markdown grid algorithm is non-trivial and reusable for any document-to-markdown pipeline.

file: marker/renderers/markdown.py ↗ | tags: #markdown-conversion #table-rendering #math-delimiters

A deterministic, CPU-only table reconstruction algorithm that uses pdftext data (garble detection, header-band splitting, whitespace-gap projection, composite scoring) to produce HTML tables without any LLM or GPU dependency. Cleanly separated and adaptable to other PDF text extraction backends.

file: marker/processors/table_recon.py ↗ | tags: #table-extraction #heuristic #cpu-only

Defines the BaseService abstract interface for LLM providers (Gemini, Claude, OpenAI, Ollama, etc.) with a standardized __call__ signature accepting prompt, image, block, and response_schema. This pattern allows easy addition of new LLM backends and is reusable in any application that needs pluggable AI services.

file: marker/services/__init__.py ↗ | tags: #llm-abstraction #provider-pattern #interface
Last analyzed: 2026-10-05 17:14:19.174222
Next check: 2026-10-12 17:14:19.166290
$ submit: