Gunicorn-style agent swarms with Redis-like shared memory and artifact stitching. (Imported as `puppetmaster`; published as `puppetmaster-ai` because the bare PyPI name is held by an abandoned 2019 project, name-reassignment pending.)
Project description
Puppetmaster
Turn Cursor, Claude Code, the OpenAI API, or the Codex CLI into an orchestrator that routes every task to the cheapest model that can handle it, runs workers as independent processes, and stores their output as typed SQLite artifacts so follow-ups cost zero tokens.
Live OpenAI A/B, real billing tokens, same prompt, equivalent answer: pinned
gpt-5.5cost $0.0132; Puppetmaster routed the same task togpt-5.4-nanofor $0.00016 — 98.8% cheaper and 81% faster. Reproduce in ~$0.01 of spend:OPENAI_API_KEY=... python -m bench.router_live_ab.
Install
pipx install puppetmaster-ai # or: pip install puppetmaster-ai
puppetmaster setup # doctor + models init + MCP installers + agent rules, idempotent
That's the whole install. setup runs every step idempotently, skips any tool that isn't present, and prints what it did. Restart Cursor (or open a fresh Codex / Claude session) and the agent sees 32+ puppetmaster_* tools plus a rule nudging it to reach for them on multi-file work.
To run benchmarks or hack on it, clone instead — see Contributing. (pipx keeps the CLI in its own isolated environment, which is the recommended way to install a command-line app.)
Index
New here? Watch the GIF above, run pipx install puppetmaster-ai && puppetmaster setup, then skim What it does.
| Want to… | Go to |
|---|---|
| Understand the design & what it fixes | docs/WHY.md |
| See the proof behind the claims | docs/CLAIMS.md · receipts in bench/ |
| See everything that ships + adapters | docs/FEATURES.md |
| Copy/paste prompts & shell recipes | Quickstart · docs/DAILY_DRIVER.md |
| Read the full docs set | docs/README.md |
| Browse by directory | puppetmaster/ · bench/ · examples/ · scripts/ · clients/typescript/ · cursor-extension/ |
| Know what's honest vs. overclaim | TALKING_POINTS.md |
What it does
Think Redis/Gunicorn for agentic engineering:
Cursor Agent / Claude Code / OpenAI / Codex CLI / shell
|
v
Puppetmaster supervisor ──> task-aware model router (auto-routes by cost)
|
v
independent worker processes ──> SQLite (typed artifacts, events, memory)
|
v
live artifact board ──> stitched summary ──> 0-token follow-up reads
Puppetmaster isn't trying to beat native IDE subagents at every tiny task. It's for the work that gets messy: long repo investigations, conflicting hypotheses, repeated handoffs, flaky memory, and code changes that need evidence, replay, and approval gates. The rationale and failure modes it fixes are in docs/WHY.md.
The demo (no API keys)
The whole story in one command — local + shell adapters, nothing to configure:
./scripts/demo.sh # the 60-second tour (clean machine, no keys)
python -m puppetmaster dashboard # live, zero-dependency web board for any job
It routes a task mix by cost, fans out a 6-role swarm as independent processes, reads the stitched summary, then proves follow-up reads cost $0.00. Script + GIF source: scripts/.
Why it's credible — four claims, four receipts
Every number is reproducible from a script in bench/. Full detail + caveats: docs/CLAIMS.md.
- Cost is fixed on two axes. New work auto-routes to the cheapest sufficient model (35% cheaper on a fixture; 98.8% cheaper in a live OpenAI A/B). Follow-ups are SQLite reads, not new agent runs (40 queries, $0.00, 0.5 ms each).
- Workers don't share a transcript. They lease tasks and emit typed artifacts (payload +
evidence+confidence+sha256); the stitcher reads JSON, not stdout. Inspect withpuppetmaster artifacts <job_id>. - Graphing is CodeGraph's win, wired in cleanly. Workers auto-inject task-relevant graph context before the model call; fall back to grep/read without it. (docs/CODEGRAPH.md)
- A dead provider doesn't kill the swarm (v0.9.0+). Billing/quota/auth/missing-CLI failures are marked
FAILEDand auto-rerouted to the next funded adapter, preferring plan-billed models. Validated live; surfaced loudly in the summary's Alerts section.
Quickstart
After install, try one of these inside Cursor Agent or Codex:
Use Puppetmaster to run doctor in this repo and summarize what is missing.
Use Puppetmaster to start a cursor swarm for this repo and return the job id immediately.
Problem: users get logged out after refresh and token-refresh tests are flaky.
Constraints: keep the patch focused, preserve public API behavior, run relevant tests.
Do review/plan first. Poll status/logs by job id. Do not edit until you summarize findings and ask for approval.
Or from the shell:
puppetmaster doctor
puppetmaster route "Security audit every endpoint" --role audit # dry-run routing decision
puppetmaster cursor "Review this repo for release blockers" --review --dry-run
puppetmaster claude "Implement the approved change and run focused tests" --permission-mode acceptEdits
puppetmaster show $(puppetmaster last)
More recipes in docs/DAILY_DRIVER.md.
Status
Daily-driver beta. Real runtime contract, automated tests, SQLite default backend, fail-closed jobs, live Cursor Agent MCP, installable Cursor extension, validated full-edit adapters. Credible for supervised local engineering; not yet a hosted multi-user service. Full feature matrix: docs/FEATURES.md.
Pip name: PyPI lists this as puppetmaster-ai because PEP-503 normalization collides puppetmaster with an abandoned 2019 puppet-master. The import name, CLI, repo, and brand stay puppetmaster. (tracking)
License
MIT
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
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 puppetmaster_ai-0.9.1.tar.gz.
File metadata
- Download URL: puppetmaster_ai-0.9.1.tar.gz
- Upload date:
- Size: 213.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28e4368d6ad50c41c8fe7147fa16bfd7361d7e4e3e28649af7c901bb79eb2b15
|
|
| MD5 |
2c95a3c96f6fca1eda2bcf74344cb9ef
|
|
| BLAKE2b-256 |
ac300f7aebb7b501a00c4938c3d5fae5702812d149a0db7218f1c2517923a798
|
File details
Details for the file puppetmaster_ai-0.9.1-py3-none-any.whl.
File metadata
- Download URL: puppetmaster_ai-0.9.1-py3-none-any.whl
- Upload date:
- Size: 174.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fac648c1e1274717cd4ac578b4f78c6c39691ea74bf8f14ca590f9357619c0d
|
|
| MD5 |
65df313187239b4b1c0a4720da940abe
|
|
| BLAKE2b-256 |
76d0cf3d04df700dfcee7b4740fb205346df2e29f3c1a1ec5b133917d7958879
|