Skip to main content

LLM fragments plugin for PyPI packages metadata

Project description

llm-fragments-pypi

Load PyPI package metadata as LLM fragments.

Installation

Install this plugin in the same environment as LLM.

llm install llm-fragments-pypi

Usage

Use -f pypi:package_name to include the package's README and metadata as fragments.

# Retrieve a package's latest version
llm -f pypi:polars "How does the performance of polars compare to pandas?"

You can optionally specify a version with the @version suffix:

# Retrieve a specific version
llm -f pypi:pydantic@1.6 "What are the Python versions supported by pydantic?"

You can combine multiple fragments:

llm -f pypi:litestar -f pypi:fastapi \
  "What are some similarities and differences between litestar and fastapi?"

And combine with other llm features:

$ llm --schema-multi "package,version" \
  -f pypi:polars \
  -f pypi:pandas \
  "What's the latest version of each package?" \
| jq .items

[
  {
    "package": "polars",
    "version": "1.27.1"
  },
  {
    "package": "pandas",
    "version": "2.2.3"
  }
]

Development

Local Setup

To set up this plugin locally, use uv:

uv run llm install -e .

It'll take care of creating a virtual environment, installing the dependencies, and you can run a uv run llm instance that will use the local version of the plugin.

Dev dependencies

Install the dev dependencies in your local environment:

uv sync --group dev

Linting & formatting

You can format and lint the code with ruff:

uv run ruff format .
uv run ruff check .

And run the pre-commit hooks:

uv run prek install

Tests

Run tests:

uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_fragments_pypi-0.1.2.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_fragments_pypi-0.1.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_fragments_pypi-0.1.2.tar.gz.

File metadata

  • Download URL: llm_fragments_pypi-0.1.2.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for llm_fragments_pypi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e83b29794b7fd2c42daf73d5b0d5ac44c143a6f2e566a6e9a97cea14d5cd1952
MD5 0017693af82d06740ee0ce04f7d63dc9
BLAKE2b-256 55bc47f568e51794acf8c84ea1d17ca0513f56e1ba364c13eb53dd2f9345fd99

See more details on using hashes here.

File details

Details for the file llm_fragments_pypi-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_fragments_pypi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f1ede4c503f0fb34c4c659b267a56d4592eb8f9bf0f6fd4a82f5645a9ebb404e
MD5 73510fb3c56c0376d468ddf79acec5be
BLAKE2b-256 0f783c6deb38528608ec8408ba895694c672057bd3d2cd31bebac432b6fde2fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page