Git for prompts. Version control and performance tracking for AI prompts.
Project description
PromptThread Python SDK
Git for prompts. Version control and performance tracking for AI prompts.
Part of the Thread Suite — open-source reliability tools for AI agents.
Installation
pip install promptthread
Quick Start
from promptthread import PromptThread
pt = PromptThread("https://prompt-thread.onrender.com")
# Create a prompt
prompt = pt.create_prompt(
name="summarizer-v1",
content="You are a summarizer. Return a 3-sentence summary.",
description="First summarizer prompt",
tags=["summarizer"]
)
prompt_id = prompt["id"]
# Log a run against it
pt.log_run(
prompt_id=prompt_id,
prompt_version=1,
input="Long text here...",
output="Summary here...",
latency_ms=340.5,
cost_usd=0.000021,
passed=True,
metadata={"model": "gpt-4o"}
)
# Get performance stats
stats = pt.get_stats(prompt_id)
print(stats)
# Update the prompt (creates new version automatically)
pt.update_prompt(
prompt_id=prompt_id,
content="You are a summarizer. Return a 2-sentence summary.",
)
# See what changed
diff = pt.diff(prompt_id, version_a=1, version_b=2)
print(diff)
# Roll back to version 1
pt.rollback(prompt_id, version=1)
API Reference
Prompts
| Method | Description |
|---|---|
create_prompt(name, content, description, tags) |
Create a new prompt at version 1 |
list_prompts() |
List all prompts |
get_prompt(prompt_id) |
Get a prompt by ID |
update_prompt(prompt_id, content, description, tags) |
Update prompt, auto-increments version |
get_history(prompt_id) |
Get all previous versions |
rollback(prompt_id, version) |
Roll back to a previous version |
diff(prompt_id, version_a, version_b) |
Compare two versions |
Runs
| Method | Description |
|---|---|
log_run(prompt_id, prompt_version, ...) |
Log a run against a prompt version |
get_runs(prompt_id) |
Get all runs for a prompt |
get_stats(prompt_id) |
Get pass rate, latency, cost stats |
compare(prompt_id, version_a, version_b) |
Compare performance between versions |
Part of the Thread Suite
| Tool | What it does |
|---|---|
| Iron-Thread | Validates AI output structure before it hits your database |
| TestThread | Tests whether your agent behaves correctly across runs |
| PromptThread | Versions and tracks prompt performance over time |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
promptthread-0.4.0.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file promptthread-0.4.0.tar.gz.
File metadata
- Download URL: promptthread-0.4.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b523683f02fdd1c38a065ab0bb9c2f6398d297de6b63dda7950f8881914bc005
|
|
| MD5 |
db51e1d12e81b23971c99ded894563fe
|
|
| BLAKE2b-256 |
747ce68a18a370bbe703c712cf02c79e51895ad9cd05ee895fdd71b9b50032fa
|
File details
Details for the file promptthread-0.4.0-py3-none-any.whl.
File metadata
- Download URL: promptthread-0.4.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e733ee6b3ac144a417d14daacbe4829903428cafb57f6a9de674645a0234a37
|
|
| MD5 |
7b08e2e9851b25a26a8e9f6389335d57
|
|
| BLAKE2b-256 |
613689177e09b11dc633542a6f879614bd8ab7352a89e39a8d66eac43a797a1e
|