Skip to main content

Intelligent versioning system for LLM prompts with Git integration

Project description

Prompt Versioner Logo

A comprehensive Python library for managing and versioning LLM prompts, with built-in A/B testing, metric tracking, and performance monitoring capabilities.

License: MIT PyPI - Version Python 3.11+ Downloads GitHub Repo stars

✨ Features🚀 Quick Start📖 Documentation🎯 Examples


🎯 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

🔧 Core Functionality

  • Automatic MAJOR/MINOR/PATCH versioning
  • Metrics tracking: tokens, latency, quality, cost
  • Multi-model performance comparison
  • Export & share prompt history
  • Optional Git integration

🧪 Advanced Testing & Monitoring

  • A/B Testing framework
  • Model performance benchmarking
  • Automated regression detection
  • Live metrics dashboards
  • Custom alert thresholds

👥 Collaboration & Management

  • Team annotations and feedback
  • Version comparison & visual diff
  • Search & filtering by metadata, performance, and tags

🎨 Modern Web Interface

  • Interactive dashboard with responsive layout
  • Dark/Light themes
  • Tab navigation for Prompts, Testing, Comparison, Alerts
  • Real-time updates

Dashboard Overview


📦 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

Prompts Management

📊 Metrics & Analytics

  • Token usage, latency, cost analysis
  • Quality score tracking
  • Multi-model performance comparison with automatic "best model" detection

Metrics Dashboard

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

AB Testing Interface

🔍 Version Comparison

  • Side-by-side visual diff
  • Metadata & performance delta
  • Smart annotations

Version Comparison

⚠️ Smart Alerts

  • Automatic detection of regressions
  • Cost and error monitoring
  • Custom metrics & thresholds

Alerts System


💻 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


Build by Sveva Pepe, NLP Engineer
⭐ Star this project if it helps you build better AI applications!

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

prompt_versioner-0.3.0.tar.gz (97.1 kB view details)

Uploaded Source

Built Distribution

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

prompt_versioner-0.3.0-py3-none-any.whl (131.3 kB view details)

Uploaded Python 3

File details

Details for the file prompt_versioner-0.3.0.tar.gz.

File metadata

  • Download URL: prompt_versioner-0.3.0.tar.gz
  • Upload date:
  • Size: 97.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for prompt_versioner-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3b99db1c5eedf8a11cc7d3182888c3de6273de96f0eb3513673fe58fd9fdbe4f
MD5 1c16df9e48634cd9f37634f336b37897
BLAKE2b-256 4e9cfc6d28dc48ab35df2f6e652471d5d1bb31e997fa0b1d0e3e5379149b1746

See more details on using hashes here.

File details

Details for the file prompt_versioner-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: prompt_versioner-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 131.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for prompt_versioner-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73a908c545f9c7effd33bda924353250ae7b699ccec1b019753a984a02a5029c
MD5 7cdb14509c2480a1f655eb6e0a623e46
BLAKE2b-256 9a8de43dff4a536bafd53a35f4ddde286c3808b45d9f46363917fdb7bfa8d064

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