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).
MinerU is a production-grade document parsing engine that converts PDFs, images, and Office documents (DOCX, PPTX, XLSX) into structured Markdown and JSON. It supports multiple backends: a fast pipeline (layout analysis + OCR + formula/table recognition), a high-accuracy hybrid mode combining VLM and OCR, and a pure VLM mode using vLLM/LMDeploy. The system is deployed as a CLI tool, FastAPI service, Gradio web UI, or Docker container, with integrations for RAG frameworks like LangChain, LlamaIndex, and Dify. The codebase is well-architected with clean abstractions for data I/O (file/S3), model initialization (singleton pattern), and output generation (client-side rendering). It handles 109 languages and includes specialized modules for mathematical formula recognition (UniMERNet), table structure recovery (SLANet+/UNet), and office document normalization. While the code is actively maintained and functionally rich, it carries some technical debt from its PaddleOCR heritage (vendored code, eval-based builders) and has a complex optional dependency matrix for hardware accelerators.
pymupdf4llm is a library and CLI tool that converts PDFs (and other documents) into clean Markdown, JSON, plain text, or layout-aware chunks specifically optimized for LLM and RAG workflows. It provides a high-level API (`to_markdown`, `to_json`, `to_text`, `to_chunks`) that internally uses either a legacy heuristic approach or an optional GNN-based layout parser (via `pymupdf-layout`) to extract text, tables, images, and reading order. The repository also includes a deterministic chunking pipeline that uses only PDF-native layout signals (box boundaries, font jumps, vertical gaps) to produce context-preserving chunks without embeddings. OCR support is built-in, with a hybrid decision model (ONNX-based) that selectively applies Tesseract, RapidOCR, or PaddleOCR to pages that need it. Framework integrations for LlamaIndex and LangChain are provided. The architecture is primarily a monolithic library with two parallel conversion paths (legacy and layout-based), a chunking subpackage, an OCR subsystem with abstract backends, and a batch converter for large-scale processing. While the code is generally well-structured, the presence of two parallel conversion paths and tight coupling to PyMuPDF internals introduce some maintenance risk.