Skip to main content

llm-fragments-pdf

A fragment loader for LLM that converts PDF files into markdown plaintext using PyMuPDF4LLM.

This is especially useful for models which don't support attachments.

PyPI Changelog Tests License

Installation

Install this plugin in the same environment as LLM:

llm install llm-fragments-pdf

Usage

Use -f 'pdf:filepath' convert a pdf file to markdown text and insert that text as a fragment.

Example:

llm -f 'pdf:my_pdf.pdf' "What is this document about?"

The output includes:

  • Filename
  • PDF contents as markdown

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-fragments-pdf
python -m venv venv
source venv/bin/activate

Install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Dependencies

  • PyMuPDF4LLM: For extracting markdown from PDFs
  • llm: The LLM CLI tool this plugin extends

Metadata

Release files for llm-fragments-pdf 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-fragments-pdf 0.1
File Size Uploaded
llm_fragments_pdf-0.1.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-fragments-pdf 0.1
File Interpreter ABI Platform
llm_fragments_pdf-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / llm_fragments_pdf-0.1.tar.gz

Download URL llm_fragments_pdf-0.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
59d71ec2d111b10401de54fa65dd19b6e1bd01951ff084b56bf599b538815766
BLAKE2b-256 checksum
How to use checksums
591942a425f22fd0ed8797a229ff05499e725bee8dae6fdfa5ab451697541e99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 18, 2025.

Transparency log

Release files / llm_fragments_pdf-0.1-py3-none-any.whl

Download URL llm_fragments_pdf-0.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d821e2d82ebcff5310bda71447494330982ffee773dbcca7b7ecee8275655f7f
BLAKE2b-256 checksum
How to use checksums
09507353f001911b73caf4eaec112bf2ce4421af50f3b0e03040506a60608aa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 18, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page