An LLM-driven prompt optimizer for the whole pipeline
Hand it a labeled dataset and a pipeline. It evolves the prompt and the pipeline's parameters together,
cuts a losing candidate the moment the evidence says it will not win, and shows you every measurement behind the winner.
Open the app → · nothing to install, sign in and bring your examples
Or pip install promptpotter and run it on your machine; or self-host it for your team.
It sits behind your stack, never in place of it. PromptPotter calls your pipeline the way your users do, measures it on your examples, and hands back a better configuration as a file.
A real, finished campaign — seven rounds on JustLogic. Every figure on this page is an in-campaign reading from a small run, not a benchmark result.
Works with what you already run
| You built it with | How PromptPotter meets it |
|---|---|
| An agent framework, a managed agent service or a workflow builder — LangGraph, CrewAI, the OpenAI Agents SDK, Bedrock Agents, n8n, Dify, or plain FastAPI | A Connector declaration; an HTTP backend's default endpoints are POST /matches and GET /pipeline, the body its connector's, and the knobs your pipeline declares become what is tuned (backend integration) |
| DSPy | PromptPotterOpt, where you would reach for GEPA (dspy-optimizer) |
| An agent in a sandbox | Each candidate 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 |
┌──────────────────────┐ ┌──────────────────────┐
│ Your backend │ GET /pipeline ───────────────► │ PromptPotter │
│ (any pipeline) │ {nodes, pipelines}, read live │ │
│ │ at run init + every draft read │ generates candidates│
│ runs one query │ │ scores + critiques │
│ per call │ POST /matches ◄─────────────── │ elects, iterates │
│ │ {query, steps, node_config} │ │
│ │ │ │
│ │ answer + step_tokens ──► │ hands back │
│ │ + diagnostics.warnings │ export.json │
└──────────────────────┘ └──────────────────────┘
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 it does differently
Prompt optimization that stops paying for losers. Every measurement costs money, so the whole design is most fitness per dollar.
One real round, replayed from its readout.log: candidate 3 is cut after 7 of 34 samples; the other 27 are never bought — Posterior-of-Being-Best.
- It moves the pipeline, not just the words. Model, temperature, node thresholds, the output schema — whatever your
pipeline.yamldeclares tunable — mutate and are selected jointly with the prompt. - The budget goes where candidates separate. Scoring goes to the samples that tell candidates apart; anything already measured is replayed, never re-bought. Every number opens down to the call: one candidate on one sample, with prediction, ground truth, the exact input each node received, and whether it was paid for or replayed.
- It does not certify its own winner. Scores are a subset-invariant ability (Rasch θ), and each round says when its lift is noise (what a winner's number may claim).
- A campaign is an object 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).
📺 Longer: Live #2 — a Swiss-invoice campaign, run raw.
Quickstart
Python 3.13+ and an OpenRouter key — the optimizer's default provider.
pip install "promptpotter[all]"
python -m promptpotter new tickets.csv --set raw_task_description="classify support tickets by urgency"
python -m promptpotter resume
Bring a labeled dataset — input/output pairs as any delimited text, JSON, JSONL or a spreadsheet — and say what the job is. resume picks up wherever the last run stopped: Ctrl+C pauses a campaign rather than losing it. The DSPy and Harbor connectors are opt-in extras ([dspy], [harbor]).
To watch it in the app shown above:
python -X utf8 -m uvicorn promptpotter.main:app --port 8001 # then open http://localhost:8001/
Already in DSPy? from promptpotter.presentation.teleprompter import PromptPotterOpt installs where you would reach for GEPA (dspy-optimizer.md). Six chapters from install to troubleshooting: the manual.
Five entry points
| Webapp | The chat-first browser control plane — app.promptpotter.com hosted, http://localhost:8001/ local (roadmap). |
/potter-run |
Claude Code skill — an agent launches, supervises and diagnoses a campaign from your editor. |
| CLI | python -m promptpotter new <name> / resume. |
| REST API | Every control verb the webapp issues, for when another system drives the campaign. |
| Embedded in Python | A host program drives one campaign inside its own event loop; the DSPy optimizer is the simple-case entry. |
What is stable, what is beta
| What it covers | |
|---|---|
| 🟢 Stable | • the campaign loop from the CLI, the local webapp and /potter-run• the HTTP connector and its export.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 |
How the search works
Every round generates, scores and critiques (L1). When L1 stalls, L2 rewrites how it searches; when L2 stalls, L3 rewrites the plan. The loop exits on a stopping rule — goal, budget or plateau — not a fixed trial count (the loop). It searches a tree, not a trail: when a branch is spent, a UCB rule picks the ancestor to re-expand — AlphaZero-shaped MCTS over the lineage, with deterministic evaluation in place of rollouts (the mapping).
PromptPotter belongs to the LLM-driven evolution family beside GEPA, MIPROv2, CAPO and AlphaEvolve; it evolves a whole declared pipeline jointly with the prompt, and it is a bench built to run other people's optimizers under one grader, one budget meter and one stopping rule. The capability comparison: the landscape; what we measure on: promptpotter.com/benchmarks.
Extending the engine
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
The optimizer is itself a pipeline of nodes, so it can be pointed at its own optimizer prompts (self-optimization, L4), and every optimizer runs end to end at zero spend (offline-run.md). The repo is also a launchpad for a codebase agents maintain: scripts/gate.py runs every CI check, its doc-claim probes fail a doc whose cited code moved, and the offline run replayed against main says whether a change moves any decision the loop makes, so an agent can land a large refactor and prove it. Start at the developer guide, then CONTRIBUTING.md.
Limitations
- Parameter-based optimization only — prompts, thresholds, model settings; not model weights or architectures.
- Needs a known answer or a verifier — the example's expected output, or the backend's own checker (Harbor).
- In-campaign figures are not held-out figures. The headline is the winner's score on a held-out bench set no optimizer sees:
python -m promptpotter bench.
Documentation
The manual · docs index · architecture · roadmap
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.8.20
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.8.20-py3-none-any.whl | Python 3 | none | any | Details for promptpotter-0.8.20-py3-none-any.whl |
Release files / promptpotter-0.8.20-py3-none-any.whl
| Download URL | promptpotter-0.8.20-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0572b1d3c2ffa902594719013d83829fcd995755446c05babbec07bdef9482a
|
|
BLAKE2b-256 checksum How to use checksums |
55f04ced745ade391fb29d294415bb0dd0e3b40f1be4c6616b0a1416a118aee1
|
| 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 13, 2026.
Transparency logSecurity for promptpotter 0.8.20
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.8.20-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 13, 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.