Skip to main content

LLMling

PyPI License Package status Monthly downloads Distribution format Wheel availability Python version Implementation Releases Github Contributors Github Discussions Github Forks Github Issues Github Issues Github Watchers Github Stars Github Repository size Github last commit Github release date Github language count Github commits this month Package status PyUp

Declarative resources, prompts and tools for LLM applications, defined in YAML.

LLMling turns a YAML file into a runtime that serves content (resources), message templates (prompts) and Python callables (tools) to an LLM consumer. It was built as the backend for mcp-server-llmling and llmling-agent; its ideas live on in agentpool.

Read the documentation!

Installation

pip install llmling

Optional extras: llmling[git] (repository resources), llmling[watch_files] (file watching via watchfiles), llmling[fsspec_extras] (HTTP/GitHub filesystems).

Quickstart

Define an environment in config.yml:

resources:
  greeting:
    type: text
    content: "Hello from LLMling!"
  notes:
    type: path
    path: "./notes.md"
    description: "Project notes"

tools:
  word_count:
    import_path: "my_tools.word_count"  # any importable callable
    description: "Count words in a text"

prompts:
  summarize:
    type: text
    description: "Summarize a text"
    messages:
      - role: system
        content: "You are a concise assistant."
      - role: user
        content: "Summarize this:\n{text}"
    arguments:
      - name: text
        description: "Text to summarize"
        required: true

With my_tools.py on the import path:

def word_count(text: str) -> int:
    """Count the words in a text."""
    return len(text.split())

Use it from Python:

import asyncio

from llmling import RuntimeConfig


async def main() -> None:
    async with RuntimeConfig.open("config.yml") as runtime:
        print(runtime.list_resource_names())  # ['greeting', 'notes']

        resource = await runtime.load_resource("greeting")
        print(resource.content)  # Hello from LLMling!

        count = await runtime.execute_tool("word_count", text=resource.content)
        print(count)  # 3

        messages = await runtime.render_prompt("summarize", {"text": resource.content})
        for message in messages:
            print(message.role, message.get_text_content())


asyncio.run(main())

Or from the command line:

llmling config init my_config.yml         # create a starter config
llmling config add myconfig my_config.yml # store it under a name
llmling config set myconfig               # make it the active config

llmling resource list -c config.yml
llmling resource load greeting -c config.yml
llmling tool call word_count text="a b c" -c config.yml
llmling prompt show summarize -c config.yml

Features

  • Resources: path (files, directories, globs, any fsspec/UPath URL, optional file watching), text, cli (command output), source (Python module source), callable (return value of a Python function) and repository (files from a git repo). Resources can be grouped (resource_groups) and run through processors.
  • Prompts: static message templates (type: text), function-based prompts (type: function, arguments derived from the signature and docstring) and file-based prompts (type: file), with argument validation and completions.
  • Tools: any importable callable becomes a tool with an OpenAI-compatible schema. Toolsets add collections of tools from OpenAPI specs (type: openapi), entry points (type: entry_points) or custom ToolSet classes (type: custom).
  • Processors: function-based and Jinja2 processors to transform resource content.
  • Runtime registration: register resources, tools and prompts at runtime via RuntimeConfig (register_tool, register_static_prompt, ...).
  • Dependencies: global_settings.requirements and PEP 723 scripts declare packages needed by tools and prompts.
  • Typed: pydantic models throughout; a JSON schema for the config format lives in schema/config-schema.json.

More resource and toolset examples

global_settings:
  requirements: ["myapp"]  # installed on demand if missing

resources:
  python_files:
    type: path
    path: "./src/**/*.py"
    watch:
      enabled: true
      patterns: ["*.py", "!**/__pycache__/**"]
  git_changes:
    type: cli
    command: "git diff HEAD~1"
    shell: true
    timeout: 5.0
  utils_module:
    type: source
    import_path: myapp.utils
    recursive: true
  system_info:
    type: callable
    import_path: platform.uname

resource_groups:
  code_review: [python_files, git_changes]

toolsets:
  petstore:
    type: openapi
    spec: "https://petstore3.swagger.io/api/v3/openapi.json"
  my_plugins:
    type: entry_points
    module: myapp

Further reading

The docs/ folder contains longer guides on the YAML configuration, resources, prompts, tools and the CLI. The API reference is on the documentation site.

Metadata

Release files for llmling 2.0.11

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

Source distribution (sdist)

Source distribution for llmling 2.0.11
File Size Uploaded Provenance Actions
llmling-2.0.11.tar.gz 78.2 kB With provenance Details for llmling-2.0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llmling 2.0.11
File Interpreter ABI Platform Actions
llmling-2.0.11-py3-none-any.whl Python 3 none any Details for llmling-2.0.11-py3-none-any.whl

Total release size: 179.7 kB

Release files / llmling-2.0.11.tar.gz

Download URL llmling-2.0.11.tar.gz
Size 78.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e68c0ea286a6a538f4d4991b43ee594bcabadc02dcbcfef9d097ae71ed75302c
BLAKE2b-256 checksum
How to use checksums
6da8f776d058ca149d19e29f322eec985a0756512d1049405b5ef12359b2c2f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 22, 2026.

Transparency log

Release files / llmling-2.0.11-py3-none-any.whl

Download URL llmling-2.0.11-py3-none-any.whl
Size 101.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
284812ff90849429c0bd9bb150786863295b5b514b9b21c57f3ac2137b8a49af
BLAKE2b-256 checksum
How to use checksums
b7904288b2c8ed75d0c0dd1d76ca9d780a58e1ec04607cc3bd16fb0c043307e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 22, 2026.

Transparency log

Security for llmling 2.0.11

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llmling-2.0.11.tar.gz

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 Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.11 This release

2 release files Full provenance

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