v1.9.56·Local LLM proxy·Free and open source·MIT

Know what every agent run costs.Kill the runaway before it drains your budget.

A local LLM proxy that shows you what every agent run costs and caps the runaway before it drains your budget. Routing each request to the model that fits is the mechanism that keeps the bill down.

npm install -g @relayplane/proxy && relayplane start
Local by default · No telemetry required·Routes a production agent pipeline every day·11 providers supported
Illustration · one endpoint, routed by task classlocalhost:4100
agent
request
localhost:4100
simplehaiku$0.10/Mtok
agenticcodex / sonnetplan + overflow
judgmentopus / sonnet$15/Mtok
60% simple22% agentic18% judgment
Dogfooded in production

RelayPlane routes the agent pipeline that ships this product. Every run behind this site is metered at list price, capped by the same budget guards, and written to a local ledger. We watch our own bill through it every day.

Star it on GitHub ↗·MIT licensed·11 providers·Local by default, no account
Runaway agents

One stuck agent at API rates is $40 an hour.

Open Claude Code issue #26171: an agent burned 72,900 tokens over 21 minutes in a thinking loop with zero useful output. You do not notice until the bill. RelayPlane watches a sliding window of your traffic and catches velocity spikes, token explosions, and repetition loops before they run up a charge, then stops at the budget cap.

contoso-eval · runaway loop
Shipped guards
  • Velocity detection. Sliding window flags req/min spikes before they burn through a budget.
  • Token-explosion guard. Catches the 72k-token loop pattern and blocks the next call.
  • Cost acceleration. If $/min doubles inside the window, requests downgrade or pause based on policy.
  • Hard budget caps. Per agent, per day. Action is configurable: block, downgrade, warn, alert.
  • Circuit breaker and cascade. A 429 on one provider fails over to another instead of failing your run.

Anomaly detection and budget caps are live in the local proxy today. All of it runs on your machine, with no account.

Run attribution

See what each run and each agent cost.

Put relayplane run --label nightly-backfill -- ./orchestrate.sh in front of any command. No SDK, no instrumentation, nothing inside your agent. The proxy already sees every request, so tagging the process at dispatch time turns the rollup into a group-by: cost per run, per agent, per thread, per retry.

nightly-backfill · run rollup
$ relayplane run --label nightly-backfill -- ./orchestrate.sh

Run nightly-backfill-20260905-a1b2c3 (nightly-backfill)  completed  18m 42s
  cost $6.41 notional (all-opus baseline $19.02)   requests 214   retries $1.10 (17%)   band in [4.00, 9.00]
  429s 0   model drift 3
  agents: coder $3.88 (121 req, sonnet x118, haiku x3) | architect $1.94 (34 req, opus x34)
  dashboard http://localhost:4100/dashboard#run=nightly-backfill-20260905-a1b2c3
What you get
  • Cost per run, split by agent. Which step of the job actually spent the money, and which model it used to spend it.
  • Retries as a share of spend. Rework is tracked apart from work, so you can see how much of a run was the same request twice.
  • Expected bands and per-run caps. Learn what a workflow normally costs, then get told when today is not like the others, or cap one runaway job without stopping the machine.

Every figure is notional list price for the traffic, never an invoice. The ledger is SQLite on your machine and nothing about a run is uploaded.

Runs and attribution docs

Local dashboard

Every request, priced, on your machine.

Open localhost:4100 afterrelayplane start. Live spend for the day, per-model and per-agent breakdown, and the full request ledger. Or stay in the terminal: relayplane watch is a live cost ticker. Nothing leaves your machine and there is no login.

localhost:4100
RelayPlane local dashboard showing live cost, per-model spend, and per-agent breakdown
Route by role

Swap models with a config edit, not a rewrite.

Tell RelayPlane which tier of model handles simple, moderate, and complex work, or pin a specific model per agent. Every tool that speaks the OpenAI or Anthropic API goes through the same endpoint, so changing models never means changing code.

Task class
Best fit
Rate
Share of your traffic
Code review, judgment, taste
Claude Opus / Sonnet
$3 / $15 per Mtok
~18%
Agentic coding, planning
ChatGPT Codex / Sonnet
plan credit + overflow
~22%
Scoring, dedup, voice checks, classification
Haiku · Groq Llama · GPT-4o-mini
$0.10 to $0.80 per Mtok
~60%
Most agent pipelines are 60 to 80% routine. Routing the routine 60% to a $0.10 model is where the savings live. The frontier still gets the work it deserves.

We run our own autonomous engineering pipeline through RelayPlane. Last week we flipped its coder role from Claude to Kimi K3 on OpenRouter by editing two fields in one JSON file, watched the live cost pane, and flipped back nine hours later when the numbers said no. That is the whole workflow.

// one role, one edit, no code changes
"coder": { "provider": "anthropic", "model": "claude-sonnet-5" }
// vs
"coder": { "provider": "opencode",  "model": "openrouter/moonshotai/kimi-k3" }
How it works

Three pillars: observe the cost, govern the spend, verify the work.

Observe is in production. Govern is shipping in pieces (budget caps and anomaly detection today, a kill-switch endpoint next). Verify is on the roadmap and runs out of band today.

Pillar 1 · ObserveShipped

See everything, per agent.

Every LLM request flows through the proxy with full attribution. Cost, model, task type, tokens, latency, all live. The per-agent breakdown uses the system-prompt fingerprint, so there is no annotation work required.

  • Per-agent and per-model cost tracking
  • Cache-aware accounting (Anthropic prompt caching)
  • Full request ledger, exportable
  • Local retention, no account, no cap on history
Pillar 2 · GovernShipping in pieces

Hard budget caps. Anomaly detection.

Daily, hourly, and per-request budget caps with block, downgrade, warn, or alert actions. Velocity spikes, repetition loops, and token explosions are detected in a sliding window. A kill-switch endpoint is next on the roadmap.

  • Budget caps, configurable action per breach (live)
  • Anomaly detection across the request window (live)
  • Credential pool, round-robin across keys (live)
  • Quota-aware fail-over before 429s (live)
  • Kill-switch HTTP endpoint (on the roadmap)
Pillar 3 · VerifyOn the roadmap

Spec-match before it ships.

Before an agent marks a task done, RelayPlane will score the diff and acceptance criteria with a cheap judge model. Failing tasks retry. Today this lives as a separate evaluator in our pipeline. Moving it into RelayPlane is on deck.

  • Per-criterion pass / fail with evidence
  • Blocker, major, minor severity weighting
  • Judge model configurable, Haiku by default
  • Runs in our pipeline today, RP integration on the roadmap
The receipts

Not a demo. A production tool.

These are real numbers, not aspirations. The version is the live npm tag. The rest come from an autonomous engineering pipeline we run through this proxy every day: it routes, prices, and guards all of its traffic.

v1.9.56
Live on npm
@relayplane/proxy
11
Providers supported
Anthropic to local
~1,900/day
Requests routed
through this proxy
4 mo
In production
6,000+ pipeline runs
Get started

One command. Three minutes.

Works with Claude Code, Cursor, OpenClaw, and any agent that supports ANTHROPIC_BASE_URL or OPENAI_BASE_URL. Point your agent at localhost:4100 and you are done.

npm install -g @relayplane/proxy && relayplane init && relayplane start
Anthropic · OpenAI · Google Gemini · xAI / Grok · OpenRouter · DeepSeek · Groq · Mistral · Together · Fireworks · Perplexity