Connect your agents. Nothing to install.
Connect your repository or drop the folder. Margin runs each agent on the evals beside it and reads cost‑per‑outcome.
- 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.
The first two runs on a repository are free, and Margin pays up to $100 of the inference.
What would your number mean?
Three steps to your first number.
Sign in · no password
Sign in.
Sign‑up by email, GitHub or Google. No password; the account starts empty.
works today
the ways in · console.trymargin.io/signin
- GitHubone click
- Googleone click
- Emaila sign‑in link
Rather talk first? Email the founder. A person replies, usually the same day. Your agents in · nothing to install
Connect the repository, or drop the folder.
Margin lists the agents it finds and you pick which run. A dropped folder is kept private; files named like secrets stay on your laptop.
- Code on GitHubconnect it
- Not on GitHub, or no App accessdrop the folder
- Evals in your own runner, or keys read from a file: your coding agent sets it up through our MCP server and opens one pull requestone PR
- Working in Claude Code, Cursor or Codex: add Margin to your agent (a plugin, or one MCP block) and ask it to connecta plugin
- Already on Langfuse or LangSmith: drop the export on your console for a first cost per outcome, no key to createan export
works today, from a repository or a folder
test‑agents/ · our own three‑agent team
- ├─ 01-one-shot/
- ├─ agent.pyagent
- └─ evals/test_answer.pyits evals
- ├─ 02-retry/
- ├─ agent.pyagent
- └─ evals/test_retry.pyits evals
- ├─ 03-chain/
- ├─ agent.pyagent
- └─ evals/test_chain.pyits evals
Each agent keeps its evals beside it. Yours can sit the same way. Your evals in · already beside the code
Execute. Your evals grade it.
Each agent is graded by the
test_*.pyfiles beside it; pass or fail is the denominator. Price an outcome and the number becomes value‑per‑outcome. A value you did not supply is never invented.works today with pytest evals · a value is optional
what a run gives back
- Cost per outcomeper agent where it splits
- Passes per agentfrom your evals
- A cheaper model on the same casesface‑off
- The change, if one holdsa draft PR, or a patch
A skipped test is never counted as a verdict.
optional · your coding agent, or production traffic
Hand it to your coding agent, or meter production.
The agent tab is a prompt for your coding agent. It follows the same instructions as this page, asks you for the key, and hands the change back as one pull request you review.
The other tabs are the SDK. A run measures your agents on your evals; real user traffic needs the meter in your production path, a key and a few lines around the client you already call. Eval results go in through the same key, by one of 8 adapters. No prompt text leaves your process: the SDK fingerprints each request and names the host that served it. The one thing you may add is verdict=, a short label for what the agent decided.
Set up Margin in this repository.
1. Read https://trymargin.io/llms.txt and follow its paths in order. Use the no-install path unless I ask for production metering.
2. If I ask for production metering, install margin-meter for this repo's language. In Python, run `margin-meter doctor` first to list every provider call site, then make the one edit at the entrypoint that covers them, and run it again to show me what is covered.
3. Ask me for the ingest key. Do not make one up and do not commit it; read it from the environment.
4. With the key, if you can reach Margin's MCP server at https://trymargin.io/api/mcp, call margin_instrument_plan for the exact edits and margin_eval_setup_plan for the eval hooks.
5. Leave my evals, prompts and model choices alone. Open the change as one pull request for me to review.margin‑meter on npm and PyPI · PyPI trails the repo
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 here works on it. Registries read 2026-11-02.
Questions before you sign in.
Does Margin change my code?
No. On the no-install path nothing goes into your code. Margin never changes code by itself: a switch it recommends arrives as a pull request that a person merges.
Where does my code run, and what does it need?
A run clones the repository you connect and runs your own evals in a fresh virtual machine, one per run, destroyed when the run ends. Its network is closed except four hosts: OpenRouter, PyPI and its file host, and the npm registry. The sandbox's network proxy adds the model key to requests, so the run's environment holds no real key. Margin uses a key it makes for that run, capped in dollars, or the OpenRouter key you saved in the console, whose limit you set. For what a pull request looks like, the case study prints the one Margin opened on its own agent, in full. Read the case study.
What if I have no evals?
A pass or a fail comes from your evals, so without them there is nothing to divide by, and Margin does not guess a pass. It can draft eval criteria from your repository for you to review and accept, or you can email the founder and talk it through.
What do you store, and what leaves my machine?
A dropped folder is kept privately so it can run, and files named like secrets stay on your laptop. The security page lists every field stored about a call and what is absent by design. Read the security page.
What does it cost?
The first two measurement runs on one repository are free, and Margin pays for up to $100 of the inference. A pilot is $2,000 once, for 45 days on one agent workflow, credited to your first month if you continue. Production is $2,000 a month, flat. Never a share of your spend or your savings. Read the terms.
What if a cheaper model is worse?
Then Margin does not propose it. A switch goes forward only when the cheaper model holds quality on your own evals. The public ledger lists every switch Margin tested on its own work, refusals included. See the ledger.
Do you report what an outcome is worth?
Only if you tell it. Without a value from you, Margin reports cost per outcome and says so. It never invents a value.
Sign in, connect, Execute.
You get the founder, not a sales rep.