A comprehensive Python library for managing and versioning LLM prompts, with built-in A/B testing, metric tracking, and performance monitoring capabilities.
🎯 Why Prompt Versioner?
Prompt Versioner provides enterprise-grade prompt management with:
- 🔄 Version Control: Full versioning of prompts
- 📊 Performance Tracking: Metrics and regression detection
- 🧪 A/B Testing: Built-in statistical framework
- ⚡ Real-time Monitoring: Alerts and dashboards
- 👥 Team Collaboration: Annotations and reviews
- 🎨 Modern UI: Responsive web dashboard
✨ Features
📦 Installation
Prerequisites
- Python 3.11+
- Poetry (recommended) or pip
- Git (optional)
Using PyPI
pip install prompt-versioner
🚀 Quick Start
from prompt_versioner import PromptVersioner, VersionBump
pv = PromptVersioner(project_name="my-first-project", enable_git=False)
pv.save_version(
name="assistant-prompt",
system_prompt="You are a helpful assistant.",
user_prompt="Please answer the following question: {question}",
bump_type=VersionBump.MAJOR
)
print("✅ Created first prompt version 1.0.0!")
🎨 Web Dashboard
Core Features
📋 Prompts Management
- Version history with visual diff
- Semantic search
- Bulk operations
- Live preview
📊 Metrics & Analytics
- Token usage, latency, cost analysis
- Quality score tracking
- Multi-model performance comparison with automatic "best model" detection
Model Comparison: Test the same prompt across different models (GPT-4, Claude, Gemini, etc.) and see aggregated metrics with automatic identification of the fastest, cheapest, and highest-quality model.
🧪 A/B Testing
- Split testing
- Real-time results
🔍 Version Comparison
- Side-by-side visual diff
- Metadata & performance delta
- Smart annotations
⚠️ Smart Alerts
- Automatic detection of regressions
- Cost and error monitoring
- Custom metrics & thresholds
💻 CLI Interface
# Initialization & Setup
pv init # Initialize prompt versioner
# Prompt Operations
pv list # List all tracked prompts
pv versions <prompt> # List versions of a prompt
pv show <prompt> <version> # Show version details
# Model Pricing & Cost Estimation
pv models # List all models with pricing
pv models --sort-by input # Sort by input price
pv models --filter gpt # Filter specific models
pv estimate-cost <model> <in> <out> # Estimate cost for usage
pv compare-costs <in> <out> # Compare costs across models
# Version Comparison
pv diff <prompt> <v1> <v2> # Show diff between versions
pv compare <prompt> <v1> <v2> # Compare with metrics
# Management
pv delete <prompt> <version> # Delete a version
pv rollback <prompt> <version> # Rollback to version
pv clear-db # Clear database
# Dashboard
pv dashboard --port 5000 # Launch web dashboard
📖 Examples
Examples in examples/ are fully functional:
| File | Description |
|---|---|
| basic_usage.py | Getting started |
| version_management.py | Advanced version control |
| metrics_tracking.py | Metrics logging |
| multi_models.py | Multi-model comparison |
| ab_testing.py | Statistical testing |
| performance_monitoring.py | Automated monitoring |
| summarization_example.py | Real-world summarization |
| run_dashboard.py | Launch dashboard |
| clear_db.py | Reset database |
🌟 Contributing
See CONTRIBUTING.md for contribution guidelines.
📄 License
MIT License - LICENSE
📞 Support
- Documentation: https://pepes97.github.io/prompt-versioner/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Build by Sveva Pepe, NLP Engineer
⭐ Star this project if it helps you build better AI applications!
Metadata
Release files for prompt-versioner 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prompt_versioner-0.3.1.tar.gz | 97.1 kB | Without provenance | Details for prompt_versioner-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prompt_versioner-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for prompt_versioner-0.3.1-py3-none-any.whl |
Total release size: 228.4 kB
Release files / prompt_versioner-0.3.1.tar.gz
| Download URL | prompt_versioner-0.3.1.tar.gz |
|---|---|
| Size | 97.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4e26a97bd0561f8b4e86d5757f326d91983e902cf76efaca23943f8b96832bb
|
|
BLAKE2b-256 checksum How to use checksums |
3866e3a04bdda1cc398a4215dbcd7d475d7d837eb2f079d43c6332171457695b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.14 Linux/6.11.0-1018-azure
|
Release files / prompt_versioner-0.3.1-py3-none-any.whl
| Download URL | prompt_versioner-0.3.1-py3-none-any.whl |
|---|---|
| Size | 131.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5719935d01dfc29594ad877dccbc30438fe8b6cc29cca73a99057a08149cf8b3
|
|
BLAKE2b-256 checksum How to use checksums |
3ed42d16201b2bbb888721afb64e030964086f85c3e3521bff6cb551e35df892
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.11.14 Linux/6.11.0-1018-azure
|
Security for prompt-versioner 0.3.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.