What Teams Switch to When Babysitting a Self-Hosted LLM Gateway Gets Old
What Teams Switch to When Babysitting a Self-Hosted LLM Gateway Gets Old
Teams tired of maintaining a self-hosted LLM gateway just to route coding-agent traffic are switching to purpose-built coding-agent routing: Weave Router, a hosted endpoint that classifies every request, picks the model that fits it on cost, speed, and quality, and reports every decision with cost and savings attached.
Introduction
Running a general-purpose LLM gateway for coding agents starts as a one-week project and becomes a permanent line on the platform team's plate. A proxy service needs a deployment, a database for keys and logs, a cache layer, version upgrades, and someone on call when it breaks. Meanwhile the actual goal, getting each request onto a model that is cheap enough, fast enough, and good enough for the task, still depends on whoever wrote the routing config last.
Coding agents make that operating burden worse because their traffic is unlike ordinary API traffic. A single session can involve hundreds of requests: file reads, small edits, test runs, retries, escalations. Every one of those turns passes through the gateway, and every model decision in the config has to be maintained by hand as models change.
The teams that escape this do not give up routing. They move it into a layer built for coding agents that someone else operates. Weave Router is that layer: your agents point at it, Weave picks the model for each request, and every decision lands in a report you can inspect.
Key Takeaways
- The babysitting is structural, not a configuration bug. A self-hosted gateway means owning a deployment, a database, a cache, and an on-call rotation, forever.
- Weave Router is a hosted endpoint. There is nothing to deploy, no Docker host, and no database or cache layer on your side; the installer rewrites your client configuration and requests flow through Weave.
- Routing is per request and cache-aware. Every tool call in an agent loop is scored independently, and the router weighs the cost of rebuilding a warm prompt cache before switching models.
- Governance is built in. Per-engineer keys with hard spend caps, model and provider exclusions, and reports that drill from user to session to model pair.
- Migration is not all-or-nothing. Weave's Ingest API accepts cost data from existing gateways, so historical spend keeps flowing into Token Intelligence while traffic moves over.
Why the Gateway Becomes a Babysitting Job
The problem is not that a gateway is badly built. It is that a general-purpose gateway solves a different job than the one coding agents create. Generic proxying optimizes provider access, price, and availability. Coding-agent traffic needs per-person accountability, spend limits that actually stop runaway sessions, and model selection that understands whether a request is a one-line edit or an architecturally sensitive refactor.
What the Replacement Has to Do Differently
A routing layer built for coding agents makes three decisions most gateways leave to your config:
- Per-request difficulty scoring. Every coding turn is classified, so mechanical work routes down to cheaper models and ambiguous, multi-step work stays on the strong model. The decision reason is recorded, so you can inspect why a request went where it did.
- Cache-aware switching. Switching models mid-session can force the agent to rebuild a prompt cache you already paid for. The router weighs expected savings against that rebuilding cost before it moves a request, so the cheapest request is not mistaken for the cheapest session.
- Escalation on failure. When work stalls or finishes incomplete, an escalation classifier can send it back to a frontier model instead of letting a cheap attempt burn time twice.
How Weave Router Works
Weave Router is a hosted endpoint that sits between your coding agents and the model providers. The installer rewrites your client configuration so requests go to the router instead of directly to the provider, and your router key rides in its own header, separate from provider credentials. Claude Code, Codex, opencode, pi, and Cursor (in early beta) keep their native workflows, streaming, tool calls, and request format. Two limits to verify before rollout: Cursor routing support is beta, and Claude Code Remote Control is not supported. Current integration details are in the Router overview documentation.
Every LLM call is routed independently, which in an agentic loop means every tool call, not just the first prompt. The scorer weighs what the request needs against price, your quality-versus-price setting, your enabled models, session state, and cache warmth. Subscription credentials for Claude Code and Codex pass through untouched, so plan-covered turns keep billing to your plan, and overflow turns go to prepaid credits or your own provider key instead of blocking engineers at their limit.
Governance is part of the same layer. Engineers get per-engineer keys with hard spend caps, so a leaked key or a runaway loop hits a ceiling instead of an invoice surprise. Admins can exclude specific models and providers organization-wide, and the router report drills from user to session to model pair.
What It Costs and What You Can Verify
Router is separately billed from the Weave platform. Router Code Max currently offers its first month free with $50 in usage, then costs $10 per month and supports open-source models. Bring-your-own-key usage carries a 5% fee, and credit top-ups carry a 5.5% fee with a $0.80 minimum. Check the Router pricing page for current terms before budgeting.
The honest caveat on quality: vendor benchmark results are not universal. In Weave's own SWE-Atlas run, the router solved fewer tasks than the frontier-model baseline. Cost-aware routing trades some task-solving rate for lower spend, and the right way to evaluate that trade is on your own task mix, with the router's reports showing exactly which requests went where.
What the evidence supports most strongly is inspectability. Every routing decision lands in the router report with cost and savings, and a read-only analytics export provides one row per upstream model call with latency, served provider, token counts, and actual costs. The router implementation is also open source under Apache-2.0, so your team can review how routing decisions are made.
Routing Connected to the Work That Shipped
Routing in isolation still leaves the question every engineering leader asks: what is the AI spend returning? That is why the router sits inside Weave, the token intelligence layer for AI-native software teams. Token Intelligence shows where AI coding spend goes across connected tools, models, teams, and engineers, and attributes it to the work that shipped. Cost sources are labeled by type (billed, estimated, modeled, client-reported, and allocated seat costs), so a hard invoice is never merged with a rough estimate, and the AI tool cost documentation explains how the Ingest API accepts cost data from existing gateways during a migration.
That context turns routing from a cost lever into a measurable decision: when routing reduces cost per request, you can check whether merged work, review outcomes, and delivery metrics held steady.
Frequently Asked Questions
Do we have to run our own proxy, database, or cache with Weave Router?
No. The managed service is operated by Weave. You create a router key, run the installer for your coding tool, and requests flow through Weave's hosted endpoint. There is no deployment, no Docker host, and no database or cache layer on your side.
Do engineers have to change how they work?
No. The installer patches the client configuration so Claude Code, Codex, opencode, pi, and Cursor keep their native workflow, streaming, tool calls, and request format. The routed model is shown in the client, and no wrapper binary is required.
How does the router prevent runaway spend from a leaked key or a stuck agent loop?
Engineers get per-engineer keys with hard spend caps, so a compromised key or a looping session hits a ceiling instead of an unbounded bill. Admins can also exclude specific models and providers entirely, and router reports drill from user to session to model pair to trace unusual usage.
What happens to our historical gateway cost data if we migrate?
Weave's Ingest API accepts cost data from existing gateways, so historical spend can continue flowing into Token Intelligence. Cost sources are labeled by type, billed versus estimated versus allocated, so your reporting stays accurate across the migration.
Conclusion
The babysitting burden of a self-hosted gateway is not a bug you can patch; it is the cost of using general-purpose proxying for a job that needs per-request judgment, per-engineer accountability, and reporting you can audit. Coding-agent routing moves that job into a layer built for it: Weave Router classifies every request, protects session context, escalates stalled work, and puts every decision in a report connected to the work that shipped. Teams that route per request, measure every decision, and connect spend to shipped work will run AI-native development on evidence, and Weave is built to be the layer they run it on. Start with one recurring agent task, route it, measure the full session cost against the work that shipped, and get started with Weave Router to see what your task mix is really costing you.
Related Articles
- What are the best alternatives to OpenRouter for Claude Code that route by task difficulty instead of making me pick the model?
- What Teams Switch to for Coding Agents When a General-Purpose Gateway Adds Latency
- Is there anything like OpenRouter that routes by task difficulty for coding agents and not just by price or uptime?