Pdfmux

PDF extraction that checks its own work. #2 reading order accuracy — zero AI, zero GPU, zero cost.

Last verified:

Visit Pdfmux

What is Pdfmux?

pdfmux is a universal PDF extraction orchestrator designed to fix document ingestion problems that break RAG pipelines. It uses seven extractors (PyMuPDF, OpenDataLoader, Docling, RapidOCR, Surya, Marker, Mistral OCR) routed automatically per page, plus bring-your-own-key vision LLMs like Gemini, Claude, GPT-4o, and Ollama. The tool audits every page with per-page confidence scoring and automatically re-extracts failed pages with a stronger backend, creating a self-healing pipeline that handles scanned PDFs, tables, complex layouts, and Arabic/RTL languages.

Key features include smart result caching with SHA-256 hashing and 30-day TTL for instant re-runs, streaming output via NDJSON for long documents, watch mode for auto-converting PDFs as they land in a folder, cost prediction before running, built-in profiles for invoices/receipts/papers/contracts, structured extraction of tables and key-value pairs with zero LLM cost, heading detection via font-size analysis, and value normalization for dates/currencies/rates. It outputs RAG-ready section-aware chunks with token estimates and includes 5 built-in schema presets.

pdfmux is built for developers building LLM pipelines, RAG systems, vector databases, and agent workflows. It integrates natively with MCP server for Claude and Cursor, LangChain, and LlamaIndex. The tool is MIT-licensed, runs locally on your hardware with zero network calls for the base install, supports Python 3.11-3.13, and is production-stable at v1.6.0 with 487 passing tests.

Pdfmux pricing

Pricing model: Freemium

pdfmux is completely free under MIT license with no hosted or premium tier. The base install is free at $0 per page with no AI calls or GPU required. Optional cost modes include economy ($0/page), balanced, and premium with hard budget caps. Premium mode using BYOK LLM costs approximately $0.01 per page for scanned docs and complex layouts. You only pay for LLM API calls when you opt into premium mode with providers like Gemini, Claude, GPT-4o, or Ollama. The base install plus OCR and tables extras all run locally with zero network calls.

Pdfmux pros

  • Completely free under MIT license with no hosted or premium tier
  • Per-page confidence scoring with 5 quality checks
  • Self-healing pipeline auto re-extracts failed pages
  • 7 extraction backends routed automatically per page
  • BYOK any LLM - Gemini, Claude, GPT-4o, Ollama, Mistral
  • Smart cache makes re-runs instant with 30-day TTL
  • Streaming NDJSON output for long documents
  • Watch mode auto-converts PDFs as they land in folder
  • Built-in MCP server for Claude Desktop and Cursor
  • Native LangChain and LlamaIndex loaders included
  • Structured table and key-value extraction with zero LLM cost
  • Arabic/RTL support with Unicode BiDi reordering
  • #1 free tool and #2 overall on opendataloader-bench
  • Cost prediction with hard budget caps
  • 5 built-in profiles for invoices, receipts, papers, contracts
  • Heading detection maps h1/h2/h3 automatically
  • Value normalization for dates, currencies, rates
  • Frozen API ensures code won't break on updates

Pdfmux cons

  • No GUI - CLI, Python API, and MCP server only for developers
  • Not a cloud service - must run locally on your hardware
  • OCR and tables require optional extras installation
  • LLM vision mode costs approximately $0.01 per page
  • Premium mode for scanned/handwritten PDFs requires API keys
  • Some extractors need separate installation (opendataloader, ocr, tables)
  • Base install is CPU-only, no GPU acceleration
  • No web interface or upload form available

Frequently asked questions about Pdfmux

How is pdfmux different from just using PyMuPDF?

PyMuPDF is one of pdfmux's backends. pdfmux adds a quality audit on top: it scores every page, detects failures (blank output, mojibake, broken columns), and automatically re-extracts bad pages with a better extractor. PyMuPDF alone gives you text. pdfmux gives you reliable text with per-page confidence scoring and self-healing extraction.

Does it work offline?

Yes. The base install plus the OCR and tables extras all run locally with zero network calls. LLM providers (Gemini, Claude, GPT-4o) require API keys and internet. Ollama runs fully local. You can run an air-gapped pipeline with pip install pdfmux[ocr,tables,llm-ollama].

What about scanned PDFs, stamps, or handwriting?

Use --mode premium with any LLM provider: pip install pdfmux[llm-claude] for Claude, pdfmux[llm] for Gemini, or pdfmux[llm-openai] for GPT-4o. pdfmux routes scanned/handwritten pages to your LLM automatically. The base install is CPU-only and handles 90% of digital PDFs without any API key.

Is it production ready?

v1.4.0 is production stable with a frozen API. 487 tests passing. Agentic multi-pass extraction, cost-aware routing, budget caps, and configurable timeouts make it safe for processing untrusted documents at scale. Current version is v1.6.0.

Can I use it with LangChain or LlamaIndex?

Built-in. Install pdfmux[langchain] or pdfmux[llamaindex] and use the native loader classes. They return standard Document objects with confidence metadata attached. pdfmux is the only loader with per-page quality scoring — filter low-confidence chunks before embedding to keep garbage out of your vector store.

What's the best free alternative to LlamaParse?

pdfmux. LlamaParse costs $3 per 1,000 pages and sends documents to a paid cloud API. pdfmux is MIT-licensed, runs locally on CPU, and ranks #2 on the opendataloader-bench (0.900 vs best paid at 0.909). BYOK LLM fallback (Claude, GPT-4o, Gemini, Ollama) is optional — you only pay for the pages that actually need LLM help.

Does pdfmux have an MCP server for Claude Desktop and Cursor?

Yes, built in. After pip install pdfmux, add pdfmux to your claude_desktop_config.json or Cursor MCP config. It exposes tools for PDF-to-markdown extraction, table extraction, and per-page quality audits — so Claude or Cursor can read any PDF reliably with zero additional setup.

Why does my RAG pipeline hallucinate on PDF documents?

Most RAG hallucinations on PDFs start at extraction, not retrieval. Standard extractors silently fail on scanned pages, two-column layouts, tables, and mojibake. Your chunks look fine but contain broken text. pdfmux scores every page (0–1 confidence), detects failures, and automatically re-extracts bad pages with a stronger backend — so your embeddings are built on clean text, not silent garbage.

How does pdfmux detect bad pages in PDF extraction?

4-signal per-page confidence scoring: (1) text density vs page area, (2) character distribution (catches mojibake), (3) structural coherence (catches broken column order), and (4) OCR-comparison probe when under threshold. Pages below the quality bar get re-extracted with a different backend (OpenDataLoader, Docling, OCR, or an LLM) until quality is recovered.

Can pdfmux extract tables from scanned PDFs?

Yes. pdfmux routes scanned pages through RapidOCR and IBM Docling's table-structure model (97.9% TEDS accuracy on complex tables). Install with pip install pdfmux[ocr,tables]. For handwritten tables or very poor scans, use --mode premium with an LLM provider to recover tables rule-based backends can't.

Categories

Use cases

Browse all AI tools on NeedAnAI