Skip to main content

One-command CI guardrail that catches prompt drift and fails the build when your LLM answers change.

Project description

What is PromptDrifter?

PromptDrifter is a command-line tool to test and evaluate Large Language Model (LLM) prompts across different models and providers. It helps catch "prompt drift" when LLM responses change unexpectedly.

By comparing LLM outputs against version-controlled expected responses or predefined patterns, PromptDrifter helps ensure your LLM-powered features behave predictably.

Features

  • Automated Guardrails: Integrates LLM response validation directly into your development and CI/CD workflows.
  • Early Drift Detection: Catches deviations by comparing LLM outputs against version-controlled expected responses or predefined patterns (like regex).
  • Model Agnostic Design: Through a flexible adapter system, PromptDrifter can interact with various LLM providers and models (e.g., OpenAI, Ollama, Gemini).
  • Declarative Test Suites: Define your prompt tests in easy-to-understand YAML files, making them simple to create, manage, and version.
  • CLI Interface: Simple command-line tool for easy integration and use.
  • Response Caching: Speeds up test runs by caching responses from LLMs.

Getting Started

To start using PromptDrifter:

  1. Install the package:

    pip install promptdrifter
    
  2. Initialize a sample configuration:

    promptdrifter init
    

This will create a promptdrifter.yaml file in your current directory.

  1. Edit promptdrifter.yaml to define your prompts and expected outcomes.

  2. Run your tests:

    promptdrifter run promptdrifter.yaml
    

License

PromptDrifter is licensed under the MIT License.

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

promptdrifter-0.0.2.tar.gz (4.5 MB view details)

Uploaded Source

Built Distribution

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

promptdrifter-0.0.2-py3-none-any.whl (59.9 kB view details)

Uploaded Python 3

File details

Details for the file promptdrifter-0.0.2.tar.gz.

File metadata

  • Download URL: promptdrifter-0.0.2.tar.gz
  • Upload date:
  • Size: 4.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for promptdrifter-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d63e0359972c49e3c7e86ece34e2fc2ed8f7a946af14ae4496ccfba541262082
MD5 3b4f26a646ca7deefdcccb517c35ec2b
BLAKE2b-256 e03a786f65b7e22cc2395317f5bb3804bdd630ddb2ce3811b90891f99d345c23

See more details on using hashes here.

File details

Details for the file promptdrifter-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: promptdrifter-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 59.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for promptdrifter-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a50751a8f78825b15b196322dab2512871ee2805f15cb36dc7d16ede58ad7576
MD5 17e1b88942f91d26766695df35c81283
BLAKE2b-256 b312ad4b27d2a4cbef5210f11e22c0a2fff458dd697c28e79044208028f5d474

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