Skip to main content

Chorus - LLM Prompt Versioning Tool

Project description

Chorus

A Python package for LLM prompt versioning and tracking with dual versioning system and web interface.

Features

  • Dual Versioning System: Project version (semantic) + Agent version (incremental)
  • Automatic Prompt Extraction: Extracts prompts from function docstrings
  • Execution Tracking: Captures inputs, outputs, and execution times
  • Web Interface: Beautiful web UI for prompt management and visualization
  • CLI Tools: Command-line interface for prompt management
  • Export/Import: JSON export/import for prompt data
  • Semantic Versioning: Full support for semantic versioning of prompts

Installation

pip install chorus

Quick Start

1. Basic Usage

from chorus import chorus

@chorus(project_version="1.0.0", description="Basic Q&A prompt")
def ask_question(question: str) -> str:
    """
    You are a helpful assistant. Answer: {question}
    """
    return "Answer: " + question

# Run the function - prompts are automatically tracked
result = ask_question("What is Python?")

2. Auto-versioning

@chorus(description="Auto-versioned prompt")
def process_text(text: str) -> str:
    """
    Process this text: {text}
    """
    return f"Processed: {text}"

# Each time you modify the prompt, agent version auto-increments

3. CLI Usage

# List all tracked prompts
chorus list

# Show specific prompt details
chorus show ask_question 1.0.0

# Start web interface
chorus web

# Export prompts
chorus export --output my_prompts.json

4. Web Interface

chorus web --port 3000

Open your browser to http://localhost:3000 for a beautiful web interface to manage your prompts.

Advanced Features

Dual Versioning System

Chorus uses a dual versioning approach:

  • Project Version: Semantic version for project changes (e.g., "1.0.0")
  • Agent Version: Incremental version for prompt changes (auto-incremented)

Prompt Tracking

  • Automatic extraction from function docstrings
  • Execution time tracking
  • Input/output capture
  • Error handling and logging

Web Interface Features

  • Visual prompt management
  • Version comparison
  • Execution history
  • Export/import functionality

Development

Setup

git clone https://github.com/yourusername/chorus.git
cd chorus
pip install -e .

Testing

pip install -e ".[dev]"
pytest

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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_chorus-0.1.1.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

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

prompt_chorus-0.1.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file prompt_chorus-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for prompt_chorus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dfa7ec6eeee56baf35088e81e480dc93537f66676b48cdc598ebb98197cb8264
MD5 d4df40fbb9f944dddc2526a5989f9690
BLAKE2b-256 8b3430a312a27df590cbca8e2b7826d20082e886cf48f2b7bf1916118f1c1528

See more details on using hashes here.

File details

Details for the file prompt_chorus-0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for prompt_chorus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7eb4691b1674b2c431468a8d23defeabbd91a2148e554bb5e3c7029db06c77f1
MD5 a62161527e4373e30e710fee25dc2972
BLAKE2b-256 3575228d94a5e513390de6f1c73e32f65bdec36aa629e9e7a56f735a949b97b5

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