Skip to main content
Version: Latest (main)

System Overview

Semantic Router sits between agent harnesses and your models. It applies a policy to every model call, selects one model or coordinates several, and forwards the request to the chosen backend.

  • Data plane. A frontend accepts the request, the Router decides, the model runtime answers the Router's own questions, and chat backends generate the answer.
  • Control plane. One canonical YAML file, managed with the CLI, the Dashboard, Helm or the Operator.
  • Two ways in. The Router serves its own listeners by default, or runs behind an Envoy-based gateway through ExtProc.

Architecture​

Frontend, optional decision engine, model runtime, and Chat backends

Component Architecture covers the protocol path, the model runtime's replicas and Engine mode.

Data plane​

ComponentWhat it owns
Agent harnessThe task loop, tool execution and task state. Each model call crosses the Router; the response returns to the harness for the next step.
FrontendListeners, access control and protocol adaptation. With --gateway extproc, an external gateway owns ingress and calls the Router through ExtProc.
Semantic RouterSignals, policy, route behavior, and the selection or coordination of models.
Model runtimeThe Router's own models: the decision model, and the embedding model when a recall feature needs it. Workers can be managed or attached.
Chat backendsGeneration. vLLM, Ollama or hosted providers own the weights and capacity.

Control plane​

ToolUse it to
Canonical YAMLDescribe routing behavior in one portable file.
CLI and DashboardSet up, validate, discover models, configure and operate.
Helm and the OperatorDeploy the Router into Kubernetes.
Evaluation and observabilitySee route outcomes, test policy and improve it.

Core objects​

ObjectPurpose
EntrypointMaps one or more public model names to a recipe.
RecipeA complete routing policy, with its own isolated runtime state.
SignalA named fact about the request, identity, conversation or content.
ProjectionA reusable score, partition or band derived from signals.
DecisionA rule that picks an eligible route and its candidate models.
AlgorithmHow the decision selects or coordinates its candidates.
PluginRoute-specific behavior, such as request controls, retrieval, memory or response handling.
Provider modelA physical inference endpoint that recipes can route to.

These objects let you reuse detection across policies, change policy apart from model selection, and evolve the pool behind a stable public name.

Request lifecycle​

  1. A harness sends a request using OpenAI Chat Completions, OpenAI Responses, Anthropic Messages or the OpenAI Images API.
  2. The standalone frontend, or an ExtProc gateway, presents it to the Router. With ExtProc, Envoy forwards the request; without ExtProc, the standalone frontend presents it directly.
  3. The requested model resolves to an entrypoint and its recipe.
  4. The Router evaluates the recipe's signals and computes its projections. Heuristic signals run in code; model-judged signals go to the decision model in one call.
  5. Decisions enforce constraints and choose an eligible candidate set.
  6. The decision's algorithm selects one model, or runs a bounded multi-model strategy.
  7. Plugins run at their request, execution or response hook.
  8. The frontend's upstream client, or the external gateway, sends the provider-shaped request to the selected backend and returns the normalized response.

Two cases skip part of this path:

  • Direct selection. An operator can expose physical model names for direct selection. Those requests skip recipe signals, decisions, plugins, cache, learning and session routing.
  • No match. If no decision in the recipe matches, the request goes to the configured default provider model.
The harness keeps its tools

The lifecycle covers one model call inside the harness's task loop. Plugins can filter the tools a model sees, but the harness and its tool services still execute and authorize tools.

Protocol and deployment boundaries​

The Router serves its own listeners by default, or integrates with an external gateway through ExtProc; Gateway Modes compares the two. The same policy runs in Docker, Kubernetes and hybrid environments.

The Router chooses a model; it does not replace a backend's scheduler. When an AI gateway also fronts the stack, a request crosses three routing layers:

agent harness
-> AI Gateway (e.g. Agent Router / LiteLLM / agentgateway)
-> Semantic Router ExtProc
-> Inference Router / pool scheduler (e.g. llm-d / vLLM Router / AIBrix gateway)
-> model replica
LayerWhat it ownsExamples
AI GatewayClient ingress, provider translation, credentials, rate limits and traffic policy.Agent Router (formerly Envoy AI Gateway), LiteLLM, agentgateway
Semantic RouterThe model or model pool for the request's intent and policy, chosen through recipes and decisions. The gateway routes on x-vsr-route-model.vLLM Semantic Router
Inference RouterA healthy replica or endpoint inside the selected pool.llm-d, vLLM Router, AIBrix gateway

Kubernetes Gateways and Inference Platforms list the integrations this project maintains.

Client and backend formats can differ

A client can call one API while the backend speaks another. See Protocol Compatibility for the supported pairs.

Next​