Skip to main content

Git-like version control for AI prompts — with semantic diff and output regression testing

Project description

PromptHub

Git-like version control for AI prompts — with semantic diff and output regression testing.

The Problem

Every AI engineer manages prompts like this:

  • Files named prompt_v2_FINAL_REAL.txt
  • Copy-pasted into Notion with no history
  • No idea why outputs changed after a small tweak
  • No way to prove a prompt change improved things

The Solution

pip install prompthub-cli

PromptHub treats prompts as first-class artifacts with real version history, semantic diffing, and behavioural regression testing.

What Makes It Different

git diff tells you line 3 changed. PromptHub tells you the meaning changed. PROMPT DIFF v1 → v2

─────────────────────────────────────────

Semantic distance: 0.53 (significant change) STRUCTURAL CHANGES

Added: format constraint Added: expert tone

~ Modified: length 24 chars longer

CHARACTER DELTA

v1: 55 chars

v2: 79 chars

Δ: +24 chars

Features

  • Version control — snapshot any prompt file with a commit message
  • Semantic diff — cosine distance on sentence embeddings, not line diffs
  • Structural detection — format, tone, length, reasoning, role changes
  • Output regression testing — run both versions through a local LLM, compare outputs
  • Full rollback — restore any previous version in one command
  • Fully local — SQLite storage, Ollama for inference, no API costs, your prompts stay yours

Installation

pip install prompthub-cli

Requires Ollama for regression testing:

ollama pull llama3.2

Quick Start

# Initialise a repo in your project
prompthub init

# Track a prompt file
prompthub add system_prompt.txt

# Commit the current version
prompthub commit -m "initial version"

# Make changes and commit again
prompthub commit -m "added JSON output format"

# See full version history
prompthub log

# Semantic diff between versions
prompthub diff v1 v2

# Add a regression test case
prompthub test-add --name "basic question" --input "What is the capital of France?"

# Run regression tests between versions
prompthub test-run v1 v2

# Roll back to a previous version
prompthub rollback v1

Regression Testing Output

REGRESSION REPORT v1 → v2

─────────────────────────────────────────

Test: basic question

Status: CHANGED

Semantic shift: 0.27 (moderate change) v1 output: The capital of France is Paris.

v2 output: {"capital": "Paris"} Test: explanation test

Status: CHANGED

Semantic shift: 0.53 (significant change) v1 output: A neural network is a computer system inspired by...

v2 output: {"type": "object", "properties": {"name": "Neural Network"...

Stack

  • Python 3.11+
  • Typer + Rich (CLI)
  • SQLite (local version storage)
  • sentence-transformers (semantic diff)
  • Ollama (regression testing)

Links

Author

Built by Remin Franklin LinkedIn · GitHub

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

prompthub_cli-0.1.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

prompthub_cli-0.1.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prompthub_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6be268ec8a43ffd7caac61007e32dc1ee4e11b787ce14b6ffbee815b6310102c
MD5 4c246911dcda523dc381294b156dabb4
BLAKE2b-256 4632aa73c2bd4f0ad1acdfec609a90effc27026c2babbf7fdd61dbedd5cf1a98

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for prompthub_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41b77b5978cfb27fafb0e689e0f508a2b8c8555dc3759090c0f16c73b77f3319
MD5 7d8a1f1c71d7202f8fc8b7dbf343da10
BLAKE2b-256 c42a48d818738a28d28397a4120d6a10f20176974948df623bd99aabfb6b2582

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