Skip to main content
PromptDock logo

PromptDock

Version your prompts like code. Ship them like releases.

Immutable prompt versions · movable dev / preprod / prod tags · eval-gated promotion · one-click rollback

PyPI Python CI Docker License: MIT

Quickstart · Dashboard · CLI · AI agents · Docker · Changelog

Why PromptDock

Prompts change more often than code, but they usually ship with the code — so every wording tweak is a deploy, and every bad prompt is an incident with no quick undo.

PromptDock separates the two. Your app asks for a tag; you decide which version the tag points to.

prompt = client.get_prompt("support-bot", tag="prod")  # never a hard-coded version
Step What you do Versions dev preprod prod
1 Save a prompt v1 – – –
2 Promote it through the environments v1 v1 v1 v1
3 Edit and save v1, v2 v1 v1 v1
4 Promote v2 — the eval gate checks its scores first v1, v2 v2 v2 v2
5 v2 misbehaves: roll back prod v1, v2 v2 v2 v1

Apps pick up every promote and rollback within their cache time (60 s by default). No redeploy, no code change.

Features

Immutable versions Text or chat templates with {{ variables }} and model settings. Saving identical content never creates a duplicate.
Tags as pointers dev, preprod, prod out of the box, plus your own (canary-eu, per-customer…).
Eval gates Push scores from any eval tool. A gate like accuracy ≥ 0.85 blocks promotion of a worse version.
Instant rollback Undo the last promote — again and again, like undo. Never blocked by gates.
Full audit log Every move records who, when, from → to and why. Forced promotes are flagged.
Leaderboard & diff Compare versions by score and see exactly what changed in text and settings.
Resilient reads Cached, and apps keep the last good prompt if the database or server is down.
Use it your way Python library, REST API, dashboard, CLI, MCP server for AI agents, or Docker.

Quickstart

pip install promptdock
export DATABASE_URL=postgresql://user:password@localhost:5432/promptdock
promptdock migrate
from openai import OpenAI
from promptdock import Client

client = Client()  # reads DATABASE_URL; your OS username is recorded as the actor
llm = OpenAI()

client.create_prompt("support-bot")
client.create_version(
    "support-bot",
    [
        {"role": "system", "content": "You support {{ product }}. Be concise."},
        {"role": "user", "content": "{{ question }}"},
    ],
    model_config={"model": "gpt-4o", "temperature": 0.2},
    commit_message="First version",
)
client.promote("support-bot", "prod", 1)

# In your app
prompt = client.get_prompt("support-bot", tag="prod")
messages = prompt.render(product="Acme", question="How do I reset my password?")
response = llm.chat.completions.create(messages=messages, **prompt.model_config)

render() raises MissingVariableError naming any variable you forgot. Ready-to-run examples for OpenAI, Anthropic, LangChain and an LLM-as-judge eval script are in examples/.

Ways to run it

Mode Install Run Best for
Library pip install promptdock Client() One app talking to its own Postgres
Server pip install "promptdock[server]" promptdock serve Many apps or languages sharing one registry
Dashboard pip install "promptdock[ui]" promptdock serve --ui Teams who want to see and promote in a browser
Docker — docker run ghcr.io/shreyamhetre/promptdock Non-Python teams, servers without pip
AI agents pip install "promptdock[mcp]" promptdock mcp Claude Desktop, Cursor and other MCP clients

Requirements: Python 3.10+ and Postgres 14+.

Eval gates

Push results from any evaluation — a script, an LLM judge, a CI job — in one fixed shape:

{"prompt": "support-bot", "version": 4, "metric": "accuracy", "score": 0.87,
 "run_id": "run-2026-10-30", "evaluator": "llm-judge", "metadata": {"dataset": "faq-100"}}

Then require a quality bar before a tag can move:

promptdock gate set support-bot prod --min accuracy=0.85 --max latency_ms=1200
promptdock promote support-bot prod 5
# Error: Gate for tag 'prod' on prompt 'support-bot' failed:
#   - accuracy: 0.81 is below the minimum 0.85

min means higher is better, max means lower is better. The gate uses each metric's latest score; a missing score fails. --force --reason "…" bypasses it and is recorded.

Dashboard

pip install "promptdock[ui]"
promptdock serve --ui            # http://127.0.0.1:8000/ui/

The dashboard shows each prompt's deployment pipeline (dev → preprod → prod), its versions, a sortable leaderboard with a score chart per metric, a diff of any two versions and the audit log. You can promote (the gate result is shown) and roll back with a confirmation. No Node.js needed — the dashboard ships inside the package.

Server and REST API

pip install "promptdock[server]"
promptdock serve                 # http://127.0.0.1:8000 — interactive API docs at /docs
client = Client(base_url="http://127.0.0.1:8000")  # same methods as library mode

Any language can use it: curl "http://127.0.0.1:8000/prompts/support-bot?tag=prod". Responses carry an ETag, so unchanged prompts cost a tiny 304.

Securing your server

There are no user accounts. promptdock serve listens only on this machine by default. To share it, run it on a private network or set a shared token:

PROMPTDOCK_TOKEN=change-me promptdock serve --host 0.0.0.0

Every request except /health must then send Authorization: Bearer <token>; clients pass token=... or set PROMPTDOCK_TOKEN. Listening on 0.0.0.0 without a token prints a warning.

Who made a change is self-reported in the X-Actor header (the Python client sends its actor, which defaults to your OS username) — an honest team history, like a git author, not a security control.

Command line

The CLI connects like the client: PROMPTDOCK_URL (+ PROMPTDOCK_TOKEN) for a server, otherwise DATABASE_URL.

promptdock export ./prompts                        # one YAML file per prompt
promptdock push ./prompts --tag dev -m "Friendlier"  # new versions for changed files only
promptdock evals push results.jsonl                # eval results, one JSON object per line
promptdock promote support-bot prod 3 --reason "evals passed"
promptdock rollback support-bot prod --reason "complaints"
promptdock leaderboard support-bot --sort accuracy
promptdock diff support-bot 3 4
promptdock history support-bot prod

push never overwrites anything and never moves prod — promoting to production is always an explicit step.

AI agents (MCP)

Let Claude Desktop, Cursor or any MCP client read and version prompts:

{
  "mcpServers": {
    "promptdock": {
      "command": "promptdock",
      "args": ["mcp"],
      "env": { "DATABASE_URL": "postgresql://user:password@localhost:5432/promptdock" }
    }
  }
}

Tools: list_prompts, get_prompt, create_version, compare_versions, get_leaderboard. promote is available only with "args": ["mcp", "--allow-promote"]; gates still apply and agents can never force. Agent changes are recorded as mcp:<your OS username>.

Docker

docker run -p 8000:8000 \
  -e DATABASE_URL=postgresql://user:password@db-host:5432/promptdock \
  -e PROMPTDOCK_TOKEN=change-me \
  ghcr.io/shreyamhetre/promptdock

The container migrates the database, then serves the API and dashboard on port 8000. To try everything locally with a bundled Postgres: docker compose --profile server up -d.

Privacy

PromptDock collects no telemetry or usage data. It talks only to your own Postgres and, if you run one, your own PromptDock server.

Contributing

Contributions are welcome — see CONTRIBUTING.md for setup, tests and the release process.

License

MIT

Metadata

Release files for promptdock 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for promptdock 0.1.1
File Size Uploaded Provenance Actions
promptdock-0.1.1.tar.gz 500.8 kB With provenance Details for promptdock-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for promptdock 0.1.1
File Interpreter ABI Platform Actions
promptdock-0.1.1-py3-none-any.whl Python 3 none any Details for promptdock-0.1.1-py3-none-any.whl

Total release size: 730.3 kB

Release files / promptdock-0.1.1.tar.gz

Download URL promptdock-0.1.1.tar.gz
Size 500.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8940ba5a4de03d99ca7a2e4008c195e913bf033e3f56633bb4628e1ef5785da9
BLAKE2b-256 checksum
How to use checksums
61b1e946b54c02b907432073c5e98a8d7ddd589c281786843f4fc1733c83d335
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / promptdock-0.1.1-py3-none-any.whl

Download URL promptdock-0.1.1-py3-none-any.whl
Size 229.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e26ae0217610f8f721c4d14d1175629a372ffc42bb82ab1c7c1f9a7170d51d60
BLAKE2b-256 checksum
How to use checksums
296de2d6ec882008bfc41a672cb474d08fc8c0d6e1718367c12c78e3b582fd32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for promptdock 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for promptdock-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page