Routing & Gateways
10 toolsDecides which model answers, and what it costs.
- LiteLLMlibrary
OpenAI-format proxy translating across 100+ model providers.
- Portkeyplatform
AI gateway with routing, caching and guardrails in one layer.
- Cloudflare AI Gatewayservice
Edge gateway adding caching, retries and rate limiting.
- OpenRouterservice
Single API key and billing across many hosted models.
- Martianplatform
Model router that optimizes for quality, cost and latency.
- Envoy AI Gatewayruntime
CNCF-track gateway for LLM traffic on an Envoy data plane.
- Bifrostlibrary
High-throughput LLM gateway with drop-in OpenAI compatibility.
- RouteLLMlibrary
Learned router that cuts cost by matching difficulty to model size.
- Not Diamondplatform
Routing and prompt optimisation tuned on your own traffic.
- TrueFoundryplatform
Gateway plus observability and guardrails as one deployment.
By Kunj ShahLayer boundaries and entries verifiedmethod
Also relevant here
These tools are indexed in another layer, but they also do routing & gateways's job. Each carries its home layer's colour.
Rules of thumb
- Route on measured quality, not on price alone. A cheaper model that fails your eval set is not cheaper.
- A gateway is in the request path, so it adds latency to every call. Measure that overhead before you add policy to it.
- Fallbacks that switch models silently change your output. Log which model answered every request, or you cannot debug quality.
Quick answers
- Why put a gateway in front of model providers?
- To get one endpoint, one key store and one place for policy: retries, fallbacks, rate limits, budgets and logging. It lets you change providers without changing application code.
- When is a gateway not worth it?
- When you call one provider with one model and have no budget or fallback policy. A thin client library is enough until a second provider or a spend limit forces the issue.
- Does routing to cheaper models save money?
- Only if the cheaper model passes the same eval set. Routing without an eval trades a visible cost for an invisible quality regression.
Ask an AI about this page
Opens the assistant with this page’s link and a question already filled in.