4LLM

PyMuPDF4LLM
now ships with Layout.

TRY DEMO

Open Source All The Way Down: PyMuPDF4LLM Goes Fully AGPL

August 10, 2026

Open Source All the way Down

With PyMuPDF4LLM 1.28.2, we move to a fully AGPL v3 licensing with the PyMuPDF Layout package dependency and all the source goes public. The fastest CPU-only layout engine for PDF is now genuinely open source.

What's Changing

Until now, PyMuPDF4LLM contained PyMuPDF Layout which was shipped under a dual PolyForm Noncommercial / Artifex Commercial arrangement, distributed as binary wheels only. It worked, but it made PyMuPDF Layout the odd one out in a stack that is otherwise open source and AGPL licensed from top to bottom.

As of 1.28.2, that changes:

  • PyMuPDF Layout is licensed under the GNU AGPL v3, the same license as MuPDF, PyMuPDF and PyMuPDF4LLM.
  • The source code is public, at github.com/ArtifexSoftware/pymupdf_layout.
  • A commercial license remains available from Artifex for teams who can't meet AGPL obligations. This brings parity with the rest of the PyMuPDF family.

One stack, one licensing model, no special cases.

Why the Licensing Matters

The AGPL is a known quantity. Unlike the PolyForm Noncommercial it’s Open Source Initiative approved, it has three decades of interpretation behind it, and it's already sitting in your dependency tree via MuPDF and PyMuPDF. Your legal team has almost certainly ruled on it before.

One license question for the whole stack. MuPDF at the bottom, PyMuPDF above it, PyMuPDF4LLM and PyMuPDF Layout at the top: every layer of the pipeline now answers to the same question: AGPL, or commercial? Whatever you decided for PyMuPDF, you've already decided for Layout.

Commercial projects have an open-source path. The AGPL is a strong copyleft license, not a free-for-all. Therefore a commercial project willing to meet its obligations can use PyMuPDF Layout without a purchase order. The previous PolyForm Noncommercial license restricted that kind of use.

The source is auditable. For a component making structural decisions about your documents being able to read the code matters. If PyMuPDF Layout mis-classifies something in your corpus, you can go and look at why, open an issue with a real diagnosis, or send a patch via a pull request. This makes adoption easier for your engineering teams and for your project.

PyMuPDF Layout - a Quick Refresher

But what is PyMuPDF Layout and what makes it such a powerful tool in your document parsing pipeline? Let’s have a quick refresher …

Simply put, PyMuPDF Layout performs document layout analysis: it takes a PDF page and works out what the structure actually is (titles, headings, headers and footers, tables, lists, images, text styling) and hands you clean Markdown, JSON or plain text, ready for your downstream actions.

The interesting part is how it gets there. Most document-AI tooling renders each page to an image and runs a vision model over the pixels. That means a GPU, a fat container, and a per-page cost you feel across a large corpus. PyMuPDF Layout instead trains Graph Neural Networks directly on PDF internals. It utilizes the objects, positions and relationships that are already in the file. The result is roughly 10× the speed on CPU-only hardware, with no GPU anywhere in the stack.

For anyone running document ingestion at volume, this means the difference between renting GPUs by the hour and running a handful of standard CPU instances.

No Cloud Required

Another benefit which can’t be underestimated for privacy first or air-gapped environments is that there is no external internet or cloud dependency for PyMuPDF Layout. The local modal will operate faithfully with fast local processing only.

No cloud dependencies

Rich Data

PyMuPDF Layout delivers rich structured data as Markdown, JSON or plain text:

import pymupdf
import pymupdf4llm

doc = pymupdf.open("your.pdf")

md = pymupdf4llm.to_markdown(doc)
json = pymupdf4llm.to_json(doc)
txt = pymupdf4llm.to_text(doc)
Note

PyMuPDF4LLM uses the PyMuPDF Layout package automatically and there's no new API surface to learn.

For example using to_json() we present rich structured data with positional bounding box objects for your input document:

JSON data schema

Which License Applies To You?

AGPL is a strong copyleft license, and the network clause is the part most people miss.

If you're...Then...
Building an open-source project under AGPL-compatible termsUse it freely under the AGPL
Doing internal work you never distribute or expose as a serviceThe AGPL obligations generally don't bite
Shipping a proprietary product, or running it behind a public API or SaaSThe AGPL's network clause applies and you'll need a commercial license - get in touch with Artifex

If you're evaluating PyMuPDF Layout, the AGPL route now lets you prototype, benchmark and read the source without a procurement cycle first. That was the main thing standing between the library and the people who'd benefit from it most.

Try It Today

Grab PyMuPDF with pip install:

pip install --upgrade pymupdf pymupdf-layout pymupdf4llm

Issues and pull requests are open. Now that you can see the code, in the spirit of Open Source Software we'd love you to get involved and help PyMuPDF Layout keep evolving and improving.




Discuss This Article with the Community

Have a question, a different approach, or something you built after reading this? Share it on the forum or join the Discord, we'd love to hear from you.

PyMuPDF Logo

© 2026 Artifex Software Inc. All rights reserved.