How eluc1a/marker works
Marker converts document files through format-specific providers into a structured page/block model, then applies layout, OCR, table, and cleanup processing before rendering markdown, JSON, HTML, or chunks. Optional LLM processors improve or correct extracted content through configured model services. The README also documents structured extraction and a table-only converter. The sampled excerpts show selected processor and renderer behavior; links for unsampled subsystem wiring are limited to documented capabilities and clear module responsibilities.
Main entry points: pdf.py PDF converter · document.py Document model · processors Document processors · convert_single.py Conversion CLI
Components 22
User interfaces
- Conversion CLI
marker/scripts/convert_single.py - Interactive app
marker/scripts/streamlit_app.py - HTTP server
marker/scripts/server.py
Document ingestion
- Format providers
marker/providers - PDF provider
marker/providers/pdf.py
Extraction and processing
- Document model
marker/schema/document.py - Page builders
marker/builders - Layout builder
marker/builders/layout.py - OCR builder
marker/builders/ocr.py - Document processors
marker/processors - Table recognition
marker/processors/table.py - LLM corrections
marker/processors/llm - Block schema
marker/schema/blocks
Output and integrations
- PDF converter
marker/converters/pdf.py - Table converter
marker/converters/table.py - Schema extraction
marker/converters/extraction.py - Format renderers
marker/renderers - Markdown renderer
marker/renderers/markdown.py - LLM services
marker/services
Other components
- Document user
- Converted files
- LLM provider
Connections 27
- Document user → Conversion CLI: submits file
- Document user → Interactive app: uploads file
- Document user → HTTP server: sends request
- Conversion CLI → PDF converter: invokes conversion
- Interactive app → PDF converter: invokes conversion
- HTTP server → PDF converter: invokes conversion
- PDF converter → Format providers: selects format
- Format providers → Document model: provides page content
- PDF provider → Document model: provides text and refs
- PDF converter → Page builders: builds pages
- Page builders → Layout builder: creates layout
- Page builders → OCR builder: recognizes text
- Layout builder → Document model: adds page structure
- OCR builder → Document model: updates text blocks
- PDF converter → Document processors: runs processors
- Document processors → Table recognition: recognizes tables
- Document processors → LLM corrections: runs optional corrections
- Table recognition → Document model: adds table cells
- Document processors → Block schema: updates blocks
- PDF converter → Format renderers: renders document
- Format renderers → Markdown renderer: formats markdown
- PDF converter → Table converter: alternative converter
- PDF converter → Schema extraction: alternative extraction
- LLM corrections → LLM services: requests corrections
- LLM services → LLM provider: calls model
- Format renderers → Converted files: produces output
- Conversion CLI → Converted files: saves results