Skip to main content

Helps you store prompts as versioned artifacts, load them from disk, compare revisions, render them with variables, and run lightweight evaluations against expected behaviors.

Project description

prompt-registry

GitHub Sponsor   Buy Me a Coffee   Ko-Fi   PayPal

A versioned prompt library with evals for Python teams.

prompt-registry helps you store prompts as versioned artifacts, load them from disk, compare revisions, render them with variables, and run lightweight evaluations against expected behaviors.

It is designed for teams who want a simple, inspectable workflow for prompt development without depending on a database or a hosted prompt platform.

Features

  • Versioned prompt files in YAML.
  • Prompt metadata, tags, owners, and changelogs.
  • Variable validation for required inputs.
  • Prompt rendering with safe placeholder checking.
  • Registry loader for folders of prompts.
  • Semantic prompt references like support/refund_request@1.2.0.
  • Evals with exact, contains, regex, and callable checks.
  • Snapshot-style regression testing for prompt outputs.
  • Simple CLI for listing, showing, diffing, and evaluating prompts.
  • Pure Python project with low friction local adoption.

Install

pip install -e .

Quick start

Create a prompt file:

id: support/refund_request
version: 1.0.0
name: Refund Request Triage
owners:
  - Brandon Himpfen
summary: Triage a customer refund request and decide next action.
variables:
  customer_name:
    description: Customer full name
    required: true
  order_id:
    description: Order identifier
    required: true
  message:
    description: Customer message body
    required: true
prompt:
  system: |
    You are a careful support operations assistant.
    Review the refund request and recommend the next step.
  user: |
    Customer: {customer_name}
    Order ID: {order_id}
    Message: {message}
changelog:
  - version: 1.0.0
    date: 2026-03-31
    notes: Initial prompt.

Load and render it:

from prompt_registry import PromptRegistry

registry = PromptRegistry.from_path("prompts")
prompt = registry.get("support/refund_request@1.0.0")
rendered = prompt.render(
    customer_name="Taylor Smith",
    order_id="ORD-1042",
    message="My package arrived damaged and I want a refund.",
)

print(rendered.system)
print(rendered.user)

Run evals:

python -m prompt_registry.cli eval --prompts prompts --evals examples/evals/support_refund_request.yaml

Prompt file format

Each prompt is a YAML file with this basic structure:

id: namespace/name
version: 1.0.0
name: Human readable name
owners:
  - Team or owner
summary: One-line summary
variables:
  variable_name:
    description: What this value means
    required: true
prompt:
  system: |
    System prompt text with {variables}
  user: |
    User prompt text with {variables}
metadata:
  model_family: gpt
  risk_level: low
  use_case: support
changelog:
  - version: 1.0.0
    date: 2026-03-31
    notes: Initial release.

Evals format

Evals are YAML files with named test cases:

prompt: support/refund_request@1.0.0
cases:
  - id: asks_for_decision
    input:
      customer_name: Taylor Smith
      order_id: ORD-1042
      message: My package arrived damaged and I want a refund.
    assertions:
      - type: contains
        target: user
        value: Taylor Smith
      - type: contains
        target: user
        value: ORD-1042

CLI

List prompts:

python -m prompt_registry.cli list --prompts prompts

Show a prompt:

python -m prompt_registry.cli show --prompts prompts --ref support/refund_request@1.0.0

Diff two prompt versions:

python -m prompt_registry.cli diff --prompts prompts \
  --left support/refund_request@1.0.0 \
  --right support/refund_request@1.1.0

Evaluate prompt cases:

python -m prompt_registry.cli eval --prompts prompts --evals examples/evals/support_refund_request.yaml

Project structure

prompt-registry/
├── docs/
├── examples/
├── prompts/
├── src/prompt_registry/
├── tests/
├── pyproject.toml
└── README.md

Why this repo exists

This project is useful when you want prompt engineering to behave more like software engineering:

  • prompts live in version control.
  • revisions are explicit.
  • diffs are readable.
  • tests are repeatable.
  • teams can review prompt changes before shipping them.

License

MIT

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

promptartifact-0.1.2.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

promptartifact-0.1.2-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: promptartifact-0.1.2.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for promptartifact-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fd0b58945b5cbc310e55d192a243b098a3bcdf4e209e451dc8535ffb7836521a
MD5 1e0d5b07e96697af8ecca3b6da4f2626
BLAKE2b-256 028f92f7413d4d1840fe89e7629e98c8265dd4a021194c7574444d8516d16976

See more details on using hashes here.

File details

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

File metadata

  • Download URL: promptartifact-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for promptartifact-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 62dbbf3a9ba1936d4a410ddb4f203cf5113c90702bbb2f61f3fa4435e0c57740
MD5 a3b5e44e9b4eff7c21b2dbed49bc5278
BLAKE2b-256 b3e8f30f5eea733cc13cbe7f0fc2a4b97a5de42219f40936ea312f39589353b3

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