🚀 Cuebit - Prompt Versioning and Management for GenAI
Cuebit is an open-source, local-first prompt registry and version control system designed for GenAI development teams — complete with version tracking, version history, lineage tracking, aliases, tagging, and an interactive dashboard.
✨ Features
- 🔐 Prompt version control with full history and lineage tracking
- 🏷️ Alias system (e.g.
summarizer-prod→ versioned prompt) - 🧠 Tags and metadata for organizing prompts
- 📁 Project & Task-based prompt grouping
- 📋 Example management for documenting prompt usage patterns
- 📑 Template variables detection and validation
- 🔍 Version comparison with visual diffs
- 📈 Streamlit-based visual dashboard
- ⚙️ REST API powered by FastAPI (
/api/v1/...) - 🔄 Full CLI support for automation
- 🧪 Prompt template preview and rendering
- 👤 Audit trail:
created_at,updated_at,updated_by - 📤 Import/Export functionality for backup and sharing
📦 Installation
# Install from PyPI
pip install cuebit
# Or install from source
git clone https://github.com/iRahulPandey/Cuebit.git
cd cuebit
pip install -e .
🚀 Getting Started
🌱 Initializing Cuebit
# Initialize the Cuebit prompt registry
cuebit init
# Optionally specify a custom data directory
cuebit init --data-dir /path/to/your/data
Cuebit automatically stores its database in a standard user data directory. You can also set the CUEBIT_DB_PATH environment variable to specify a custom database location.
🧪 Registering a Prompt in Python
from cuebit.registry import PromptRegistry
registry = PromptRegistry()
registry.register_prompt(
task="summarization",
template="Summarize: {input}",
meta={"model": "gpt-4", "temperature": 0.7},
tags=["prod"],
project="bloggen",
updated_by="alice",
examples=[{
"input": "The quick brown fox jumps over the lazy dog.",
"output": "A fox jumps over a dog.",
"description": "Basic example"
}]
)
🧭 Setting Aliases
registry.add_alias(prompt_id, "summarizer-prod")
🔁 Updating a Prompt (Creates a new version)
registry.update_prompt(
prompt_id,
new_template="Summarize concisely: {input}",
updated_by="bob"
)
📋 Adding Examples
registry.add_example(
prompt_id,
input_text="Climate change is a global challenge...",
output_text="Climate change poses worldwide risks requiring immediate action.",
description="Climate topic example"
)
Using in a Streamlit App
import streamlit as st
from cuebit.registry import PromptRegistry
from langchain_openai import ChatOpenAI
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
# Initialize registry - works with zero configuration!
registry = PromptRegistry()
# Get prompt by alias
prompt = registry.get_prompt_by_alias("summarizer-prod")
# Create LangChain PromptTemplate
prompt_template = PromptTemplate(
input_variables=["input_text"],
template=prompt.template
)
# Initialize LangChain ChatOpenAI model
llm = ChatOpenAI(
model=prompt.meta.get("model", "gpt-3.5-turbo"),
temperature=prompt.meta.get("temperature", 0.7),
max_tokens=prompt.meta.get("max_tokens", 500)
)
# Create LLM Chain
summarization_chain = LLMChain(
llm=llm,
prompt=prompt_template
)
# Generate summary
summary = summarization_chain.run(input_text="Your text to summarize")
🧪 Streamlit Dashboard
cuebit serve --host 127.0.0.1 --port 8000 # launches API + UI
The dashboard provides:
- Project and prompt browsing
- Visual prompt builder with variable detection
- Version history with visual diffs
- Import/Export functionality
- Usage statistics
🔧 Command Line Interface
# Start the server and dashboard
cuebit serve
# List all projects
cuebit list projects
# List prompts in a project
cuebit list prompts --project my-project
# Create a new prompt
cuebit create prompt --task summarization \
--template "Summarize: {input}" \
--project my-project --tags "prod,gpt-4"
# Set an alias
cuebit set-alias 123abc summarizer-prod
# Render a prompt with variables
cuebit render --alias summarizer-prod \
--vars '{"input":"Text to summarize"}'
# Export prompts to JSON
cuebit export --format json --file exports.json
📚 API Reference
GET /api/v1/projects- List all projectsGET /api/v1/projects/{project}/prompts- List prompts in a projectGET /api/v1/prompts- List all prompts (with pagination and filtering)POST /api/v1/prompts- Create a new promptGET /api/v1/prompts/{prompt_id}- Get a specific promptPUT /api/v1/prompts/{prompt_id}- Update a prompt (creates new version)POST /api/v1/prompts/{prompt_id}/alias- Set an alias for a promptGET /api/v1/prompts/alias/{alias}- Get a prompt by its aliasPOST /api/v1/prompts/render- Render a prompt with variablesGET /api/v1/prompts/{prompt_id}/history- Get version historyPOST /api/v1/prompts/compare- Compare two prompt versionsPOST /api/v1/prompts/{prompt_id}/rollback- Rollback to a previous versionDELETE /api/v1/prompts/{prompt_id}- Delete a prompt (soft by default)GET /api/v1/export- Export promptsPOST /api/v1/import- Import prompts
🔍 Advanced Configuration
Environment Variables
CUEBIT_DB_PATH: Set a custom database location (e.g.,sqlite:///path/to/your/prompts.db)
Using With Different Database Backends
Cuebit uses SQLAlchemy, so you can connect to different database backends:
# PostgreSQL example
registry = PromptRegistry("postgresql://user:password@localhost/cuebit")
# MySQL example
registry = PromptRegistry("mysql+pymysql://user:password@localhost/cuebit")
🛠️ Development
To contribute:
# Clone the repository
git clone https://github.com/iRahulPandey/Cuebit.git
cd cuebit
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Build package
python -m build
License
MIT
Metadata
Release files for cuebit 0.2.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 | |
|---|---|---|---|
| cuebit-0.2.1.tar.gz | 50.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cuebit-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 87.0 kB
Release files / cuebit-0.2.1.tar.gz
| Download URL | cuebit-0.2.1.tar.gz |
|---|---|
| Size | 50.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3852198fbb2d7ba019650291c35f1e8ad1830ffbe2df61e32bb3ffe963bf7d5f
|
|
BLAKE2b-256 checksum How to use checksums |
c802fb827e84f7494e4374a57cf06715b6e15ddb8c80706f4a9f10eeadec30c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Release files / cuebit-0.2.1-py3-none-any.whl
| Download URL | cuebit-0.2.1-py3-none-any.whl |
|---|---|
| Size | 36.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d8b8e1ccbc4b682f19e3ddcbff8030c112aa5de423dd2c2262c50f6e832e65e
|
|
BLAKE2b-256 checksum How to use checksums |
b4f6cd6f6d7a2690e06a1d598d153f1b01df069a6a1bf618b13bdbe963ae0a61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|