Every gateway claims failover. Almost none of them show you what actually happened when a provider said no. I built Pygg because my coding agent kept dying mid-task, and I wanted a router I could audit — every attempt in a ledger, every routing decision explainable.

So I ran LiteLLM head-to-head against Pygg on the same failure scenarios. Not benchmarks from a README — the same staged limit events, the same checks, measured here. The full comparison table lives in the Pygg repo (docs/BENCHMARKS.md); here is what it actually says.

The table

Rows marked (M) were measured in this repo's benchmark runs. Rows marked (D) come from the other project's docs or source. Only LiteLLM was actually run head-to-head.

Pygg LiteLLM
Time added per request 4 ms, ~230 req/s (M) 2 ms at 1,170 req/s, 4 instances (D)
Primary failing: served 100% (M) 100% (M)
Attempts to get past a rate-limited primary 1.04, ~70 ms (M) 4, ~4.6 s (M)
Honours Retry-After Yes (M) up to 60 s (D, M)
Re-sends a possibly-run request No by default (M) up to 3 (M)
Session stays on one key Default, 60/60 (M) opt-in: 0/60 off, 60/60 on (M)
Prompt cache, OpenAI-format on Claude Automatic, 89.5% (M) 0% by default; 89.5% / 39.7% configured (M)
Web sessions 6 sites, guard always on (M) No

What the numbers mean

Failover speed is the whole game. When a provider rate-limits you mid-task, Pygg is back serving in ~70 ms after about one attempt. LiteLLM took 4 attempts and ~4.6 seconds on the same scenario. Both eventually served 100% — but four seconds of dead air, four times, is what a coding agent feels as a stalled task.

Never re-sending a possibly-run request matters more than it sounds. If a provider drops the connection after receiving your request, it may already have run it — and billed you. Pygg stops instead of retrying. LiteLLM retries up to 3 times by default. That is a double-billing risk dressed up as resilience.

The prompt cache is free money, and it is on by default in Pygg. 89.5% of the prompt was read from cache in the measured runs. LiteLLM gets you the same 89.5% — but only after you configure it. Out of the box it is 0%. And the session stays on one key by default in Pygg, which is what keeps that cache working across a switch; LiteLLM needs the opt-in turned on.

Where LiteLLM wins

Raw throughput. LiteLLM does ~1,170 requests a second across 4 instances; Pygg does ~230. If you are proxying high-volume traffic for a team, that gap is real. Pygg is a local gateway for one developer's coding agents, not a fleet proxy — but the number is the number, and I am not hiding it.

The part that is not in the table

Failover is plumbing. The thing that actually changed my bill was Brain — planning with cheap models. A cheap model on its own scored 0/37 on a hidden API check suite (the server never even started). The same cheap model, given a plan split into small cards each with a check, scored 37/37 on the API and 20/21 on the UI. Same model, same task — the difference was the planning, not the routing.

Honest note: Brain buys capability, not savings. That planned run cost more and took longer than just running the strong model alone. What it buys is doing big-model tasks with a cheap model when the strong one is unavailable, rate-limited, or out of budget. That is the trade, stated plainly.

Try it

npm install -g @pygg/cli@dev pygg gateway add-connection --preset gemini --key-env GEMINI_API_KEY pygg setup claude pygg run claude 

The gateway listens on 127.0.0.1:8741, model auto. Every attempt lands in the cost ledger with its source — actual, estimated, or unknown. Never $0.

Repo: https://github.com/nambean/Pygg — MIT, Rust + Tauri. It is a dev preview (v0.1.0-dev.9): the gateway and the Windows app are verified live, but no outside user has run it yet, so I am here for honest feedback, not hype.