One review. Five parts.
- Reads: your repo and your eval results, and the model calls it makes itself.
- Never touches: your production traffic or your request path. There is no proxy and no inline latency.
- You change: nothing in your code. Margin opens a pull request you merge, and if quality slips it opens the revert as a second pull request.
Margin grades each agent operation on your evals, against what it cost. Only you know what the outcome was worth: a merged PR, a passed test, a resolved ticket. Price it and each operation reports its return; price nothing and it reports cost per outcome, labelled as one.
We turned down a 69% saving. 116 real tasks, a cheaper route at 31% of the incumbent’s bill, quality 93% to 79%, parity 0.85 against a 0.97 bar. The gate refused it. Published, tagged is_simulated=false.
The Meter
Every call, metered: cost, tokens, substrate, and whether it worked, a verdict your own evals supply.
Margin meters the model calls its own runs make, on a connected repository or a dropped folder, and records what each one cost. The verdicts come from the results your eval tools already write, through 8 adapters. Nothing is added to your code or your request path; an optional SDK can record production calls after each response returns.
Cost per outcome is the honest default of a value-per-outcome model. Until you price an outcome, every figure Margin computes is cost per outcome, and it is labelled as one. Price yours and the meter records it beside the cost, every outcome counted once and unweighted. A value you did not supply is never invented.
is_simulated=falsecaptured 2026-09-03Source: the committed artifact provenance/oss_cost_per_outcome_usd.json, Aider and CrewAI on gpt-4o. The published package trails this build: PyPI is 0.6.23 (repo 0.6.24). A plain pip install does not fetch every adapter shown yet. Setup through /start works on it. Registries read 2026-11-02.
The Estate
The org chart of your AI workforce: team, environment, agent, operation.
It falls out of the data, so nobody draws it by hand. It is current to the last metered call, not always live, and an agent that stopped stays on the list, marked silent.
The stand-in company bills $59,988.70 over 30 days. Its full org chart is on the console.
is_simulated=false in all threecaptured 2026-08-19 → 2026-09-19Source: the committed artifacts provenance/{oss_cost_per_outcome_usd, autoroute_defended_savings_frac, reasoning_effort_savings_frac}.json.
The Money Map
Where the spend actually goes, decomposed by step.
Spend is easy to total and hard to locate, so the map splits each step’s waste between retries and cache and ranks the steps by dollars, the part we can measure. Only you know what a step is worth.
is_simulated=false in all threecaptured 2026-08-19 → 2026-09-19Source: the committed artifacts provenance/{oss_cost_per_outcome_usd, autoroute_defended_savings_frac, reasoning_effort_savings_frac}.json. The shares and the split derive from them at build time.
The Parity Gate
A cheaper route is promoted only while quality holds, and reverted when it slips.
Its refusals, its spread and the floor tests
Try the gate’s rule. It models the rule, not a recording of live traffic. Floor 0.97.
Hold Cheaper, and refused: under the floor, the saving buys lost quality.
Nothing you drag leaves the browser. Measured verdicts are on the console.
Promoted: the thinking budget, 64% cheaper. Not worse task for task in a paired eval, the first route the gate has passed, on 2026-09-19.
is_simulated=falseThe Governor
The action half: the control loop, with a person ratifying every change.
Once you ratify a promotion, the Governor publishes it and arms an automatic revert. If parity slips on live traffic, the decision rolls back and says so. The system proposes and proves; a person approves.
- 6 paired tasks
- parity 1.00 → promoted
- re-run: 116 tasks
- parity 0.85 < 0.97
- withdrawn, evidence kept
No customer routes moved here: this was a claim on our own books.
is_simulated=false in bothpromoted 2026-07-19 · refused 2026-08-19 · withdrawn 2026-08-19Source: the committed artifacts provenance/autoroute_savings_frac.json (which carries its own withdrawal note, MAR-515) and provenance/autoroute_defended_savings_frac.json. The original promoted=true record is in git history: we withdraw claims, never evidence.
The loop
One control loop, five parts.
The Meter, the Estate, the Money Map, the Parity Gate, the Governor. A 1:41 narrated film; no video loads until you press play.
- Model routing
- Reasoning effort / thinking budget
- Output-length control
- Prompt / prefix caching
- Batch / flex mode
25 levers in the catalogue · 5 named here
Watch the loop run on real spend.
The console runs it on open-source agents we metered ourselves, every number tagged real or sample.
Free and open: Margin in your coding agent
The Margin plugin for Claude Code, and configs for Cursor and Codex, are MIT licensed. Your agent can ask where the money goes per job, which steps are worth a face-off, and what a face-off found, from your own project. They read; face-offs and pull requests stay in the console.
margin-plugins on GitHubWhat Margin adds: the acting half
Proving a cheaper model held quality first, promoting that route, and reverting it when parity slips. Measuring spend is becoming table stakes; this is the product.