DEV Community

Amit
Amit

Posted on Originally published at artificialcuriositylabs.ai

The Gateway Controls the Request. The Router Chooses the Model.

TL;DR

  • Model choice is moving from application configuration into the request path. The model that answers can now depend on task difficulty, price, latency, capacity, policy, geography, and provider health.
  • A gateway and a router are not the same component. The gateway controls access and enforces policy. The router decides which model or model tier should handle the request.
  • Products blur the distinction because many AI gateways bundle proxying, governance, routing, retries, caching, and observability behind one endpoint.
  • The most detailed first-party router disclosures come from coding assistants. Independent production evaluations remain scarce, while vendor-published gateway deployments are easier to find.
  • The core value is not “always pick the best model.” It is “use the least expensive path that still satisfies this request.”

The gateway controls the request. The router chooses the model.

That distinction explains both the growth of model routers and the confusion around them.

Model selection used to happen when an application was designed. A team picked one provider, placed one model ID in configuration, and sent every request to it. That works while one model is the obvious default and each user action produces one model call.

Neither condition holds anymore.

Model catalogs now contain hundreds of general, reasoning, multimodal, open-weight, and specialized choices. Agent systems turn one user request into planning, classification, retrieval, tool selection, execution, verification, and synthesis calls. Provider capacity, latency, prices, and model availability keep changing underneath them.

The thesis: model choice is becoming a runtime decision.

The router is the mechanism that makes that decision. The gateway is the control boundary around it.

Five Components Are Hiding Behind One Endpoint

The market uses “AI gateway,” “model router,” “proxy,” and “load balancer” as if they were interchangeable. They are not.

Component The decision it makes Primary responsibility
API proxy How does this request reach the upstream API? Protocol translation and request forwarding
AI gateway May this request pass, and under what controls? Authentication, quotas, policy, logging, guardrails, budgets
Model router Which model should answer this request? Selection by task, quality, cost, latency, policy, or availability
Load balancer Which eligible serving endpoint or replica of the selected model should execute it? Health, queue, cache, and deployment selection
Inference platform Where and how does the model run? Model loading, accelerator allocation, batching, and token execution

The clean request path looks like this:

flowchart LR
    A[Application or agent] --> G[AI gateway]
    G --> P[API proxy or protocol adapter]
    P --> R[Model router]
    R --> L[Endpoint or replica selection]
    L --> I[Inference platform]

    G -.-> GP[Identity, quotas, policy, logs]
    R -.-> RP[Quality, cost, latency, capability]
    L -.-> LP[Health, load, region, cache state]
    I -.-> IP[Models, accelerators, batching]

The boundaries are architectural. Products are bundles.

LiteLLM combines an OpenAI-compatible proxy with budgets, rate limits, retries, fallbacks, and load balancing. Kong AI Gateway adds AI-specific traffic and governance functions to an API gateway, while its model-based routing pattern analyzes prompt complexity before choosing a provider. Envoy AI Gateway can connect to an Endpoint Picker that uses live serving metrics such as key-value cache state to choose an upstream target.

Those products can perform routing, but that does not make every gateway function a routing function.

Authentication and logging are gateway work. Caching is often implemented at the gateway or serving layer. Choosing a cheaper model for a simple request is router work. Choosing one healthy replica of that model is load-balancer work.

A single endpoint can hide all five responsibilities.

Why Routing Is Growing Now

The first driver is not model count by itself. It is model divergence.

Models differ in reasoning depth, context window, tool use, modality, latency, price, safety behavior, regional availability, and deployment options. A leaderboard can order them on one score. A production request arrives with several constraints at once.

The second driver is economic. The RouteLLM research studied routing between stronger, expensive models and weaker, cheaper ones. On MT-Bench, one configuration retained 95% of GPT-4 quality with an estimated 3.66× cost saving. The result does not transfer automatically to every workload, but it proves the mechanism: many requests do not need the most expensive eligible model.

This is the runtime extension of the right model for the right job. That earlier pattern assigns model tiers to known pipeline steps. A router makes the assignment while traffic is moving. The Pareto frontier creates the rational candidate list; the router turns that list into policy.

The third driver is agents.

Anthropic’s agent architecture guidance describes workflows built from routing, parallelization, orchestrator-worker patterns, and evaluator loops. Each pattern creates model calls with different requirements. The classifier does not need the same model as the final reviewer. A tool-selection step does not need the same reasoning budget as an ambiguous architecture decision.

Routing one chatbot turn saves once. Routing an agent loop can save at every stage.

The fourth driver is infrastructure volatility. A request may need a different route because a provider is throttled, a region is congested, a model is unavailable, or data must remain inside an approved geography. Cloudflare AI Gateway exposes conditional model selection, quotas, retries, and fallbacks as a versioned route. Amazon Bedrock Intelligent Prompt Routing predicts response quality within a model family and routes through one serverless endpoint. Microsoft Foundry Model Router selects among underlying models while applying the deployment’s regional and policy constraints.

“Pick the smartest model” is not enough. The runtime question is:

Which eligible model path can satisfy this request at the required quality, cost, latency, and policy boundary?

How Routers Are Actually Being Used

The most detailed first-party implementation disclosures come from coding assistants.

Cursor Router uses the current turn, recent conversation state, task category, tool calls, and production performance data to choose a model. It is learned complexity- and task-based model routing rather than only a static fallback list.

GitHub Copilot Auto routes based on request complexity, real-time model availability, user plan, and administrator policy. The selected model remains visible, and the available pool changes over time.

These products have the right workload shape for routing. Coding sessions contain quick questions, repository searches, edits, debugging, long-context reviews, and autonomous tool loops. Sending every step to one model leaves either quality or money on the table.

Outside coding tools, vendor-published deployment examples skew toward gateway-centered routing:

Deployment What the control layer does Router or gateway value?
SiteGPT on Portkey Switches among 13+ production models and handles rate limits; Portkey reports that SiteGPT processed six billion tokens Both: model flexibility plus gateway reliability
Fontys ICT Enforces access, budgets, and processing-location rules across commercial, EU-hosted, and self-hosted models Primarily gateway and policy routing
RightBlogger on Cloudflare Caches about 10% of model requests, cuts reported OpenAI cost by 10%, and provides request logs Gateway value, not semantic model selection
Cloudflare dynamic routes Chooses models using conditions, quotas, retries, and fallbacks without application-code changes Rules-based routing inside a gateway

This split matters.

A product can create substantial value without predicting the best model for every prompt. Centralized logging, quotas, caching, provider failover, and policy enforcement solve production problems before a learned router enters the path.

The public evidence for standalone semantic routers used by named enterprise customers is thinner. There are many router papers, repositories, and vendor claims. There are fewer independent accounts showing a router’s decisions against live traffic, failures, tool calls, and business outcomes.

There is also a split inside the router category. Managed general-purpose routers learn broad task patterns across a predefined model pool. Product-specific routers can learn from one application’s traffic and evaluation signals. Cursor describes training against product traffic, while Amazon Bedrock states that its router cannot adapt from application-specific performance data. The feedback loop may become more defensible than the initial selection algorithm.

The Core Value Is Policy, Not Magic

The weak router pitch is “we always select the best model.”

There is no best model independent of the request, candidate pool, price snapshot, latency target, provider state, and evaluation method. A router cannot choose a model it was not configured to consider. It cannot optimize an outcome it does not measure.

The stronger value proposition is:

Move model selection out of application code and into a measured policy layer.

That creates value across the control layer:

Value Primary owner
Spend frontier-model money only where it changes the outcome Router
Match vision, long-context, reasoning, coding, or tool-heavy work to eligible models Router
Retry or fail over when a provider, deployment, or region cannot serve the request Gateway and load balancer
Restrict traffic by tenant, geography, sensitivity, budget, or approved provider Gateway and policy engine
Change the model pool and selection policy without rewriting every application Gateway contract plus router

The final point needs care. A stable gateway API reduces application coupling, but switching models is not free. Tool schemas, prompts, safety behavior, token accounting, and session state can differ. A router can reduce provider lock-in while creating router-specific configuration and operational dependencies.

Benchmarks Are Catching Up to the Products

Router evaluation is becoming a field of its own.

RouterBench assembled more than 405,000 stored inference outcomes. That makes routing policies inexpensive to replay, but it cannot reproduce live provider latency, outages, throttling, or model updates.

RouterArena uses 8,400 queries across nine domains and 44 categories. It evaluates answer accuracy, cost, routing optimality, robustness, and routing latency. Its central finding is more useful than any single leaderboard position: no router leads across every metric.

The vLLM “When to Reason” study shows what a bounded routing claim looks like. On MMLU-Pro, selectively enabling reasoning improved accuracy by 10.2 percentage points while cutting latency by 47.1% and token use by 48.5%. That is evidence for deciding when reasoning is useful on that benchmark. It is not evidence that one router will select the best coding model, preserve a tool loop, or recover from a provider outage.

A router needs to beat more than “send everything to the premium model.”

The useful baseline set is:

Baseline What it proves
Best fixed model The quality ceiling for the candidate pool
Cheapest fixed model The cost floor
Random routing Whether selection adds intelligence
Deterministic rules Whether a learned router beats simple categories or thresholds
Learned router The proposed policy
Oracle router The theoretical ceiling after seeing every model’s result

Then measure quality, cost per successful task, end-to-end latency, failure recovery, policy violations, and decision trace completeness.

One blended score can hide the result that matters. A router may rank higher because it is cheaper while producing worse answers. Another may improve quality but add too much latency to sit in an interactive request path. The complete cost-quality-latency frontier is the product.

The selector itself also has a cost. Kong’s model-based routing example invokes a model to classify prompt complexity before selecting the downstream provider. That extra call adds tokens, latency, and another failure point. Router evaluation needs to include the selector’s cost and failure behavior, not only the savings after selection.

What Is Still Missing

The router market has more implementations than production evidence.

Single-turn benchmarks do not capture active tool loops, provider-specific state, prompt caching, or conversation continuity. A router can make the correct task-level choice and still break the application by switching models halfway through a workflow.

Resilience claims also need failure injection. A fallback feature is not the same as a measured recovery path. The evidence should show recovery time, duplicate requests, lost tool results, extra cost, and whether the final answer still satisfies the task.

Routing transparency remains uneven. Some products expose the selected model and reason. Others return one virtual model name while hiding the path. That abstraction is convenient until a quality regression, cost spike, safety refusal, or provider change needs an explanation.

Session-aware routing for agent and tool workflows needs continuity state or affinity, not classification alone. It must know when a session can move, when it is pinned to a provider, and which state cannot travel safely.

So What

The model router is not replacing the AI gateway. It is becoming the decision engine inside or behind it.

The gateway owns the boundary: identity, policy, quotas, logs, and the stable application contract. The router owns the choice: which eligible model path should answer this request. The load balancer owns the final placement. The inference platform owns execution.

That separation turns a crowded product landscape into a clearer architecture.

The market is growing because the decision moved. Model selection is no longer a configuration line written once. It is a policy evaluated continuously against changing requests, models, prices, capacity, and constraints.

The open thread is whether independent model routers become a durable product category. Gateways, coding platforms, cloud providers, and inference engines are all absorbing routing functions. The routing algorithm may matter enormously while the standalone router disappears into the control plane.

Top comments (0)