An LLM-driven prompt optimizer for the whole pipeline
Give it examples where you know the right answer. It evolves your prompt and your pipeline's settings,
and hands back the winner with every measurement behind it.
Try it in the browser · Install · Docs · Watch a live run
Fits your stack if it answers two calls
┌──────────────────────┐ ┌──────────────────────┐
│ Your Backend │ GET /pipeline ──► │ PromptPotter │
│ (any pipeline) │ │ Optimizer │
│ │ POST /matches ◄── │ │
│ runs the task │ {prompt, params} │ generates candidates│
│ │ │ scores + critiques │
│ │ → predictions ──► │ iterates │
└──────────────────────┘ └──────────────────────┘
LangGraph, CrewAI, n8n, Dify or plain FastAPI: put it behind these two endpoints and it can be tuned (how). In the browser app there is nothing to set up. You get back one file, export.json, with the winning settings.
Whatever your service exposes, it can tune. Whatever you lock, it leaves alone.
Why PromptPotter
- 💸 Stops paying for losers. A version that cannot win is cut after a handful of examples.
- 🎯 Won't let you fool yourself. Each round says whether its gain is noise; one command grades the winner on held-out examples.
- 🔍 Every number opens down to the call. The exact input, the answer, the expected answer, paid or replayed.
- 🌳 Searches a tree, not a line. When progress stalls it rewrites its own search plan or backs up to an earlier version.
- ⚖️ Runs the others too. GEPA, CAPO and LEVI run inside it, under one grader and one budget.
- 🤖 Runs from Claude Code.
/potter-runlaunches the run, watches it and explains every round.
11 real campaigns: each dot is a scored version, the crown marks the one that stands,
the tree shows who was bred from whom. In-run scores, not held-out results.
Run it where your data lives
| ☁️ We run it | Online, zero setup. Free to try, or bring your own key. | app.promptpotter.com |
| 💻 You run it | Local, on your own keys. We never see your data. | pip install promptpotter |
| 🤖 Your AI runs it | Claude Code launches and supervises the run; the browser app stays live. | /potter-run |
| 👥 Your team runs it | Self-hosted, multi-user. We never see your data. | deploy-linux/ |
From Python you need Python 3.13+ and an OpenRouter key in OPENROUTER_API_KEY for the optimizer's own calls (other providers).
Against your own pipeline, from the terminal. Start the backend from the diagram above before new; without one, use the browser.
pip install "promptpotter[all]"
python -m promptpotter new tickets.csv --set raw_task_description="classify support tickets by urgency"
python -m promptpotter resume # Ctrl+C pauses; resume picks up where it stopped
The shipped example datasets run against TermNorm on :8000; in Claude Code, /potter-run starts it for you. To watch locally: python -X utf8 -m uvicorn promptpotter.main:app --port 8001, then open http://localhost:8001/.
In DSPy: a drop-in optimizer, no backend needed
Use it where you would reach for MIPROv2 or GEPA. It runs inside your process, with no extra service:
# pip install "promptpotter[dspy]"
from promptpotter.presentation.teleprompter import PromptPotterOpt
optimizer = PromptPotterOpt(metric=my_metric, dataset_name="my-task")
compiled = optimizer.compile(my_program, trainset=trainset)
The app: the chat where a run starts, the round-by-round scoreboard, and one example opened down to the call.
A round, in four steps
- Generate. An LLM reads the last round's misses and writes a few new versions of the prompt and its settings.
- Score. Each version runs on your examples. A version that falls behind is cut as soon as it cannot win.
- Critique. It reads each miss to steer what the next round tries; the round's winner becomes the next starting point.
- Escalate. When progress stalls, it rewrites how it searches, or backs up the lineage tree and tries another branch. It stops on your goal, your budget or a plateau.
One real round, replayed from its log: the third version is cut after 7 of 34 examples
Three versions race on 34 examples; the third is cut after 7, so its other 27 calls are never paid for (how the cut is decided).
Under the hood: the statistics and the search
- The cut is Posterior-of-Being-Best: a version stops when its chance of being the best falls under a bar (candidate elimination).
- The score is a Rasch ability (θ), so versions measured on different examples still compare on one scale; each round says when its lift is noise (what a winner's number may claim).
- The search has three layers: L1 proposes versions, L2 rewrites how L1 searches when L1 stalls, L3 rewrites the plan when L2 stalls. When a branch is spent, a UCB rule picks the ancestor to re-expand: AlphaZero-shaped tree search over the lineage, with deterministic scoring in place of rollouts (the loop, the mapping).
- Self-optimization (L4): the optimizer is itself a pipeline of nodes, so it can be pointed at its own optimizer prompts (L4). Research, run from a checkout.
- A campaign is a folder on disk. Each round is a JSON file the app renders as a scoreboard; pause, resume, rewind to any round, or fork a sibling and compare (persistence and recovery).
Same family as GEPA. A wider reach.
PromptPotter belongs to the same family as GEPA, MIPROv2 and CAPO: an LLM proposes versions, a scorer ranks them, the winners breed.
| GEPA | PromptPotter | |
|---|---|---|
| Tunes model, temperature and pipeline thresholds together with the prompt | partly | ✓ |
| Stops scoring a losing version early | partly | ✓ |
| Prices every measurement, cache hits included | ✗ | ✓ |
| Open and inspectable: code on GitHub, a browser app, a run you pause, resume, rewind or fork | partly | ✓ |
GEPA is ahead on reach: it ships inside DSPy's ecosystem. PromptPotter is also a bench: GEPA, CAPO and LEVI run inside it as optimizers under one grader, one budget meter and one stopping rule. The capability comparison is not a benchmark result (the landscape, what we measure on).
Works with what you already run
| You built it with | How PromptPotter meets it |
|---|---|
| LangGraph, CrewAI, the OpenAI Agents SDK, Bedrock Agents, n8n, Dify, plain FastAPI | Two HTTP endpoints on your backend; the knobs your pipeline declares become what is tuned (backend integration) |
| DSPy | PromptPotterOpt, in place of MIPROv2 or GEPA (DSPy guide) |
| An agent in a sandbox | Each version runs as a Harbor trial, graded by the task's own checker |
| OpenRouter, OpenAI, Anthropic, Groq | Any of them, for your pipeline and for the optimizer |
What you get back: export.json, the winning prompt and settings by field name, with the evidence behind them. We never load, host, route or hot-swap anything in your production path.
What is stable, what is beta
- 🟢 Stable: the campaign loop from the CLI, the local app and
/potter-run; the HTTP connector and itsexport.json; pause, resume, rewind (resume --from N) and fork; the head-to-head bench (GEPA, CAPO and the rest under one grader and one budget); the zero-spend offline run. - 🟡 Beta: the hosted app and the team box (accounts, delegates, API keys, the wallet); the MCP host tools; embedded Python, whose surface still changes between releases; the n8n, Harbor and DSPy connectors.
- 🧪 Research: L4 self-optimization (
promptpotter-self), run from a checkout.
Limitations
- Parameters only. Prompts, thresholds, model settings; never model weights or architectures.
- It needs a known answer or a checker. Each example's expected output, or the backend's own grader (Harbor).
- In-run scores are not held-out scores. The number to quote is the winner's score on held-out examples no optimizer saw:
python -m promptpotter held-out.
Contributing
git clone https://github.com/PromptPotter/prompt-potter-optimizer && cd prompt-potter-optimizer
python scripts/gate.py # every check CI runs; the first run builds .venv from uv.lock
Five entry points share one engine: the webapp, /potter-run, the CLI, the REST API, and embedded Python. Every optimizer runs end to end at zero spend (offline run), so a change can prove it moves no decision the loop makes. Start at the developer guide, then CONTRIBUTING.md.
Docs: the manual · docs index · architecture · roadmap
If PromptPotter saves you an afternoon of prompt fiddling, a ⭐ helps the next person find it.
Citation
@software{promptpotter,
title = {PromptPotter: LLM-Driven Evolution of Prompts and Pipelines},
author = {Streuli, David},
year = {2026},
url = {https://github.com/PromptPotter/prompt-potter-optimizer}
}
Metadata
Release files for promptpotter 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| promptpotter-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for promptpotter-0.9.0-py3-none-any.whl |
Release files / promptpotter-0.9.0-py3-none-any.whl
| Download URL | promptpotter-0.9.0-py3-none-any.whl |
|---|---|
| Size | 2.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed6d6ccb2cd4f0923958eba11e87a027f31355ef8900f00d903ee95d9aeb5708
|
|
BLAKE2b-256 checksum How to use checksums |
0ca02fa98dc435fb0503353b433114703fa873ba3eeac22cc9405739e244d027
|
| 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 30, 2026.
Transparency logSecurity for promptpotter 0.9.0
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
1 file in this release has been uploaded with provenance metadata.
Attestation for promptpotter-0.9.0-py3-none-any.whl
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 30, 2026.
Transparency logA 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.