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:
-
Install the package:
pip install promptdrifter
-
Initialize a sample configuration:
promptdrifter init
This will create a promptdrifter.yaml file in your current directory.
-
Edit
promptdrifter.yamlto define your prompts and expected outcomes. -
Run your tests:
promptdrifter run promptdrifter.yaml
License
PromptDrifter is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file promptdrifter-0.0.1.tar.gz.
File metadata
- Download URL: promptdrifter-0.0.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc73ff11c1ca4854d66f73a04d8c9a7cc0ac4e3b4ad61074ceab49270df8b7d4
|
|
| MD5 |
f6469bcecf1e042adc2e1872f067db3e
|
|
| BLAKE2b-256 |
e79d12ac01792e70b7f959b1ce2771eb6910b7ee873d0fe3cc2f2bcbc638fb23
|
File details
Details for the file promptdrifter-0.0.1-py3-none-any.whl.
File metadata
- Download URL: promptdrifter-0.0.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc8b902bd51d0008c3eb585e0c400c9bb5d8dedaddf8b78428d9788a9cdbaf5a
|
|
| MD5 |
10526d377f410403a4edbc03d297da46
|
|
| BLAKE2b-256 |
94944e4f554aef1f9b2511e037180af31fecece6208023c4c26043b0f296c9a2
|