https://txtfetch.com/compare/libraries/pymupdf4llm/
txtfetch vs PyMuPDF4LLM
PyMuPDF4LLM is an open-source library you run yourself. txtfetch is one HTTP call. Here's an honest look at the licence, the operational cost, and where each one wins.
What PyMuPDF4LLM is
PyMuPDF4LLM is built by Artifex Software (maintainer of PyMuPDF and the MuPDF engine). A PDF-first extension of PyMuPDF, built for fast Markdown and JSON output with no GPU.
PyMuPDF4LLM inherits PyMuPDF's own dual licence. Use it under AGPL-3.0, or pay Artifex for a commercial licence if AGPL's copyleft terms don't fit your product. This is the strictest default licence of the five. AGPL requires that a network service built on it also offer its own source. That's a real constraint for a hosted product, not just a library you vendor in.
Licence checked 2026-09. See the project's own LICENSE file.
Checked against the project's own LICENSE file, not a summary of it. A licence can change between releases, so check the LICENSE of the exact version you pin, not this page. This is a factual summary, not legal advice.
at a glance
PyMuPDF4LLM
- Code licence
- Dual-licensed: GNU AGPL-3.0, or a paid Artifex commercial licence
- Model-weights licence
- None — ships no model weights
- Install
- pip install pymupdf4llm (pulls in PyMuPDF and pymupdf-layout). Office-format support needs the separate, paid PyMuPDF Pro add-on.
- Model weights
- None. PyMuPDF4LLM is a heuristics-and-C-engine parser, with no bundled neural model.
- GPU
- Not applicable. Nothing in PyMuPDF4LLM's own pipeline needs one.
- Formats
- PDF is the primary, fully supported format. Other formats PyMuPDF itself can open (XPS, EPUB, and a few image formats) pass through the same API. DOCX, XLSX, and PPTX need the separate paid PyMuPDF Pro package.
- Output
- Markdown, JSON (with bounding-box and layout metadata), plain text, and a page-chunked mode with metadata per chunk for a vector store.
- OCR
- Hybrid and selective: PyMuPDF4LLM inspects each page first and only routes the illegible or image-only regions to Tesseract, which you install and manage yourself. A clean, born-digital page skips OCR entirely.
txtfetch
- Code licence
- N/A — hosted API, no code to license
- Model-weights licence
- N/A — no weights on your infrastructure
- Install
- None. One HTTP call.
- Model weights
- None on your side. Tika and Tesseract run on ours.
- GPU
- None needed. quality=premium routes to a VLM on our infrastructure.
- Formats
- Every format on the coverage list, one endpoint.
- Output
- Text, Markdown, or element JSON.
- OCR
- Standard tier: eng, osd. quality=premium for a hard scan. See /languages.
capability table
| Capability | PyMuPDF4LLM | txtfetch |
|---|---|---|
| Hosting | self-hosted only | hosted API* |
| Ships neural model weights | – | – |
| GPU required | – | –* |
| Table extraction | + | + |
| OCR engine bundled | ~ | +* |
| Structured or JSON output | + | +* |
| Built-in chunking for RAG | + | –* |
| Single HTTP endpoint | – | + |
* txtfetch notes: One HTTP call. No install, no model download, no server to run and patch. The standard tier runs on Tika and Tesseract, CPU only. quality=premium routes a document to a vision-language model on our infrastructure, not yours. The standard OCR tier ships English trained data plus script detection only (TESSDATA_LANGS=eng osd). See /languages for the per-language detail and quality=premium for a hard scan. ?format=markdown and ?format=json ship today. Schema-defined field extraction, pulling named fields to your own schema, is on the roadmap, not shipped yet. txtfetch returns text, Markdown, or element JSON. Chunking stays a caller-side step, the same reasoning behind every guide on /fixes.
No accuracy or speed figure is measured against PyMuPDF4LLM on this page. See /benchmarks for txtfetch's own measured numbers and their caveats.
where pymupdf4llm wins
- The fastest path in this comparison for a native, born-digital PDF: a pure C engine with no model to load and no GPU to provision.
- Selective, hybrid OCR that only touches the regions of a page that actually need it, instead of OCR-ing every page of a mixed document.
- Page-level chunking with metadata built directly into the output, ready for a vector store with no extra chunking step.
- A tiny dependency footprint for a PDF-only pipeline, with no model weights to download or version.
the work you still own
PyMuPDF4LLM is free to run. Running it in production is a separate job. This is the checklist that job includes.
- Installing and maintaining Tesseract yourself for the OCR path, including its own language packs, since PyMuPDF4LLM only calls out to it.
- Paying for and installing PyMuPDF Pro if your pipeline needs Word, Excel, or PowerPoint files, since the free package covers PDF only.
- Reviewing the AGPL-3.0 terms against your own product shape, or budgeting for Artifex's commercial licence if AGPL's network-copyleft clause doesn't fit.
- Patching PyMuPDF, PyMuPDF4LLM, and your own Tesseract install as new CVEs and PDF edge cases surface.
where txtfetch wins
- One HTTP call. No install, no model download, no GPU to provision, and no server to patch.
- The standard OCR tier ships English trained data plus script detection only (
TESSDATA_LANGS=eng osd). See /languages for the per-language detail, and requestquality=premiumfor a hard non-English scan. - A durable free tier (500 documents/month, ongoing), so trying it costs nothing and no card.
txtfetch strips HTML markup, not boilerplate, the same as /fixes describes it. Nav, footer, and cookie-banner text still comes back as ordinary text. Deciding what's chrome versus article stays a caller-side step. We also don't ship schema-defined field extraction yet. See the capability table above for the full list.
the same job, one call
This is the whole integration: no install, no model download, no GPU.
curl -s -X POST "https://api.txtfetch.com/v1/extract?format=markdown" \
-H "Authorization: Bearer $TXTFETCH_KEY" \
-F file=@document.pdffrequently asked questions
- Is PyMuPDF4LLM's AGPL licence a problem for a hosted product?
- It can be. AGPL-3.0 requires that a network service built on AGPL-licensed code also offer its own source to users of that service. Check the licence against your own product shape, or use Artifex's paid commercial licence if AGPL doesn't fit. This is not legal advice.
- Does PyMuPDF4LLM need a GPU?
- No. It's a C-engine PDF parser with no bundled neural model, so nothing in its own pipeline benefits from one.
- Can PyMuPDF4LLM read Word or Excel files?
- Only through PyMuPDF Pro, a separate paid add-on. The free, AGPL-licensed package parses PDF (and a few other formats PyMuPDF itself opens) only.
sources
- pymupdf4llm: LICENSE (AGPL-3.0)
- pymupdf4llm: README (features, hybrid OCR, install)
- PyMuPDF on PyPI (dual licence statement)
- pymupdf4llm on PyPI
Checked against the project's own LICENSE file, not a summary of it. A licence can change between releases, so check the LICENSE of the exact version you pin, not this page. This is a factual summary, not legal advice.
Keep the library. Add the hard formats.
Some teams run both. Send only the files PyMuPDF4LLM cannot read.
Read the quickstart →