<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://liuxunzhuo.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://liuxunzhuo.com/" rel="alternate" type="text/html" /><updated>2026-06-25T09:08:09+00:00</updated><id>https://liuxunzhuo.com/feed.xml</id><title type="html">Xunzhuo Liu</title><subtitle>It`s just a good thinking game</subtitle><entry><title type="html">The Philosophy of vLLM SR</title><link href="https://liuxunzhuo.com/the-philosophy-of-vllm-sr/" rel="alternate" type="text/html" title="The Philosophy of vLLM SR" /><published>2026-06-25T00:00:00+00:00</published><updated>2026-06-25T00:00:00+00:00</updated><id>https://liuxunzhuo.com/the-philosophy-of-vllm-sr</id><content type="html" xml:base="https://liuxunzhuo.com/the-philosophy-of-vllm-sr/"><![CDATA[<p>The easiest way to misunderstand vLLM Semantic Router is to start from the word <em>router</em>.</p>

<p>In a traditional gateway, routing is a forwarding problem. A request arrives, the gateway evaluates policy, picks a backend cluster, and sends the request there. The backend is usually a deterministic service. If it is healthy, the request succeeds. If it fails, the gateway retries, fails over, or returns an error.</p>

<p>LLM systems break that mental model.</p>

<p>The backend is no longer just a service. It is a probabilistic reasoning system. It may need tools. It may need memory. It may need retrieval. It may hallucinate. It may require a verifier. It may run on a GPU pool whose KV cache is warm for one session and cold for another. It may be cheap for short requests and expensive for long-context ones. It may be allowed for one tenant and forbidden for another.</p>

<p>A request is no longer only traffic. It is semantic work.</p>

<blockquote>
  <p>Routing is the moment where semantic intent becomes infrastructure placement.</p>
</blockquote>

<p>That is the starting point of vLLM SR.</p>

<p>The project is not trying to build a prettier model selector. The deeper idea is to turn every LLM request into an <strong>explainable capability path</strong>: which evidence was observed, which derived facts were produced, which policy matched, which selection or collaboration algorithm ran, which plugins were attached, which backend and hardware path was used, and what trace was left behind.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-intelligence-control-plane.png" alt="Request flows into signals, projections, decisions, and actions including model, verify, and tools." />
  <figcaption>The output of vLLM SR is not just a model name. It is a governed capability path.</figcaption>
</figure>

<p>I want to walk through that design as a system, not as a feature list. We will keep one running example in view, then open the layers one by one: signals, projections, decisions, selection algorithms, looper algorithms, router memory and learning, plugins, Envoy integration, model design, native bindings, hardware support, observability, and evaluation.</p>

<h2 id="a-request-walks-into-the-router">A Request Walks Into the Router</h2>

<p>Imagine an enterprise AI gateway receives this request:</p>

<blockquote>
  <p>Analyze this customer contract, compare it with our internal policy, and draft a response. It may contain personal information. Use tools if needed.</p>
</blockquote>

<p>If we look only at surface text, this is a contract-analysis request. If we look only at token count, it may be a long-context request. If we look at risk, it touches PII, internal policy, tool access, and factual correctness. If we look at infrastructure, it depends on tenant permissions, pool health, cache warmth, context-window capacity, and model cost.</p>

<p>A naive model picker asks one question:</p>

<blockquote>
  <p>Which model should answer this prompt?</p>
</blockquote>

<p>vLLM SR asks a better question:</p>

<blockquote>
  <p>What must the system know before it is allowed to spend intelligence?</p>
</blockquote>

<div class="mermaid">
flowchart LR
  A["Request<br />contract + policy + PII"] --&gt; B["Signals<br />observe evidence"]
  B --&gt; C["Projections<br />derive routing facts"]
  C --&gt; D["Decisions<br />match policy"]
  D --&gt; E["Selection Algorithms<br />choose one model"]
  D --&gt; L["Looper Algorithms<br />choose collaboration path"]
  E --&gt; M["Router Learning<br />adapt + protect"]
  L --&gt; M
  M --&gt; F["Plugins<br />attach behavior"]
  F --&gt; G["Gateway / Backend<br />execute"]
  G --&gt; H["Trace / Replay<br />learn"]
</div>

<p>The split is intentional. Each layer owns a different kind of reasoning.</p>

<table>
  <thead>
    <tr>
      <th>Layer</th>
      <th>It owns</th>
      <th>It should not own</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Signals</td>
      <td>Observing facts about the request, user, session, content, and environment</td>
      <td>Final policy or model choice</td>
    </tr>
    <tr>
      <td>Projections</td>
      <td>Turning noisy evidence into stable routing facts</td>
      <td>Gateway mutation or backend calls</td>
    </tr>
    <tr>
      <td>Decisions</td>
      <td>Expressing auditable route policy</td>
      <td>Low-level selection or collaboration execution</td>
    </tr>
    <tr>
      <td>Selection algorithms</td>
      <td>Choosing one model from a policy-approved candidate set</td>
      <td>Rewriting route eligibility</td>
    </tr>
    <tr>
      <td>Looper algorithms</td>
      <td>Selecting and running a multi-model collaboration path</td>
      <td>Pretending to be a single-model selector</td>
    </tr>
    <tr>
      <td>Router Learning</td>
      <td>Adapting model choice and protecting session continuity after base selection</td>
      <td>Mutating recipe policy on the request path</td>
    </tr>
    <tr>
      <td>Plugins</td>
      <td>Route-scoped behavior such as cache, RAG, memory, tools, verification, replay</td>
      <td>Global hidden middleware</td>
    </tr>
    <tr>
      <td>Bindings</td>
      <td>Fast native ML paths for hot routing components</td>
      <td>Policy semantics</td>
    </tr>
    <tr>
      <td>Gateway integration</td>
      <td>Putting semantic policy at the network boundary</td>
      <td>Replacing the gateway data plane</td>
    </tr>
  </tbody>
</table>

<p><strong>The core design choice is separation of concerns.</strong> If a request goes to a frontier model with RAG, tool filtering, and a response verifier, the answer should not be “because the router said so.” The router should be able to show the chain: evidence, projection, policy, algorithm, learning decision, plugins, mutations, backend path, and replay id.</p>

<h2 id="the-full-request-lifecycle">The Full Request Lifecycle</h2>

<p>For the contract request, the router first extracts request context: body, headers, tenant identity, session id, conversation id, tool state, prior response markers, and any existing routing metadata.</p>

<p>It then runs only the signals referenced by the active recipe. Domain, PII, context length, authorization, knowledge-base relevance, fact-check need, tool availability, and jailbreak or prompt-injection signals can run independently. The point is not to run every detector on every request; the point is to gather the evidence that the configured policy actually needs.</p>

<p>Projections then compose that evidence into stable route facts: <code class="language-plaintext highlighter-rouge">privacy_sensitive</code>, <code class="language-plaintext highlighter-rouge">legal_contract_path</code>, <code class="language-plaintext highlighter-rouge">long_context</code>, <code class="language-plaintext highlighter-rouge">needs_internal_rag</code>, and <code class="language-plaintext highlighter-rouge">verification_required</code>. The decision engine matches those facts against route policy. A matched decision exposes candidate models and, depending on its algorithm, either a single-model selection path or a looper collaboration path. Router Learning may then adjust the proposed model or hold the current model if switching would break session continuity. Finally, plugins attach route-scoped behavior before the gateway executes the main traffic path.</p>

<div class="mermaid">
flowchart LR
  C["Client request"] --&gt; E["Envoy / Gateway<br />headers + body"]
  E --&gt; R["vLLM SR<br />request context"]
  R --&gt; S["Signals<br />run required evidence"]
  S --&gt; P["Projections<br />derive route facts"]
  P --&gt; D["Decisions<br />match policy"]
  D --&gt; A{"Execution mode"}
  A -- "single model" --&gt; M["Selector"]
  A -- "collaboration" --&gt; L["Looper"]
  M --&gt; G["Router Learning<br />adapt + protect"]
  L --&gt; G
  G --&gt; X["Plugins<br />cache, RAG, tools, safety"]
  X --&gt; B["Backend pool<br />or looper call"]
  B --&gt; T["Trace / replay<br />response checks"]
</div>

<p>The model name is only the visible end of the route. The deeper value is that the system can explain why this was not a cheap direct-answer path. Privacy, internal knowledge, tool exposure, factuality, and context pressure are different concerns. vLLM SR gives each concern a place in the architecture.</p>

<h2 id="the-recipe-is-the-system-contract">The Recipe Is the System Contract</h2>

<p>The next design step is easy to miss: vLLM SR is not primarily configured as a collection of ad hoc callbacks. It is configured as a recipe. That recipe is the contract between application intent, routing policy, backend inventory, plugin behavior, learning boundaries, and gateway mutation.</p>

<p>In production, routing policy tends to spread. One part lands in application code, one part in gateway config, one part in prompt templates, one part in a model registry, one part in a dashboard, and one part in a notebook used by the evaluation team. Once that happens, nobody can answer a simple operational question: “Why did this request take this path?”</p>

<p>vLLM SR’s v0.3-style contract tries to keep that answer in one durable shape.</p>

<div class="mermaid">
flowchart LR
  A["Recipe<br />RouterConfig"] --&gt; B["Evidence contract<br />signals"]
  B --&gt; C["Fact contract<br />projections"]
  C --&gt; D["Policy contract<br />decisions"]
  D --&gt; E["Execution contract<br />modelRefs, algorithm, plugins, adaptations"]
  E --&gt; F["Runtime contract<br />backend models, provider profiles, router options"]
</div>

<table>
  <thead>
    <tr>
      <th>Contract surface</th>
      <th>What it owns</th>
      <th>Why it belongs in the recipe</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Global runtime</td>
      <td>Semantic cache, memory, replay, learning, observability, API listeners, startup behavior</td>
      <td>These features are infrastructure state, not per-request improvisation</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">routing.signals</code></td>
      <td>The evidence families that are allowed to run</td>
      <td>A decision should only depend on named, reviewable evidence</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">routing.projections</code></td>
      <td>Partitions, scores, and mappings derived from signals</td>
      <td>Policy should consume stable facts, not raw detector noise</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">routing.decisions</code></td>
      <td>Named route policies with priority, tier, rules, output contract, modelRefs, algorithms, adaptations, plugins, and emits</td>
      <td>A route is an auditable capability bundle</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">decision.modelRefs</code></td>
      <td>The approved candidate boundary for a decision</td>
      <td>Selection and learning cannot escape policy by discovering a better-looking model elsewhere</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">decision.algorithm</code></td>
      <td>The execution strategy inside the matched decision</td>
      <td>The recipe distinguishes one-model selection from collaboration paths such as Fusion or Flow</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">decision.plugins</code></td>
      <td>Cache, memory, RAG, tools, prompt mutation, response checks, replay, image generation, or fast response</td>
      <td>Behavior follows the matched route instead of hiding in global middleware</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">decision.adaptations</code></td>
      <td>Apply, observe, or bypass learning for this policy</td>
      <td>Sensitive routes can be protected from online exploration</td>
    </tr>
    <tr>
      <td>Backend models</td>
      <td>Provider profiles, vLLM endpoints, image backends, model metadata, aliases, default model</td>
      <td>Logical routing must resolve to real serving pools and provider contracts</td>
    </tr>
    <tr>
      <td>Router options</td>
      <td>Auto model names, body streaming mode, route-cache clearing, skip-processing controls</td>
      <td>Gateway behavior and compatibility are explicit operational choices</td>
    </tr>
  </tbody>
</table>

<p>That is the operational difference between a router that happens to make good choices and a router that can be trusted. A recipe is diffable. It can be validated. It can be replayed against stored traffic. It can be promoted across environments. It can be patched by offline learning without letting the hot path rewrite production policy.</p>

<p>The rule is conservative on purpose: <strong>runtime intelligence may propose better choices, but the recipe defines the legal search space</strong>. That is what keeps “adaptive routing” from becoming hidden policy mutation.</p>

<h2 id="research-as-design-pressure">Research as Design Pressure</h2>

<p>The paper shelf behind vLLM SR is not a citation dump. Each research direction creates pressure on one part of the router. Read the table as a map from problem to architecture.</p>

<table>
  <thead>
    <tr>
      <th>Work</th>
      <th>Problem</th>
      <th>Core idea</th>
      <th>Architectural pressure</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>vLLM Semantic Router: Signal Driven Decision Routing</td>
      <td>Single-classification routing cannot express cost, privacy, latency, safety, and multimodal constraints together</td>
      <td>Compose heterogeneous signals into route decisions and route-scoped behavior</td>
      <td>Establishes signals, projections, decisions, algorithms, and plugins as separate layers</td>
    </tr>
    <tr>
      <td>Workload-Router-Pool</td>
      <td>Routing papers often ignore serving pools, while fleet papers often ignore workload semantics</td>
      <td>Close the loop among workload evidence, router policy, and physical pool state</td>
      <td>Makes queue, cache, hardware, and pool feedback routing inputs</td>
    </tr>
    <tr>
      <td>When to Reason</td>
      <td>Reasoning models are expensive and not always useful</td>
      <td>Detect reasoning need and apply reasoning only when beneficial</td>
      <td>Creates complexity signals, reasoning policy, and model-card reasoning capability</td>
    </tr>
    <tr>
      <td>Category-Aware Semantic Caching</td>
      <td>One similarity threshold is unsafe across heterogeneous workloads</td>
      <td>Cache thresholds, TTLs, and quotas vary by category</td>
      <td>Makes semantic cache a route-scoped plugin, not a global middleware</td>
    </tr>
    <tr>
      <td>Outcome-Aware Tool Selection</td>
      <td>Tool selection cannot rely only on semantic similarity</td>
      <td>Refine tool embeddings offline using outcome evidence under latency budgets</td>
      <td>Connects tool signals, tool-selection plugins, and replay/outcome data</td>
    </tr>
    <tr>
      <td>98x Faster Routing Without Dedicated GPU</td>
      <td>A hot-path router cannot take seconds to route</td>
      <td>Use prompt compression, Flash Attention, and near-streaming body processing</td>
      <td>Pushes native bindings and fast signal runtime</td>
    </tr>
    <tr>
      <td>Adaptive VLM Routing</td>
      <td>Multimodal computer-use steps have very different difficulty</td>
      <td>Estimate visual/action difficulty and route cheap or strong VLMs accordingly</td>
      <td>Adds modality, visual difficulty, and multimodal safety signals</td>
    </tr>
    <tr>
      <td>Visual Confused Deputy</td>
      <td>Computer-use agents can be attacked through visual perception failures</td>
      <td>Check click target and action reasoning independently</td>
      <td>Pulls visual safety and action-boundary validation into routing</td>
    </tr>
    <tr>
      <td>Knowledge Access Beats Model Size</td>
      <td>Correct knowledge access can beat a larger model</td>
      <td>Use memory and retrieval-grounded routing to recover quality with smaller models</td>
      <td>Promotes RAG, memory, KB signals, and knowledge paths to first-class capabilities</td>
    </tr>
    <tr>
      <td>Fast and Faithful RAG Verification</td>
      <td>Retrieval does not guarantee faithful answers</td>
      <td>Verify long-document RAG responses in real time</td>
      <td>Motivates hallucination and response-verification plugins</td>
    </tr>
    <tr>
      <td>inference-fleet-sim</td>
      <td>Model choice depends on queueing, TTFT, and fleet capacity</td>
      <td>Use queueing-grounded simulation for multi-pool planning</td>
      <td>Connects router policy to fleet simulation</td>
    </tr>
    <tr>
      <td>FleetOpt</td>
      <td>Minimum-cost pools depend on workload CDF and P99 targets</td>
      <td>Derive pool boundaries and deploy them through compress-and-route</td>
      <td>Connects token budget, pool boundary, and cost-aware routing</td>
    </tr>
    <tr>
      <td>1/W Law</td>
      <td>Context window size changes energy efficiency and memory pressure</td>
      <td>Analyze context-length routing topology and tokens-per-watt</td>
      <td>Makes context routing and long-context pools central</td>
    </tr>
    <tr>
      <td>Conflict-Free Policy Languages</td>
      <td>Probabilistic ML predicates can co-fire silently</td>
      <td>Detect and prevent policy conflicts in the DSL</td>
      <td>Motivates declarative decisions, priority, confidence, and auditability</td>
    </tr>
    <tr>
      <td>Cross-Layer Policy Compilation</td>
      <td>Policy should not live as scattered gateway, workflow, K8s, and agent code</td>
      <td>Compile one declarative source into multiple execution layers</td>
      <td>Points toward policy-as-code and cross-layer verification</td>
    </tr>
    <tr>
      <td>Token-Budget-Aware Pool Routing</td>
      <td>Token budget affects KV cache, pool choice, and failure risk</td>
      <td>Estimate total token budget and route to short or long pools</td>
      <td>Connects context, bytes-per-token, pools, and failure avoidance</td>
    </tr>
    <tr>
      <td>SIRP and Multi-Provider API</td>
      <td>Semantic routing should not require private application protocols</td>
      <td>Standardize semantic inference routing and multi-provider surfaces</td>
      <td>Reinforces OpenAI-compatible, gateway-compatible control planes</td>
    </tr>
  </tbody>
</table>

<p>The pressure from the research shelf is clear: a router cannot be one classifier. If it were, every new paper would become another special case. In vLLM SR, a paper can become a signal, projection, decision primitive, selection algorithm, looper algorithm, plugin, learning signal, model-card field, or pool feedback loop.</p>

<h2 id="signals-evidence-before-judgment">Signals: Evidence Before Judgment</h2>

<p>Signals are deliberately humble. A signal answers one factual question. It does not choose the model. It does not select a plugin. It does not decide the route.</p>

<p>For the contract example, the router may need to know whether the request is legal or enterprise-related, whether it contains PII, whether the user is authorized for premium or private models, whether it needs internal knowledge, whether tools are available, whether the context is too large for a short-context backend, and whether the response needs verification.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-signals.png" alt="Request fan-out to Keyword, Context, Authz, Domain, PII, Jailbreak, Modality, Feedback, and Signal Results." />
  <figcaption>Signals are sensors, not policy. They produce reusable evidence.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Signal family</th>
      <th>What it observes</th>
      <th>Why it matters</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Keyword and lexical</td>
      <td>Explicit words, regex, BM25, n-grams, fuzzy anchors</td>
      <td>Fast deterministic anchors for compliance, product names, incidents, and explicit task classes</td>
    </tr>
    <tr>
      <td>Context and structure</td>
      <td>Token count, context pressure, prompt shape, JSON/schema/workflow form</td>
      <td>Separates short direct paths from long-context, compression, and workflow paths</td>
    </tr>
    <tr>
      <td>Authz and tenant</td>
      <td>User identity, groups, role bindings, tiers, allowlists</td>
      <td>Prevents silent access to premium, private, tenant-specific, or sensitive paths</td>
    </tr>
    <tr>
      <td>Conversation and session</td>
      <td>Turn count, tool calls, tool results, active loop state, previous response markers</td>
      <td>Protects continuity and avoids switching during non-portable state</td>
    </tr>
    <tr>
      <td>Domain and KB</td>
      <td>Task domain, internal knowledge source, KB relevance</td>
      <td>Chooses domain models, RAG sources, and policy constraints</td>
    </tr>
    <tr>
      <td>Embedding and preference</td>
      <td>Semantic similarity, user/task preference, model-description fit</td>
      <td>Handles soft semantic routing where exact keywords are insufficient</td>
    </tr>
    <tr>
      <td>Complexity and repair</td>
      <td>Difficulty, uncertainty, repeated dissatisfaction, retry and repair signals</td>
      <td>Drives reasoning activation, escalation, and learning</td>
    </tr>
    <tr>
      <td>Fact-check and safety</td>
      <td>Factuality need, jailbreak, prompt injection, PII, response risk</td>
      <td>Triggers RAG, verifier, guardrail, local/private route, or block path</td>
    </tr>
    <tr>
      <td>Modality and event</td>
      <td>Text, image, image-generation intent, SRE/SOC event shape</td>
      <td>Routes to VLM, image, operational, or event-specific paths</td>
    </tr>
  </tbody>
</table>

<p>The maintained runtime surface currently exposes eighteen base signal families: <code class="language-plaintext highlighter-rouge">authz</code>, <code class="language-plaintext highlighter-rouge">complexity</code>, <code class="language-plaintext highlighter-rouge">context</code>, <code class="language-plaintext highlighter-rouge">conversation</code>, <code class="language-plaintext highlighter-rouge">domain</code>, <code class="language-plaintext highlighter-rouge">embedding</code>, <code class="language-plaintext highlighter-rouge">fact_check</code>, <code class="language-plaintext highlighter-rouge">jailbreak</code>, <code class="language-plaintext highlighter-rouge">keyword</code>, <code class="language-plaintext highlighter-rouge">language</code>, <code class="language-plaintext highlighter-rouge">modality</code>, <code class="language-plaintext highlighter-rouge">pii</code>, <code class="language-plaintext highlighter-rouge">preference</code>, <code class="language-plaintext highlighter-rouge">reask</code>, <code class="language-plaintext highlighter-rouge">structure</code>, <code class="language-plaintext highlighter-rouge">kb</code>, <code class="language-plaintext highlighter-rouge">user_feedback</code>, and <code class="language-plaintext highlighter-rouge">event</code>. <code class="language-plaintext highlighter-rouge">projection</code> is also a rule condition type, but it is not a raw sensor. It is the decision-visible output of the projection layer.</p>

<p>The runtime behavior is as important as the list of names.</p>

<table>
  <thead>
    <tr>
      <th>Runtime behavior</th>
      <th>Design implication</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Used-signal analysis</td>
      <td>The classifier builds a map from decisions and projections, then runs only the signal families needed by the active recipe unless forced evaluation is enabled</td>
    </tr>
    <tr>
      <td>Concurrent dispatch</td>
      <td>Independent signal evaluators can run in parallel, keeping the route path from becoming a serial detector chain</td>
    </tr>
    <tr>
      <td>Readiness checks</td>
      <td>A configured signal is only useful if its model, rule, or backend dependency is ready; the router can avoid pretending a missing detector produced evidence</td>
    </tr>
    <tr>
      <td>Request-scoped caches</td>
      <td>Expensive intermediate work, such as image embeddings, can be shared by complexity and embedding signals during one request</td>
    </tr>
    <tr>
      <td>Trace preservation</td>
      <td>Signal output is retained as evidence for projections, decision traces, replay, and learning diagnostics</td>
    </tr>
  </tbody>
</table>

<p>The payoff is evidence reuse. A <code class="language-plaintext highlighter-rouge">pii</code> signal can influence privacy policy, cache policy, provider selection, and audit policy. A <code class="language-plaintext highlighter-rouge">conversation</code> signal can influence router protection, tool filtering, and replay. A <code class="language-plaintext highlighter-rouge">context</code> signal can influence long-context pools, compression, and cost-aware selection. If signals directly selected models, that reuse would disappear.</p>

<h2 id="projections-the-coordination-layer">Projections: The Coordination Layer</h2>

<p>Signals are often messy. Some are booleans. Some are classifier probabilities. Some are similarity scores. Some are raw metrics such as token count or KB relevance. Production policy should not need to manually combine all of those raw values every time.</p>

<p>Projections turn evidence into stable routing facts.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-projections.png" alt="Input signals flow through a projection layer with linear transforms and thresholds into selected routing bands." />
  <figcaption>Projections turn raw evidence into policy-readable routing facts.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Raw evidence</th>
      <th>Example value</th>
      <th>Why a projection helps</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">domain=legal</code></td>
      <td>confidence 0.82</td>
      <td>Domain can overlap with finance, support, or security; policy needs a stable partition</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">pii=present</code></td>
      <td>confidence 0.91</td>
      <td>Privacy should not depend on one detector alone</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">context_tokens</code></td>
      <td>42K</td>
      <td>Token count matters relative to model window and pool state</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">fact_check=needed</code></td>
      <td>confidence 0.76</td>
      <td>Factuality should combine with domain and knowledge availability</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">authz=premium</code></td>
      <td>matched</td>
      <td>Authorization is a hard gate, not a difficulty signal</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">kb=internal_policy</code></td>
      <td>score 0.68</td>
      <td>KB relevance is retrieval evidence, not a complete route</td>
    </tr>
  </tbody>
</table>

<div class="mermaid">
flowchart LR
  A["Raw signals"] --&gt; B["Risk score"]
  A --&gt; C["Complexity score"]
  A --&gt; D["Domain partition"]
  A --&gt; E["Knowledge need"]
  B --&gt; F["privacy_sensitive"]
  C --&gt; G["simple / medium / complex"]
  D --&gt; H["legal_contract_path"]
  E --&gt; I["needs_internal_rag"]
  F --&gt; J["Decision inputs"]
  G --&gt; J
  H --&gt; J
  I --&gt; J
</div>

<table>
  <thead>
    <tr>
      <th>Projection pattern</th>
      <th>Logic</th>
      <th>Example</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Partition</td>
      <td>Pick one winner among competing semantic candidates</td>
      <td>Choose <code class="language-plaintext highlighter-rouge">legal_contract_path</code> over <code class="language-plaintext highlighter-rouge">finance_path</code> when margin is sufficient</td>
    </tr>
    <tr>
      <td>Weighted score</td>
      <td>Combine booleans, confidence values, raw values, and similarity scores</td>
      <td>Compute risk or complexity pressure</td>
    </tr>
    <tr>
      <td>Threshold mapping</td>
      <td>Convert a continuous score into stable bands</td>
      <td>Map complexity into simple, medium, or complex</td>
    </tr>
    <tr>
      <td>Multi-emit mapping</td>
      <td>Emit several non-exclusive derived facts</td>
      <td>Emit both <code class="language-plaintext highlighter-rouge">needs_rag</code> and <code class="language-plaintext highlighter-rouge">needs_verifier</code></td>
    </tr>
    <tr>
      <td>Normalization</td>
      <td>Put heterogeneous signal scales into comparable space</td>
      <td>Feed hybrid selection and confidence ranking</td>
    </tr>
  </tbody>
</table>

<p>One subtle rule keeps projections clean: decisions read projection outputs, not every intermediate score name. A partition or weighted score can be rich internally, but the policy surface should see facts such as <code class="language-plaintext highlighter-rouge">legal_contract_path</code>, <code class="language-plaintext highlighter-rouge">risk_high</code>, or <code class="language-plaintext highlighter-rouge">long_context_lane</code>.</p>

<table>
  <thead>
    <tr>
      <th>Projection artifact</th>
      <th>Decision-visible?</th>
      <th>Trace value</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Partition</td>
      <td>Usually through the selected output</td>
      <td>Shows competing semantic candidates and margin</td>
    </tr>
    <tr>
      <td>Score</td>
      <td>Not by itself unless mapped or referenced by another projection</td>
      <td>Shows weighted input contributions, match and miss values, and normalization behavior</td>
    </tr>
    <tr>
      <td>Mapping output</td>
      <td>Yes</td>
      <td>Shows which threshold band or multi-emit output fired</td>
    </tr>
    <tr>
      <td>Boundary distance</td>
      <td>Indirectly through confidence</td>
      <td>Explains near-miss cases where a score barely crossed or missed a band</td>
    </tr>
    <tr>
      <td>Projection trace</td>
      <td>Operationally visible</td>
      <td>Lets operators debug why raw evidence became a route fact</td>
    </tr>
  </tbody>
</table>

<p>That is why the projection layer can grow without making decisions unreadable. A risk score might combine PII, jailbreak, tenant tier, KB source, and response verifier need. The decision should not have to carry that formula inline. It should match a named derived fact and leave the math in a traceable coordination layer.</p>

<p>Projections keep the rest of the system readable. Signals remain fine-grained. Decisions remain policy-oriented. Algorithms remain responsible for selection or collaboration. The coordination work lives in between, where it can be traced.</p>

<h2 id="decisions-policy-needs-a-shape">Decisions: Policy Needs a Shape</h2>

<p>Once projections produce stable facts, decisions express route policy.</p>

<p>The decision engine is intentionally closer to a boolean circuit than a hidden Python function. Routing policy should be inspectable, diffable, auditable, sortable, and eventually compilable across infrastructure layers.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-decision-engine.png" alt="Evidence enters a boolean decision engine with AND, OR, NOT gates and outputs selected route, candidate models, plugins, and fallback route." />
  <figcaption>The decision layer turns evidence into auditable route policy.</figcaption>
</figure>

<p>For the contract request, the policy can be simplified as:</p>

<div class="mermaid">
flowchart LR
  A["authz: premium"] --&gt; D1["AND"]
  B["privacy_sensitive"] --&gt; D1
  C["legal_contract_path"] --&gt; D1
  D1 --&gt; D2["AND"]
  E["needs_internal_rag"] --&gt; D2
  F["verification_required"] --&gt; D2
  D2 --&gt; R["enterprise_contract_path"]
  R --&gt; M["candidate models"]
  R --&gt; P["RAG + tool filter + verifier + replay"]
</div>

<p>A route is not just an endpoint. It is a policy-approved capability bundle: candidate models, algorithm, plugins, gateway mutations, retention behavior, fallback, and diagnostics.</p>

<table>
  <thead>
    <tr>
      <th>Decision element</th>
      <th>Meaning</th>
      <th>Why it matters</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Leaf</td>
      <td>References a signal or projection</td>
      <td>Keeps policy connected to explicit evidence</td>
    </tr>
    <tr>
      <td>AND</td>
      <td>Requires all children to match</td>
      <td>Expresses strict gates such as auth plus privacy</td>
    </tr>
    <tr>
      <td>OR</td>
      <td>Accepts any child</td>
      <td>Lets multiple evidence patterns imply the same path</td>
    </tr>
    <tr>
      <td>NOT</td>
      <td>Excludes one child</td>
      <td>Useful for fallback, denial, or bypass policy</td>
    </tr>
    <tr>
      <td>Priority and tier</td>
      <td>Sort matched decisions</td>
      <td>Prevents low-risk paths from shadowing high-risk paths</td>
    </tr>
    <tr>
      <td>Confidence</td>
      <td>Carries evidence strength</td>
      <td>Allows ranking without hiding why</td>
    </tr>
    <tr>
      <td>Emits</td>
      <td>Produces route metadata</td>
      <td>Connects policy to cache, learning, plugins, and gateway headers</td>
    </tr>
  </tbody>
</table>

<p>In the current contract, a decision is a route object, not only a rule tree.</p>

<table>
  <thead>
    <tr>
      <th>Decision field</th>
      <th>What it contributes to the route</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">name</code> and <code class="language-plaintext highlighter-rouge">description</code></td>
      <td>Human-readable identity for traces, dashboards, replay, and review</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">priority</code> and <code class="language-plaintext highlighter-rouge">tier</code></td>
      <td>Deterministic ordering when multiple policies match</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">output_contract</code></td>
      <td>Declares the expected API or response shape for the route</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">rules</code></td>
      <td>Recursive Boolean tree over signals and projection outputs</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">modelRefs</code></td>
      <td>Candidate boundary for selectors, loopers, and learning</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">algorithm</code></td>
      <td>Execution strategy after the policy match</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">adaptations</code></td>
      <td>Per-decision learning mode: apply, observe, or bypass</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">plugins</code></td>
      <td>Route-scoped behavior attached after matching</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">candidateIterations</code></td>
      <td>Declarative candidate loops used by richer selection or workflow constructs</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">emits</code></td>
      <td>Declarative side effects such as retention behavior</td>
    </tr>
  </tbody>
</table>

<p>Decision selection is intentionally deterministic. If matched decisions use tiers, lower tier values win first, then confidence, priority, and name. Without tiers, <code class="language-plaintext highlighter-rouge">strategy=confidence</code> ranks by confidence before priority; the default strategy ranks priority before confidence. Even fallback is explicit: an empty <code class="language-plaintext highlighter-rouge">AND</code> can be a catch-all route, but it has zero confidence so it does not outrank real evidence-backed decisions.</p>

<p>Retention emits make policy visible beyond the immediate model choice. A decision can express <code class="language-plaintext highlighter-rouge">drop</code> to skip semantic-cache writes, <code class="language-plaintext highlighter-rouge">ttl_turns</code> to bound cache lifetime, <code class="language-plaintext highlighter-rouge">keep_current_model</code> to protect session continuity, or <code class="language-plaintext highlighter-rouge">prefer_prefix_retention</code> to tell the serving pool that KV/prefix reuse matters.</p>

<p>That shift from classification-style routing to signal-decision routing is not cosmetic. Classification is useful for demos. Decision architecture is what production policy needs.</p>

<h2 id="selection-algorithms-choosing-one-model-after-policy">Selection Algorithms: Choosing One Model After Policy</h2>

<p>Many router designs start with the selector: embeddings, MLPs, bandits, or an LLM-as-router that picks a model directly. That easily turns one algorithm into a sink for every concern: semantic fit, cost, latency, safety, authorization, session continuity, and provider policy.</p>

<p>vLLM SR keeps the order stricter. The decision matches first. Then a selection algorithm chooses one model from the policy-approved candidate set.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-algorithm-selector.png" alt="Route enters a selector with Static, RouterDC, Hybrid, and Latency algorithms, then outputs one model or multi model." />
  <figcaption>Selection algorithms choose inside a matched decision. They do not define route eligibility.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Selection algorithm</th>
      <th>Catalog tier</th>
      <th>Core idea</th>
      <th>Best use</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Static</td>
      <td>Supported</td>
      <td>Pick the configured order or fixed score</td>
      <td>Deterministic fallback, explicit business policy, early rollout</td>
    </tr>
    <tr>
      <td>RouterDC</td>
      <td>Supported</td>
      <td>Match query embedding to model-description embeddings</td>
      <td>Query-to-capability matching when model cards are meaningful</td>
    </tr>
    <tr>
      <td>Hybrid</td>
      <td>Supported</td>
      <td>Combine semantic fit, quality, latency, cost, cache affinity, and other scores</td>
      <td>Production tradeoffs where no single signal should dominate</td>
    </tr>
    <tr>
      <td>Multi-factor</td>
      <td>Supported</td>
      <td>Filter by SLO, then score quality, latency, cost, and load</td>
      <td>Fleet-aware route selection</td>
    </tr>
    <tr>
      <td>Latency-aware</td>
      <td>Supported</td>
      <td>Prefer candidates using TTFT/TPOT percentile metrics</td>
      <td>SLO-sensitive paths</td>
    </tr>
    <tr>
      <td>AutoMix</td>
      <td>Experimental</td>
      <td>Start cheaper and escalate using confidence or verification</td>
      <td>Cost-saving cascades where repair is acceptable</td>
    </tr>
    <tr>
      <td>KNN</td>
      <td>Experimental</td>
      <td>Route by nearest labeled examples</td>
      <td>Interpretable example-based routing</td>
    </tr>
    <tr>
      <td>KMeans</td>
      <td>Experimental</td>
      <td>Route by cluster membership</td>
      <td>Coarse workload segmentation</td>
    </tr>
    <tr>
      <td>SVM</td>
      <td>Experimental</td>
      <td>Route by learned decision boundary</td>
      <td>Fast offline-trained classification</td>
    </tr>
    <tr>
      <td>MLP</td>
      <td>Experimental</td>
      <td>Non-linear neural selector through native ML artifacts</td>
      <td>Mature deployments with trained artifacts</td>
    </tr>
  </tbody>
</table>

<p>The boundary is strict: <strong>selection algorithms choose one model from <code class="language-plaintext highlighter-rouge">modelRefs</code></strong>. They do not run a panel, coordinate a workflow, or hold a session model. Multi-model collaboration belongs to Looper. Session and conversation stability belongs to Router Learning.</p>

<h2 id="looper-algorithms-selecting-a-model-collaboration-path">Looper Algorithms: Selecting a Model Collaboration Path</h2>

<p>Looper is important enough to discuss separately because it changes what the router is selecting.</p>

<p>A selection algorithm chooses one model. A Looper algorithm chooses a <strong>model collaboration path</strong>: a bounded execution pattern involving escalation, fan-out, panel judgment, multi-round reasoning, or micro-agent workflows. This is usually the path for scaling model capability without exposing a new application protocol. The client may still call one logical model name, but the router executes a structured collaboration behind that name.</p>

<div class="mermaid">
flowchart LR
  A["Matched decision"] --&gt; B{"Execution choice"}
  B -- "selection" --&gt; C["One model<br />backend path"]
  B -- "looper" --&gt; D["Collaboration path"]
  D --&gt; E["Sequential<br />Confidence"]
  D --&gt; F["Parallel<br />Ratings / Fusion"]
  D --&gt; G["Multi-round<br />ReMoM"]
  D --&gt; H["Workflow<br />Router Flow"]
  E --&gt; I["One API response<br />headers + replay"]
  F --&gt; I
  G --&gt; I
  H --&gt; I
</div>

<table>
  <thead>
    <tr>
      <th>Looper algorithm</th>
      <th>Catalog tier</th>
      <th>Collaboration pattern</th>
      <th>What it scales</th>
      <th>How to read it</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Confidence</td>
      <td>Supported</td>
      <td>Try smaller or cheaper models first, evaluate confidence, escalate when confidence is too low</td>
      <td>Cost-efficient quality</td>
      <td>A sequential small-to-large cascade with explicit stopping conditions</td>
    </tr>
    <tr>
      <td>Ratings</td>
      <td>Supported</td>
      <td>Run multiple candidates concurrently up to a cap and aggregate with rating-aware logic</td>
      <td>Ensemble breadth under cost control</td>
      <td>A bounded fan-out path for evaluation, A/B, and ensemble-style responses</td>
    </tr>
    <tr>
      <td>ReMoM</td>
      <td>Supported</td>
      <td>Run multi-round parallel reasoning with a breadth schedule and final synthesis</td>
      <td>Test-time reasoning capacity</td>
      <td>A breadth-controlled reasoning tree across models</td>
    </tr>
    <tr>
      <td>Fusion</td>
      <td>Experimental</td>
      <td>Run an analysis panel, ask a judge for structured analysis, then synthesize one final answer</td>
      <td>Independent model perspectives</td>
      <td>A panel-judge-synthesis path for tasks where disagreement and blind spots matter</td>
    </tr>
    <tr>
      <td>Router Flow / Workflows</td>
      <td>Experimental</td>
      <td>Execute a static or planner-generated micro-agent workflow behind one model name</td>
      <td>Decomposition, verification, tool-aware work</td>
      <td>A bounded agent workflow where workers are constrained by decision <code class="language-plaintext highlighter-rouge">modelRefs</code></td>
    </tr>
  </tbody>
</table>

<p>These are not just “more algorithms.” They are the router’s answer to capability scaling.</p>

<p><strong>Confidence</strong> keeps the cost curve low by starting small and escalating only when confidence is insufficient. It can use average log probability, margin, a hybrid score, self-verification, or an AutoMix-style entailment verifier. The question is not “small or large model?” It is “is the current answer good enough to stop?”</p>

<div class="mermaid">
flowchart LR
  A["Matched decision<br />modelRefs"] --&gt; B["Start with cheaper<br />or smaller model"]
  B --&gt; C{"Confidence<br />enough?"}
  C -- "yes" --&gt; D["Return answer"]
  C -- "no" --&gt; E["Escalate to stronger<br />candidate"]
  E --&gt; F{"Verifier, margin,<br />or logprob passes?"}
  F -- "yes" --&gt; D
  F -- "no" --&gt; G["Next candidate<br />or fallback"]
  G --&gt; D
</div>

<p><strong>Ratings</strong> uses concurrency as a controlled resource. Instead of one winner, several candidates participate, bounded by <code class="language-plaintext highlighter-rouge">max_concurrent</code>, and the router aggregates successful responses. This is useful when operators want ensemble behavior or live comparison without letting fan-out become unbounded.</p>

<div class="mermaid">
flowchart LR
  A["Matched decision<br />modelRefs"] --&gt; B["Bounded fan-out<br />max_concurrent"]
  B --&gt; C["Model A<br />response"]
  B --&gt; D["Model B<br />response"]
  B --&gt; E["Model C<br />response"]
  C --&gt; F["Rating-aware<br />aggregation"]
  D --&gt; F
  E --&gt; F
  F --&gt; G["One API response<br />plus trace"]
</div>

<p><strong>Fusion</strong> is the clean panel pattern. It sends the request to analysis models, asks a judge to identify consensus, contradictions, partial coverage, and blind spots, and then synthesizes a final answer. The important design point is that Fusion policy lives under the matched decision. <code class="language-plaintext highlighter-rouge">vllm-sr/auto</code> can decide whether Fusion is warranted; <code class="language-plaintext highlighter-rouge">vllm-sr/fusion</code> narrows matching to Fusion-capable decisions instead of silently falling back to ordinary single-model routing.</p>

<div class="mermaid">
flowchart LR
  A["Matched Fusion decision"] --&gt; B["Analysis model A"]
  A --&gt; C["Analysis model B"]
  A --&gt; D["Analysis model C"]
  B --&gt; E["Judge<br />consensus, conflicts, gaps"]
  C --&gt; E
  D --&gt; E
  E --&gt; F["Synthesis model"]
  F --&gt; G["Final answer<br />with panel trace"]
</div>

<p><strong>ReMoM</strong> is the multi-round version of the same philosophy. It uses a breadth schedule such as <code class="language-plaintext highlighter-rouge">[3, 2]</code> or <code class="language-plaintext highlighter-rouge">[32, 4]</code>, distributes calls across model candidates, compacts intermediate responses when needed, and synthesizes the final answer. This is useful when the value comes from exploration over multiple reasoning paths rather than one panel pass.</p>

<div class="mermaid">
flowchart LR
  A["Matched ReMoM decision"] --&gt; B["Round 1<br />breadth schedule"]
  B --&gt; C["Parallel reasoning<br />across candidates"]
  C --&gt; D["Compact or select<br />intermediate outputs"]
  D --&gt; E["Next round<br />reduced breadth"]
  E --&gt; F["Final synthesis"]
  F --&gt; G["Answer<br />with round trace"]
</div>

<p><strong>Router Flow</strong> turns the route into a bounded micro-agent workflow. A static flow can define roles such as thinker, worker, verifier, and final synthesizer. A dynamic flow can ask a planner model to produce a plan, but worker execution remains constrained to the decision’s <code class="language-plaintext highlighter-rouge">modelRefs</code>. Tool calls preserve the OpenAI-compatible contract while the router stores enough workflow state to resume the correct worker after tool results return.</p>

<div class="mermaid">
flowchart LR
  A["Matched Flow decision"] --&gt; B["Static flow<br />or planner output"]
  B --&gt; C["Thinker<br />decompose task"]
  C --&gt; D["Worker<br />bounded by modelRefs"]
  D --&gt; E["Tool calls<br />and tool results"]
  E --&gt; D
  D --&gt; F["Verifier<br />check result"]
  F --&gt; G["Final synthesizer"]
  G --&gt; H["OpenAI-compatible<br />response + workflow trace"]
</div>

<p>The Looper layer is the bridge from routing to model collaboration. It lets the router scale capability through multiple models while keeping policy, traces, cost boundaries, and public API shape explicit.</p>

<h2 id="router-memory-and-learning-adaptation-is-not-an-algorithm">Router Memory and Learning: Adaptation Is Not an Algorithm</h2>

<p>Session-aware and learning-related behavior should not be hidden inside <code class="language-plaintext highlighter-rouge">decision.algorithm</code>. In the clean vLLM SR design, this belongs to Router Learning.</p>

<p>The distinction matters. A decision says what is allowed. A selection or looper algorithm produces a base result. Router Learning then asks whether the system should adapt that result from runtime experience, and whether switching is safe in the current session or conversation.</p>

<blockquote>
  <p>Learning can improve a route inside policy. It must not become a second, invisible policy system.</p>
</blockquote>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-session-aware-state-boundary.png" alt="Timeline showing tool lock, model lane A, KV cache, idle drift boundary, and possible switch to model B." />
  <figcaption>Router Learning protects continuity and adapts choices after the base route is selected.</figcaption>
</figure>

<p>The runtime order is fixed:</p>

<div class="mermaid">
flowchart LR
  A["Matched decision"] --&gt; B["Base selector or looper"]
  B --&gt; C["Protection preflight"]
  C --&gt; D["Adaptation proposal"]
  D --&gt; E["Protection switch guard"]
  E --&gt; F["Final model/path"]
  F --&gt; G["Learning headers"]
  F --&gt; H["Replay diagnostics"]
  H --&gt; I["Outcomes"]
  I --&gt; J["Experience update"]
  H --&gt; K["Offline recipe learning"]
</div>

<table>
  <thead>
    <tr>
      <th>Component</th>
      <th>Question it answers</th>
      <th>What it may change</th>
      <th>What it must not change</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Recipe policy</td>
      <td>Which route is allowed for this request?</td>
      <td>Matched decision and candidate boundary</td>
      <td>Runtime experience</td>
    </tr>
    <tr>
      <td>Base selector / looper</td>
      <td>What is the policy-approved base model or collaboration path?</td>
      <td>Base result</td>
      <td>Decision eligibility</td>
    </tr>
    <tr>
      <td>Adaptation</td>
      <td>Does experience suggest a better candidate inside the allowed boundary?</td>
      <td>Proposal model</td>
      <td>Signals, thresholds, decisions, priorities, modelRefs</td>
    </tr>
    <tr>
      <td>Protection</td>
      <td>Is exploration or switching safe now?</td>
      <td>Hold, allow, or rescue final model</td>
      <td>Model quality scores or policy matching</td>
    </tr>
    <tr>
      <td>Replay and outcomes</td>
      <td>What happened, and how did it perform?</td>
      <td>Experience and offline evidence</td>
      <td>Live recipe policy</td>
    </tr>
    <tr>
      <td>Offline recipe learning</td>
      <td>What recipe patch should humans review?</td>
      <td>Candidate recipe patches and seed packs</td>
      <td>Production behavior without review</td>
    </tr>
  </tbody>
</table>

<p>The public learning concepts are intentionally small:</p>

<table>
  <thead>
    <tr>
      <th>Concept</th>
      <th>Public surface</th>
      <th>Meaning</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Adaptation</td>
      <td><code class="language-plaintext highlighter-rouge">global.router.learning.adaptation</code></td>
      <td>Online model-choice learning from runtime experience</td>
    </tr>
    <tr>
      <td>Protection</td>
      <td><code class="language-plaintext highlighter-rouge">global.router.learning.protection</code></td>
      <td>Session and conversation stability control</td>
    </tr>
    <tr>
      <td>Decision control</td>
      <td><code class="language-plaintext highlighter-rouge">routing.decisions[].adaptations</code></td>
      <td>Apply, observe, or bypass learning for the matched decision</td>
    </tr>
    <tr>
      <td>Candidate boundary</td>
      <td><code class="language-plaintext highlighter-rouge">decision</code>, <code class="language-plaintext highlighter-rouge">tier</code>, or <code class="language-plaintext highlighter-rouge">global</code></td>
      <td>How far adaptation may search</td>
    </tr>
    <tr>
      <td>Outcome</td>
      <td><code class="language-plaintext highlighter-rouge">/v1/router/outcomes</code> linked to replay</td>
      <td>Typed feedback for model, route, policy, stability, provider, or router</td>
    </tr>
    <tr>
      <td>Replay</td>
      <td><code class="language-plaintext highlighter-rouge">x-vsr-replay-id</code> and durable record</td>
      <td>Evidence log for diagnostics and offline learning</td>
    </tr>
  </tbody>
</table>

<p>Adaptation’s day-0 strategy is <code class="language-plaintext highlighter-rouge">routing_sampling</code>. It scores candidates from local experience: quality seed, good-fit outcomes, underpowered outcomes, overprovisioned outcomes, failures, latency evidence, cache reuse, effective input cost, and reliability. The default candidate set is <code class="language-plaintext highlighter-rouge">decision</code>, which means adaptation may only choose among the matched decision’s <code class="language-plaintext highlighter-rouge">modelRefs</code>. Broader scopes such as <code class="language-plaintext highlighter-rouge">tier</code> and <code class="language-plaintext highlighter-rouge">global</code> are more powerful, but they need stronger guards.</p>

<p>Protection is the session-aware half. It has a preflight guard and a switch guard. Preflight suppresses stochastic sampling during tool loops, protocol-sensitive continuations, or routine continuation steps. The switch guard decides whether to hold the current model, allow the proposal, or perform a bounded rescue switch. The simplified rule is:</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>switch if proposal_gain &gt;= switch_margin + stability_weight * switch_cost
</code></pre></div></div>

<p>The switch cost can include cache warmth, handoff cost, tool-loop state, provider state, turn count, and switch history. Session-aware routing is therefore not sticky sessions. It is controlled continuity. The router keeps a model when switching is unsafe or not worth it, and it can switch again at idle boundaries, decision drift, or rescue conditions.</p>

<table>
  <thead>
    <tr>
      <th>Router memory layer</th>
      <th>Hot path?</th>
      <th>Purpose</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Protection state</td>
      <td>Yes</td>
      <td>Protected model, identity scope, turn count, cache/tool-loop evidence, switch history</td>
    </tr>
    <tr>
      <td>Model experience</td>
      <td>Yes</td>
      <td>Quality, overuse, reliability, latency, cache, and cost evidence for adaptation</td>
    </tr>
    <tr>
      <td>Router Replay</td>
      <td>Write from hot path, read offline</td>
      <td>Durable route, response, outcome, and learning diagnostics</td>
    </tr>
    <tr>
      <td>Offline recipe artifacts</td>
      <td>No</td>
      <td>Findings, candidate recipes, recipe patches, and optional experience seed packs</td>
    </tr>
  </tbody>
</table>

<p>Sensitive routes can bypass learning entirely:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">routing</span><span class="pi">:</span>
  <span class="na">decisions</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">local_privacy_policy</span>
      <span class="na">modelRefs</span><span class="pi">:</span>
        <span class="pi">-</span> <span class="na">model</span><span class="pi">:</span> <span class="s">local-private-model</span>
      <span class="na">adaptations</span><span class="pi">:</span>
        <span class="na">mode</span><span class="pi">:</span> <span class="s">bypass</span>
</code></pre></div></div>

<p>That boundary is the contract. Learning can improve choices inside recipe policy. It cannot silently rewrite the recipe, add a new privacy exception, change a decision priority, or mutate modelRefs on the request path. Offline recipe learning can propose those changes as reviewable artifacts, but live routing remains governed by the recipe.</p>

<h2 id="plugins-behavior-belongs-to-the-route">Plugins: Behavior Belongs to the Route</h2>

<p>After a route is selected, the request still may not be ready for the model. It may need cache, memory, RAG, tool filtering, request parameter caps, prompt mutation, response verification, fast policy response, image generation, or replay.</p>

<p>These behaviors should not be global decoration. Privacy routes may need to bypass cache. High-risk factual routes may require verification. Agentic routes may need tool boundaries. Low-risk summarization may need only replay. Plugins are therefore route-scoped.</p>

<div class="mermaid">
flowchart LR
  A["Matched decision"] --&gt; B["Selection / Looper / Learning"]
  B --&gt; C["Route-scoped plugins"]
  C --&gt; D["Request mutation"]
  D --&gt; E["Backend or Looper call"]
  E --&gt; F["Response plugins"]
  F --&gt; G["Replay / audit"]
  C --&gt; C1["Semantic cache"]
  C --&gt; C2["RAG"]
  C --&gt; C3["Memory"]
  C --&gt; C4["Tool selection"]
  F --&gt; F1["Hallucination check"]
  F --&gt; F2["Response safety"]
</div>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-route-scoped-plugins.png" alt="Route connected to Cache, Memory, RAG, Tools, Safety, Replay, with plugin paths after route selection." />
  <figcaption>Plugins are route-scoped behavior, not hidden global middleware.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Plugin</th>
      <th>What it changes</th>
      <th>Why route scope matters</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Semantic cache</td>
      <td>Reads or writes semantic cache with threshold, TTL, and quota</td>
      <td>Privacy and category boundaries change cache policy</td>
    </tr>
    <tr>
      <td>Memory</td>
      <td>Retrieves or stores conversational/user memory</td>
      <td>Memory scope must respect tenant, privacy, and session policy</td>
    </tr>
    <tr>
      <td>RAG</td>
      <td>Adds retrieval from vector DB, MCP, file search, or external API</td>
      <td>Knowledge access is a capability path</td>
    </tr>
    <tr>
      <td>Tools</td>
      <td>Passes through, filters, blocks, or dynamically retrieves tools</td>
      <td>Tool exposure depends on route, user, risk, and session</td>
    </tr>
    <tr>
      <td>Tool selection</td>
      <td>Adds or filters tools from a tool database or request subset</td>
      <td>Ranking tools is a route decision, not an application afterthought</td>
    </tr>
    <tr>
      <td>Request params</td>
      <td>Caps or rewrites temperature, max tokens, tools, or response format</td>
      <td>High-risk routes need tighter request shape</td>
    </tr>
    <tr>
      <td>System prompt</td>
      <td>Injects route-specific instructions</td>
      <td>Policy must reach model behavior</td>
    </tr>
    <tr>
      <td>Header mutation</td>
      <td>Adds provider, cluster, audit, or routing headers</td>
      <td>Gateway and backend need explicit context</td>
    </tr>
    <tr>
      <td>Fast response</td>
      <td>Returns without model call</td>
      <td>Blocks, denies, quotas, or unsupported paths</td>
    </tr>
    <tr>
      <td>Response jailbreak</td>
      <td>Checks response-side safety</td>
      <td>Request-only scanning misses output failures</td>
    </tr>
    <tr>
      <td>Hallucination</td>
      <td>Warns, blocks, or rewrites unsupported claims</td>
      <td>High-risk factual routes need response governance</td>
    </tr>
    <tr>
      <td>Router replay</td>
      <td>Records request, evidence, decision, model/path, plugins, and response</td>
      <td>Debugging and learning need durable artifacts</td>
    </tr>
    <tr>
      <td>Image generation</td>
      <td>Bridges modality-aware routes to image backends</td>
      <td>Image routes have different models and policies</td>
    </tr>
  </tbody>
</table>

<p>Some plugins are worth reading as miniature subsystems.</p>

<table>
  <thead>
    <tr>
      <th>Plugin subsystem</th>
      <th>Important runtime detail</th>
      <th>Failure it prevents</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">semantic-cache</code></td>
      <td>Can override similarity threshold and TTL per decision; personalized RAG or memory routes can skip cache writes</td>
      <td>Reusing private or personalized answers as generic cache hits</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">memory</code></td>
      <td>Retrieves with limit and similarity threshold, supports auto-store, hybrid search, and reflection; injected after system/developer messages as a separate user-context message</td>
      <td>Blending memory into hidden prompt text that operators cannot reason about</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">rag</code></td>
      <td>Supports Milvus, Qdrant, external API, MCP, OpenAI file search, and hybrid modes; injection can be tool-role or system-prompt</td>
      <td>Treating all knowledge access as one opaque retrieval step</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">tools</code></td>
      <td>Supports passthrough, filtered, none, allow/block, semantic selection, and dynamic retrieval modes such as <code class="language-plaintext highlighter-rouge">semantic_only</code> and <code class="language-plaintext highlighter-rouge">hybrid_history</code></td>
      <td>Letting an agent see tools just because the client sent them</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">request_params</code></td>
      <td>Can block or strip request parameters, cap <code class="language-plaintext highlighter-rouge">max_tokens</code> and <code class="language-plaintext highlighter-rouge">n</code>, and optionally strip unknown OpenAI fields</td>
      <td>High-risk paths inheriting unsafe sampling or output shape</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">response_jailbreak</code> and <code class="language-plaintext highlighter-rouge">hallucination</code></td>
      <td>Run after the model response and can warn, block, or rewrite warning metadata</td>
      <td>Assuming request-time safety checks are enough</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">router_replay</code></td>
      <td>Captures bounded request, response, tool trace, route, and plugin evidence</td>
      <td>Losing the evidence needed for debugging, evaluation, and learning</td>
    </tr>
  </tbody>
</table>

<p>A route is better understood as an execution contract. The model is one part of it. The route also carries constraints, tools, knowledge, verification, memory, and evidence.</p>

<h2 id="the-hot-path-header-body-route-response">The Hot Path: Header, Body, Route, Response</h2>

<p>The conceptual architecture only becomes convincing when it touches the request path. In vLLM SR, the hot path is shaped around a simple constraint: the router must see enough context to make a semantic decision, but it should avoid turning every request into an expensive full parse and full detector run.</p>

<p>The route lifecycle inside the gateway path looks like this.</p>

<div class="mermaid">
flowchart LR
  A["Headers<br />id, path, protocol, identity"] --&gt; B["Body<br />fast extraction"]
  B --&gt; C{"Mutation<br />needed?"}
  C -- "no" --&gt; D["Signals<br />projections<br />decisions"]
  C -- "yes" --&gt; E["Full parse<br />OpenAI / Responses / Anthropic"]
  E --&gt; D
  D --&gt; F["Model routing<br />explicit, auto, looper slug"]
  F --&gt; G["Request preparation<br />memory, RAG, tools, params, prompt"]
  G --&gt; H["Backend or Looper<br />execution"]
  H --&gt; I["Response phase<br />normalize, verify, cache, replay"]
</div>

<table>
  <thead>
    <tr>
      <th>Phase</th>
      <th>What the router extracts or changes</th>
      <th>Why it is on the hot path</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Header phase</td>
      <td>Request id, method/path, client protocol, identity headers, streaming expectation, replay/model/response API paths, skip-processing opt-out</td>
      <td>Routing needs tenant, protocol, and control metadata before reading the full body</td>
    </tr>
    <tr>
      <td>Body phase</td>
      <td>Fast request state first; full OpenAI-compatible parse only when mutation is needed</td>
      <td>Most routing decisions should not pay unnecessary parsing and mutation cost</td>
    </tr>
    <tr>
      <td>Pre-routing</td>
      <td>Response API translation when needed, validation, signal dispatch, projection application, decision match, algorithm or looper preflight</td>
      <td>Semantic policy must happen before backend selection</td>
    </tr>
    <tr>
      <td>Model routing</td>
      <td>Explicit model, <code class="language-plaintext highlighter-rouge">auto</code> model names, direct looper slugs such as Fusion or Flow, Anthropic provider routing, alias resolution, provider profile/auth, reasoning mode</td>
      <td>Logical model names must resolve into real provider and backend behavior</td>
    </tr>
    <tr>
      <td>Request preparation</td>
      <td>System prompt, memory, RAG, request params, tools, tool selection, route headers, trace headers</td>
      <td>The selected route becomes concrete model input and gateway metadata</td>
    </tr>
    <tr>
      <td>Response phase</td>
      <td>Normalize OpenAI, Responses, or Anthropic shapes, report usage, calibrate token estimate, update cache, run response jailbreak/hallucination checks, store memory, emit warnings, record replay</td>
      <td>The router must observe what happened, not only what it predicted</td>
    </tr>
  </tbody>
</table>

<p>Protocol compatibility is part of the same story. The router should not hide provider differences behind a vague facade. It should translate them explicitly at the boundary: OpenAI-compatible chat, Responses-style calls, Anthropic-style provider routing, direct looper model slugs, and backend-specific provider profiles all become inputs to one routing engine. Applications keep a familiar API shape, while the infrastructure keeps the differences visible enough to debug.</p>

<p>The ExtProc path matters because it gives semantic policy a boundary-native shape. vLLM SR can receive enough request and response context to make semantic decisions while still returning control to the real gateway data plane.</p>

<h2 id="envoy-integration-put-semantic-policy-at-the-boundary">Envoy Integration: Put Semantic Policy at the Boundary</h2>

<p>The Envoy integration shows the intended boundary clearly.</p>

<p>Envoy owns the data plane: TLS, clusters, endpoint health, timeouts, retries, load balancing, and filter chains. vLLM SR should not rebuild those capabilities. It should act as the semantic policy plane: receive request context through External Processing, evaluate the route, and return header/body mutations.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-envoy-extproc.png" alt="Client Request to Envoy Gateway, semantic policy path to Semantic Router, and main traffic path to Backend Model Clusters." />
  <figcaption>Envoy keeps the main traffic path. vLLM SR returns semantic policy decisions and mutations.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Component</th>
      <th>Responsibility</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Client</td>
      <td>Sends OpenAI-compatible or provider-compatible requests</td>
    </tr>
    <tr>
      <td>Envoy</td>
      <td>Handles network path, clusters, TLS, timeout, health, retry, and load balancing</td>
    </tr>
    <tr>
      <td>ExtProc bridge</td>
      <td>Sends request context and receives header/body mutations</td>
    </tr>
    <tr>
      <td>vLLM SR</td>
      <td>Extracts evidence, matches policy, selects or orchestrates, applies learning and plugins</td>
    </tr>
    <tr>
      <td>Backend clusters</td>
      <td>Serve model traffic after the semantic route is decided</td>
    </tr>
  </tbody>
</table>

<p>The adoption advantage is large. Applications do not need a new private API just to benefit from semantic routing. They can keep calling familiar model APIs while infrastructure maps logical model names to small models, frontier models, RAG paths, verifier paths, Looper collaboration paths, workflows, or private hardware lanes.</p>

<p>Protocol work such as SIRP and multi-provider inference API matters for the same reason. Semantic routing should strengthen the control plane without forcing every application team into a custom gateway dialect.</p>

<h2 id="model-design-model-name-is-the-wrong-primitive">Model Design: Model Name Is the Wrong Primitive</h2>

<p>The router cannot make production-grade decisions from model names alone.</p>

<p><code class="language-plaintext highlighter-rouge">gpt-4</code>, <code class="language-plaintext highlighter-rouge">qwen3-32b</code>, <code class="language-plaintext highlighter-rouge">claude-opus</code>, or <code class="language-plaintext highlighter-rouge">local-private</code> identifies an endpoint or alias. It does not describe reasoning ability, coding strength, tool behavior, vision support, context window, latency distribution, cost, hardware path, privacy boundary, or observed failure modes.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-router-model-stack.png" alt="Request flows to Lexical, Embedding, LoRA, and MLP Selector models, then Calibration, Decision, Small Model, RAG, and Frontier Model with Feedback." />
  <figcaption>The router needs calibrated model metadata, not just endpoint strings.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Model-card field</th>
      <th>Examples</th>
      <th>Routing implication</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Capability</td>
      <td>reasoning, coding, vision, tool use, image generation, verifier, embedding</td>
      <td>Determines which routes can legally include the model</td>
    </tr>
    <tr>
      <td>Economics</td>
      <td>price, quality score, cost weight, expected output length</td>
      <td>Feeds cost-quality optimization</td>
    </tr>
    <tr>
      <td>Latency</td>
      <td>TTFT, TPOT, p50/p95/p99, warm/cold behavior</td>
      <td>Feeds SLO-aware selection</td>
    </tr>
    <tr>
      <td>Context</td>
      <td>context window, compression support, long-context stability</td>
      <td>Drives context-aware routing and token-budget routing</td>
    </tr>
    <tr>
      <td>Hardware</td>
      <td>CUDA, ROCm, XPU, CPU, quantization, engine family</td>
      <td>Connects logical model to physical pool</td>
    </tr>
    <tr>
      <td>Policy</td>
      <td>provider profile, tenant allowlist, data boundary, reasoning family</td>
      <td>Prevents unsafe or unauthorized selection</td>
    </tr>
    <tr>
      <td>Feedback</td>
      <td>replay success, failure type, verifier disagreement, user feedback</td>
      <td>Supports learning and recalibration</td>
    </tr>
  </tbody>
</table>

<p>Users can ask for <code class="language-plaintext highlighter-rouge">auto</code>. The system cannot treat <code class="language-plaintext highlighter-rouge">auto</code> as a magic endpoint. Internally, it must expand into model cards, candidate sets, route policy, Looper eligibility, learning boundaries, and execution paths.</p>

<h2 id="bindings-fast-ml-without-turning-the-router-into-a-model-server">Bindings: Fast ML Without Turning the Router Into a Model Server</h2>

<p>vLLM SR’s control plane is written around Go because gateway integration, configuration, request mutation, response processing, Envoy ExtProc, and Kubernetes-style infrastructure fit Go well. But routing also has ML hot paths: embeddings, classification, modality detection, LoRA classification, and MLP selectors.</p>

<p>The binding layer keeps those concerns separated.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-native-binding-matrix.png" alt="Go Router Service connected through FFI Boundary to Candle Backend, ONNX Backend, and Stub Backend capability matrix." />
  <figcaption>Native bindings expose capability explicitly instead of letting deployments guess.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Native surface</th>
      <th>Role</th>
      <th>Capability shape</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">candle-binding</code></td>
      <td>Rust/Candle high-performance ML path</td>
      <td>Unified batch classification, LoRA classification, batched embeddings, multimodal embeddings, modality routing, MLP selector</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">ml-binding</code></td>
      <td>Rust helpers for classical ML selector artifacts</td>
      <td>KNN, KMeans, and SVM-style selector support where trained artifacts exist</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">nlp-binding</code></td>
      <td>Rust lexical routing helpers</td>
      <td>BM25, n-gram, and deterministic lexical classifiers for low-latency evidence</td>
    </tr>
    <tr>
      <td>ONNX backend</td>
      <td>Portable runtime path</td>
      <td>Batched embedding in the current public capability contract</td>
    </tr>
    <tr>
      <td>Stub backend</td>
      <td>Minimal or unsupported build path</td>
      <td>Explicit capability absence for fallback, tests, and non-native builds</td>
    </tr>
  </tbody>
</table>

<p>The rule is not “everything must be native.” The rule is <strong>capability must be explicit</strong>. If a deployment lacks a native classifier, the router should know. If ONNX supports only part of the contract, policy should not pretend otherwise. If backend lifecycle needs reset boundaries, the router should expose that instead of hiding it. Intel/OpenVINO-oriented paths can be valuable deployment options, but they belong in the hardware/runtime discussion unless they are part of the same advertised native capability contract.</p>

<h2 id="hardware-is-a-routing-variable">Hardware Is a Routing Variable</h2>

<p>Hardware support is often described as a compatibility matrix. For semantic routing, it is more than that.</p>

<p>Different hardware paths imply different latency, cost, memory behavior, kernel availability, quantization support, context-window economics, privacy boundary, and energy curve. A router that ignores hardware is only doing half the job.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-hardware-runtime-support.png" alt="Router connected to latency, cost, context, privacy, and hardware paths CUDA, ROCm, XPU, CPU." />
  <figcaption>Hardware-aware routing connects semantic constraints to physical execution.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Platform path</th>
      <th>What matters to routing</th>
      <th>Example route</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>NVIDIA CUDA</td>
      <td>Mature high-throughput vLLM serving, CUDA kernels, quantized paths, broad accelerator availability</td>
      <td>Default high-performance pool, frontier or private data-center path</td>
    </tr>
    <tr>
      <td>AMD ROCm</td>
      <td>First-class non-CUDA vLLM platform direction, MI300/MI350-class deployments, AITER kernels and attention paths</td>
      <td>Cost/performance diversification, ROCm production pool, AMD Developer Cloud validation path</td>
    </tr>
    <tr>
      <td>Intel XPU</td>
      <td>SYCL/DPC++, oneDNN, XPU kernels, OpenVINO-oriented portability and optimization paths</td>
      <td>Enterprise accelerator lane, private infrastructure, CPU/XPU hybrid deployment</td>
    </tr>
    <tr>
      <td>CPU / local</td>
      <td>Intel/AMD x86, ARM AArch64, Apple silicon, edge and offline fallback</td>
      <td>PII-sensitive, low-throughput, local-only, or cost-minimal workloads</td>
    </tr>
    <tr>
      <td>KV / context</td>
      <td>Prefix retention, warm state, prefill/decode balance, context-window pressure, bytes-per-token drift</td>
      <td>Session-aware protection, long-context pools, token-budget-aware routing</td>
    </tr>
  </tbody>
</table>

<p>The acceleration story is not one-size-fits-all. CUDA gives the broadest default serving path. ROCm/AITER makes AMD pools a serious production option rather than a compatibility afterthought. Intel XPU and OpenVINO-style paths matter for enterprises that already own Intel-heavy infrastructure or need CPU/XPU portability. CPU and local paths remain important because privacy, availability, and cost sometimes beat raw throughput.</p>

<p>WRP is the right mental model here. Workload is semantic. Pool is physical. Router translates between them.</p>

<div class="mermaid">
flowchart LR
  W["Workload<br />intent, risk, context, modality"] --&gt; R["Router<br />policy + selection + learning"]
  R --&gt; P["Pool<br />models, queues, cache, hardware"]
  P --&gt; R
  R --&gt; O["Outcome<br />quality, latency, cost, safety"]
  O --&gt; W
  O --&gt; R
</div>

<p>A future router should know when CUDA is overloaded, when ROCm is cost-effective, when XPU is sufficient, when CPU/local is preferable for privacy, and when preserving KV cache is worth more than reselecting a theoretically better model.</p>

<h2 id="observability-the-router-must-leave-evidence-behind">Observability: The Router Must Leave Evidence Behind</h2>

<p>If the system makes semantic decisions, operators need to see those decisions.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-observability-replay-trace.png" alt="Pipeline with Request, Signal Trace, Decision Trace, Route, Response, Headers, Replay, and Audit Record." />
  <figcaption>Traces and replay turn routing from hidden magic into debuggable infrastructure.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Trace surface</th>
      <th>It explains</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Signal trace</td>
      <td>Which signals ran, what matched, and what raw values or confidence appeared</td>
    </tr>
    <tr>
      <td>Projection trace</td>
      <td>How evidence became derived route facts</td>
    </tr>
    <tr>
      <td>Decision trace</td>
      <td>Which policy matched and why it outranked alternatives</td>
    </tr>
    <tr>
      <td>Selection trace</td>
      <td>Which candidates were considered and which model won</td>
    </tr>
    <tr>
      <td>Looper trace</td>
      <td>Which panel, rounds, workers, judge, or synthesis path executed</td>
    </tr>
    <tr>
      <td>Learning trace</td>
      <td>Base model, proposal model, final model, protection action, adaptation reason, cache and switch evidence</td>
    </tr>
    <tr>
      <td>Plugin trace</td>
      <td>Which cache, RAG, memory, tool, safety, verification, and replay behaviors executed</td>
    </tr>
    <tr>
      <td>Header trace</td>
      <td>What <code class="language-plaintext highlighter-rouge">x-vsr-*</code> metadata went to the gateway or client</td>
    </tr>
    <tr>
      <td>Replay record</td>
      <td>The durable request/response/decision/model/path artifact for debugging and evaluation</td>
    </tr>
  </tbody>
</table>

<p>Replay is not only for dashboards. It is <strong>the second control plane</strong>. The first control plane makes the live decision; replay preserves enough evidence to debug that decision, compare it against alternatives, attach outcomes, and produce offline recipe patches.</p>

<p>If the router records what it saw, what it decided, what happened, and how users, agents, verifiers, or evals responded, the next generation of selectors, thresholds, learning strategies, and recipes can improve.</p>

<p>Without traces, the router is another opaque model. With traces, it becomes a system component.</p>

<h2 id="evaluation-the-router-is-a-frontier">Evaluation: The Router Is a Frontier</h2>

<p>The wrong way to evaluate a router is to count features. A router with many knobs can still be bad. The right question is whether it improves the frontier between quality, cost, latency, safety, privacy, reliability, and hardware efficiency.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/vllm-sr-cost-quality-frontier.png" alt="Cost quality frontier with Small, RAG, Frontier, Router, and Waste points." />
  <figcaption>Routing intelligence should move workloads toward the efficient frontier.</figcaption>
</figure>

<table>
  <thead>
    <tr>
      <th>Evaluation axis</th>
      <th>What should improve</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Quality-cost frontier</td>
      <td>Same or better quality with lower model spend</td>
    </tr>
    <tr>
      <td>Latency frontier</td>
      <td>Better SLO compliance without blindly choosing weak models</td>
    </tr>
    <tr>
      <td>Safety and privacy</td>
      <td>Better handling of PII, jailbreak, tool exposure, and local/private paths</td>
    </tr>
    <tr>
      <td>Factuality</td>
      <td>More grounded answers through RAG and verification where needed</td>
    </tr>
    <tr>
      <td>Collaboration value</td>
      <td>Better output from Fusion, ReMoM, Flow, or Ratings than single-model baselines</td>
    </tr>
    <tr>
      <td>Session stability</td>
      <td>Fewer broken tool loops and fewer harmful model switches</td>
    </tr>
    <tr>
      <td>Fleet efficiency</td>
      <td>Better queue, cache, hardware, and pool utilization</td>
    </tr>
    <tr>
      <td>Debuggability</td>
      <td>More replayable and explainable decisions</td>
    </tr>
    <tr>
      <td>Learning loop</td>
      <td>Better calibration from traces, outcomes, and offline evals</td>
    </tr>
  </tbody>
</table>

<p>Router evaluation, fleet simulation, replay traces, RouterArena-style comparison, Looper evals, and offline recipe learning matter because semantic routing is infrastructure. It has to be measured like infrastructure.</p>

<h2 id="the-part-i-care-about-most">The Part I Care About Most</h2>

<p>The most important design belief in vLLM SR is not any single signal, plugin, model, algorithm, or hardware platform. It is the separation of concerns.</p>

<p>Signals observe. Projections coordinate. Decisions express policy. Selection algorithms choose one model. Looper algorithms scale capability through model collaboration. Router Learning adapts and protects within recipe boundaries. Plugins mutate behavior. Bindings accelerate hot-path ML. Envoy integration places semantic policy at the traffic boundary. Model cards connect logical names to real capabilities. Hardware metadata connects semantic constraints to physical execution. Observability makes every decision accountable.</p>

<p>That separation is what lets the router evolve without turning every new idea into a fork of the hot path.</p>

<p>A new jailbreak detector can become a signal. A new risk formula can become a projection. A new compliance rule can become a decision. A new selector can become a selection algorithm. A new panel or workflow primitive can become a Looper algorithm. A new verifier can become a plugin. A new accelerator lane can become model-card metadata. A new benchmark can become an evaluation loop. A new fleet model can feed pool-aware routing. A new learning strategy can propose better candidates without rewriting policy.</p>

<p>That is why I like the phrase <strong>Intelligence Control Plane</strong>. Not because the router is always intelligent by itself, but because it gives the system a place to allocate intelligence deliberately.</p>

<p>The first stage of AI infrastructure made intelligence callable.</p>

<p>The next stage has to make intelligence allocatable, explainable, and optimizable.</p>

<blockquote>
  <p>Calling a model was the first abstraction. Allocating intelligence is the next one.</p>
</blockquote>

<p>That is the philosophy of vLLM SR.</p>

<h2 id="source-trail">Source Trail</h2>

<p>This article is based on the vLLM Semantic Router codebase, website research archive, vLLM project blog posts, my earlier essays on LLM routing, and infrastructure references around Envoy, vLLM, ROCm, Intel XPU, and Gateway API inference routing.</p>

<table>
  <thead>
    <tr>
      <th>Source</th>
      <th>Why it matters here</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>vLLM Semantic Router research archive</td>
      <td>Paper table and system-design throughline</td>
    </tr>
    <tr>
      <td>Canonical config and routing contract code</td>
      <td>Recipe-as-contract, signal/projection/decision surfaces, supported algorithm and plugin catalog</td>
    </tr>
    <tr>
      <td>Signal-Decision Driven Architecture</td>
      <td>Shift from single classification to signal-decision routing</td>
    </tr>
    <tr>
      <td>Iris / Athena / Themis release posts</td>
      <td>Signals, model selection, plugins, memory, replay, AMD ROCm, and release progression</td>
    </tr>
    <tr>
      <td>Fusion API and Looper tutorials</td>
      <td>Multi-model collaboration path: Confidence, Ratings, Fusion, ReMoM, Router Flow</td>
    </tr>
    <tr>
      <td>Router Learning docs and proposal</td>
      <td>Adaptation, protection, memory, replay, outcomes, and offline recipe learning</td>
    </tr>
    <tr>
      <td>Session-Aware Agentic Routing</td>
      <td>Tool-loop continuity, provider state, prefix cache, and safe switch boundaries</td>
    </tr>
    <tr>
      <td>Agentic Routing on AMD ROCm</td>
      <td>AMD ROCm deployment, agentic recipe, dashboard, learning, and replay</td>
    </tr>
    <tr>
      <td>ExtProc runtime pipeline notes</td>
      <td>Header/body/model-routing/response phases, protocol normalization, replay and response-time checks</td>
    </tr>
    <tr>
      <td>Envoy External Processing filter</td>
      <td>Semantic policy path versus main traffic data plane</td>
    </tr>
    <tr>
      <td>Native binding capability matrix</td>
      <td>Candle, ML binding, NLP binding, ONNX, and Stub capability boundaries</td>
    </tr>
    <tr>
      <td>vLLM platform documentation</td>
      <td>CUDA, ROCm, XPU, CPU, and deployment background</td>
    </tr>
    <tr>
      <td>AMD ROCm / AITER / vLLM ROCm attention backend</td>
      <td>AMD acceleration path and ROCm serving ecosystem</td>
    </tr>
    <tr>
      <td>Intel XPU kernels / IPEX XPU ecosystem</td>
      <td>Intel accelerator serving path</td>
    </tr>
    <tr>
      <td>Kubernetes Gateway API Inference Extension</td>
      <td>Standardization direction for inference routing at the gateway layer</td>
    </tr>
  </tbody>
</table>]]></content><author><name></name></author><summary type="html"><![CDATA[vLLM Semantic Router is not a smarter model picker. It is a control plane for turning semantic work into explainable capability paths across models, tools, memory, policy, gateways, and hardware.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://liuxunzhuo.com/images/blog/vllm-sr-intelligence-control-plane.png" /><media:content medium="image" url="https://liuxunzhuo.com/images/blog/vllm-sr-intelligence-control-plane.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Semantic Routing as Energy Infrastructure</title><link href="https://liuxunzhuo.com/semantic-routing-as-energy-infrastructure/" rel="alternate" type="text/html" title="Semantic Routing as Energy Infrastructure" /><published>2026-06-22T00:00:00+00:00</published><updated>2026-06-22T00:00:00+00:00</updated><id>https://liuxunzhuo.com/semantic-routing-as-energy-infrastructure</id><content type="html" xml:base="https://liuxunzhuo.com/semantic-routing-as-energy-infrastructure/"><![CDATA[<p>Six months ago, I wrote <a href="https://www.liuxunzhuo.com/llm-routing/">The Second Half of LLM Routing</a>. At the time, my argument was that LLM routing was reaching a turning point. The first half of routing made models look like <strong>manageable backend services</strong>: unified API entry points, token quotas, retries, fallbacks, observability, load balancing, and cost controls.</p>

<p>That work mattered because it made AI production systems possible.</p>

<p>But it also started to converge. Once every AI gateway begins to look like the same recipe, the next question is no longer how to forward requests more reliably. The question becomes what “routing” should mean when the backend is no longer a deterministic service, but a model that can <strong>reason, act, call tools, fail in subtle ways, and change behavior through feedback</strong>.</p>

<p>Back then, I described the second half this way:</p>

<blockquote>
  <p>In the first half, routing transports requests. In the second half, routing builds collective intelligence.</p>
</blockquote>

<p>I still believe that, but after another half year of watching enterprise AI adoption, open source inference, model releases, agentic coding, and infrastructure teams trying to control real token bills, I would say it more directly.</p>

<p>The second half of routing is not only the move from endpoint selection to behavior control. It is about <strong>intelligence resource allocation</strong>: deciding how much intelligence each piece of semantic work deserves, where that intelligence should run, and what cost, latency, privacy exposure, hardware capacity, and energy footprint the system is allowed to spend.</p>

<p>That is why semantic routing now feels less like an API gateway problem and more like energy infrastructure.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-intelligence-budget.jpg" alt="Diagram showing semantic work flowing through an intelligence budget into local, open, frontier, verify, and edge paths." />
  <figcaption>Semantic routing budgets intelligence before the system spends compute.</figcaption>
</figure>

<h2 id="1-the-bill-arrives-before-the-architecture">1. The Bill Arrives Before the Architecture</h2>

<p>Every computing era begins by making a scarce resource feel abundant.</p>

<p>The industrial age made mechanical force portable. The cloud era made compute elastic. The AI era has made something stranger callable: intelligence, exposed through APIs, metered by tokens, and inserted into millions of workflows.</p>

<p>The first visible effect is acceleration. A frontier model makes a product feel smarter. An agentic coding tool changes how developers work. A support assistant compresses repetitive labor. The new resource looks flexible, almost liquid.</p>

<p>Then the bill arrives, and the architecture becomes visible.</p>

<h4 id="salesforce-token-spend-becomes-architecture">Salesforce: Token Spend Becomes Architecture</h4>

<p>In May 2026, <a href="https://www.businessinsider.com/marc-benioff-salesforce-anthropic-spend-tokens-slack-2026-5">Business Insider reported</a> that Salesforce CEO Marc Benioff said the company could spend around $300 million this year on Anthropic tokens. The number is eye-catching, but <strong>the architecture question behind it matters more</strong>.</p>

<p>Benioff pointed toward an intermediary layer that decides which inputs deserve a frontier model and which can be handled by smaller models. That is the moment model choice stops feeling like a developer preference and starts becoming infrastructure strategy.</p>

<h4 id="microsoft-tool-choice-becomes-control">Microsoft: Tool Choice Becomes Control</h4>

<p>Around the same time, <a href="https://www.theverge.com/tech/930447/microsoft-claude-code-discontinued-notepad">The Verge reported</a> that Microsoft was preparing to wind down many Claude Code licenses internally and move more developers toward GitHub Copilot CLI. The point is not a verdict on Claude Code; the report described it as popular inside Microsoft. The point is that <strong>popularity did not settle the architecture</strong>.</p>

<p>At enterprise scale, an AI coding tool is also a security boundary, a developer workflow, a cost center, and a platform surface. That is not per-request semantic routing, but it is the same discipline: raw capability is only one variable; <strong>control of the decision layer</strong> starts to matter just as much.</p>

<h4 id="red-hat-hybrid-ai-needs-routing">Red Hat: Hybrid AI Needs Routing</h4>

<p><a href="https://www.redhat.com/en/blog/agentic-paradox-and-case-hybrid-ai">Red Hat framed</a> a related tension as the “agentic paradox”: frontier models are often the fastest path to agentic adoption, but <strong>routing every agentic workload to them becomes difficult to sustain</strong> at enterprise scale because of cost, latency, confidentiality, sovereignty, and control.</p>

<h4 id="nvidia-the-supply-side-gets-faster">NVIDIA: The Supply Side Gets Faster</h4>

<p>There is also a supply-side version of the same pressure. <a href="https://developer.nvidia.com/blog/scaling-token-factory-revenue-and-ai-efficiency-by-maximizing-performance-per-watt/">NVIDIA recently described</a> AI data centers as token factories, arguing that AI efficiency and revenue scale through better performance per watt. That is exactly what frontier hardware and inference engine teams are trying to do: <strong>squeeze more useful tokens out of every watt of power and every dollar of infrastructure</strong>.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-ai-adoption-signals.jpg" alt="Diagram showing token bill, tool surface, hybrid AI, and power efficiency converging into resource discipline." />
  <figcaption>Four pressure signals converge into resource discipline: token spend, tool-surface governance, hybrid deployment, and power efficiency.</figcaption>
</figure>

<p>These stories are not identical. One is about token bills. One is about the cost and governability of AI tool surfaces. One is about hybrid AI. One is about performance per watt. But together they show the same transition:</p>

<p><strong>AI is moving from capability discovery to resource discipline.</strong></p>

<p>The supply side will keep improving tokens per watt per dollar. The demand side now needs to decide which semantic work deserves those tokens in the first place. <em>A faster token factory still wastes power if every workload is sent through the most expensive lane.</em></p>

<p>Frontier models remain the fastest way to discover new capabilities, but they are not, by themselves, the architecture of scale.</p>

<h2 id="2-tokens-are-not-the-unit">2. Tokens Are Not the Unit</h2>

<p>The industry likes tokens because tokens are easy to count. They are convenient for billing, quotas, and dashboards. They turn something messy, language, into something finance and infrastructure teams can track.</p>

<p>But <strong>tokens are a billing unit, not a value unit</strong>.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-tokens-not-equal.jpg" alt="Diagram showing the same token count flowing to cheap path, open model, and frontier model with different costs." />
  <figcaption>The same token count can carry very different cost, latency, energy, and intelligence density.</figcaption>
</figure>

<p>The same token count can pass through a small local model, a specialized open model, a frontier closed model, a reasoning model, or a model running on an edge device. The bill, latency, energy footprint, privacy risk, and <strong>intelligence density</strong> are all different.</p>

<p>Counting tokens is like counting kilowatt-hours without asking what the electricity powered. One kilowatt-hour used to keep a hospital operating and one kilowatt-hour wasted by an idle machine share <strong>the same unit, not the same value</strong>. AI systems have the same problem.</p>

<p>One token may be cheap autocomplete. Another may be the deciding step in a high-risk reasoning chain. One request may be a low-stakes formatting task. Another may require retrieval, verification, policy checks, and a stronger model because <strong>the failure cost is high</strong>.</p>

<p>So the real question is not:</p>

<blockquote>
  <p>How many tokens did we use?</p>
</blockquote>

<p>The real question is:</p>

<blockquote>
  <p>Did we spend the right kind of intelligence in the right place?</p>
</blockquote>

<p>That is a different kind of accounting. It asks the system to <strong>understand the semantic workload before spending compute</strong>. Is the task simple or ambiguous? Private or public? Reversible or dangerous? Latency-sensitive or quality-sensitive? Cheap enough to answer locally, or important enough to escalate?</p>

<p>This is where token economics becomes system design.</p>

<h2 id="3-frontier-by-default-is-a-temporary-architecture">3. Frontier-by-Default Is a Temporary Architecture</h2>

<p>The simplest AI architecture is always:</p>

<blockquote>
  <p>Send everything to the strongest model.</p>
</blockquote>

<p>It is easy to build. It is easy to explain. It gives good demos. It minimizes engineering effort in the short term because the model absorbs complexity that the system does not know how to model yet.</p>

<p>In the early stage of adoption, that is rational.</p>

<p>When a team is trying to prove AI works, frontier-by-default is often the fastest path. It reduces product risk. It gives users a better first experience. It lets teams focus on workflow and adoption instead of building a routing layer too early.</p>

<p>But <strong>architecture that works for discovery often breaks at scale</strong>.</p>

<p>When every workflow becomes AI-assisted, when agents run continuously, when coding tools expand across thousands of developers, when customer support, sales, analytics, compliance, and internal operations all begin to consume model calls, the question changes.</p>

<p>The company no longer asks:</p>

<blockquote>
  <p>Can AI do this?</p>
</blockquote>

<p>It asks:</p>

<blockquote>
  <p>Can we afford this, control this, govern this, and scale this?</p>
</blockquote>

<p>That is when frontier-by-default starts to look less like an architecture and more like <em>a subsidy paid by the early phase of adoption</em>.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-frontier-default.jpg" alt="Diagram comparing frontier default with a routed system that sends work to the right path." />
  <figcaption>Frontier-by-default works for discovery. Mature systems route demand across capability tiers.</figcaption>
</figure>

<p>The future is not one frontier model serving every request. The future is a heterogeneous fabric of intelligence:</p>

<ul>
  <li>frontier closed models for high-value reasoning and hard escalation paths</li>
  <li>open-weight models for controllable, private, and cost-efficient workloads</li>
  <li>small models for classification, extraction, intent detection, routing, and frequent low-risk tasks</li>
  <li>domain models for specialized knowledge and enterprise context</li>
  <li>verifiers for checking claims, actions, policies, and citations</li>
  <li>retrieval systems and memory layers for grounding</li>
  <li>edge models for local privacy, low latency, and near-zero marginal cost</li>
  <li>different generations of hardware that still need to be used efficiently</li>
</ul>

<p>This is not anti-frontier. It is what mature infrastructure does: <strong>preserve the most capable resource for the places where it actually changes the outcome</strong>.</p>

<p>Electric grids do not route every load through the most expensive power source. Networks do not send every packet through the same path. Cloud platforms do not run every job on the largest instance type.</p>

<p>Mature systems differentiate demand, and AI systems will have to do the same.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-heterogeneous-intelligence.jpg" alt="Diagram showing a heterogeneous model pool with frontier, open, small, domain, verify, edge, GPU, CPU, and device tiers." />
  <figcaption>The mature AI stack is a heterogeneous fabric of models, verifiers, memory, and hardware tiers.</figcaption>
</figure>

<h2 id="4-hybrid-ai-is-not-just-a-deployment-topology">4. Hybrid AI Is Not Just a Deployment Topology</h2>

<p>If frontier-by-default is the temporary architecture, hybrid AI is what comes after.</p>

<p>But hybrid AI is not a slide with one cloud model, one private model, one open model, and one edge model. That is inventory. <strong>Architecture starts when the system can decide what each piece of work actually deserves.</strong></p>

<p>The architecture question is sharper:</p>

<blockquote>
  <p>Who decides where semantic work should go?</p>
</blockquote>

<p>A hybrid system without routing is just more endpoints. It may lower cost in obvious cases, but it cannot reason about the tradeoff between quality, latency, privacy, risk, and energy. The missing piece is a control layer that turns workload signals into <strong>capability paths</strong>.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-router-chain.jpg" alt="Diagram showing workload, policy, semantic router, capability path, and model pool." />
  <figcaption>A router does not only pick a model. It maps workload and policy into a capability path.</figcaption>
</figure>

<p>A path may be:</p>

<ul>
  <li>answer directly with a small model</li>
  <li>retrieve first, then answer with a mid-size model</li>
  <li>classify risk, then apply a stricter policy</li>
  <li>ask a clarification question before spending expensive reasoning</li>
  <li>run a verifier before returning the answer</li>
  <li>escalate to a frontier model only when uncertainty or failure cost justifies it</li>
  <li>keep the task on-device because privacy matters more than marginal quality</li>
</ul>

<p>This is why “the right model for every request” is a useful slogan but not the whole idea. The real unit of architecture is not always a model; it is a <strong>capability path</strong>.</p>

<h2 id="5-semantic-routing-as-energy-infrastructure">5. Semantic Routing as Energy Infrastructure</h2>

<p>At small scale, model choice feels like a quality decision. At infrastructure scale, it becomes an allocation problem, which is why I keep coming back to energy.</p>

<p>Energy here is not a decorative metaphor. I do not mean semantic routing is the power grid; I mean intelligence is now a metered, energy-consuming resource, and the system needs a way to decide when spending it is justified.</p>

<p>The wrong lesson is “use cheaper models.” Cheap-by-default is the mirror image of frontier-by-default. Both avoid judgment.</p>

<p>The real point is to <strong>budget intelligence</strong>. A small model may be enough for routine work. An open model may be right when control and cost matter. A frontier model is still worth it when reasoning depth or failure cost justifies the bill. Sometimes a verifier beats another generation step. Sometimes retrieval beats reasoning. Sometimes asking one clarifying question is the most efficient path.</p>

<p>In the old internet, routing moved packets. In AI systems, the traffic is semantic work: intent, uncertainty, context, memory, privacy risk, tool use, and action. Once traffic carries meaning, <strong>routing stops being thin forwarding and becomes allocation</strong>.</p>

<p>For me, this is the first-principles reason semantic routing matters: it treats intelligence as a resource to schedule, not a magic endpoint to call.</p>

<p>The industry is already attacking the supply side. Hardware teams and inference engine teams are doing exactly what they should do: maximize <strong>tokens per watt per dollar</strong>.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-tokens-watt-dollar.jpg" alt="Diagram showing hardware, inference engine, router, and right workload as a tokens per watt per dollar efficiency stack." />
  <figcaption>Hardware and inference engines improve token supply. Routing decides where that improved intelligence should be spent.</figcaption>
</figure>

<p>Better accelerators, better kernels, better batching, better KV-cache systems, better speculative decoding, better serving engines, and better cluster scheduling all push in the same direction: more useful tokens from the same power envelope.</p>

<p>But supply-side efficiency is only half the problem. The other half is demand-side allocation.</p>

<p>If every semantic workload can consume the most expensive path, the system is powerful but wasteful. If every workload is forced onto the cheapest path, the system is efficient but dumb. <strong>The hard problem is knowing when each path is worth it.</strong></p>

<p>That is what turns hybrid AI from a deployment pattern into an energy architecture.</p>

<h2 id="6-the-layer-we-are-missing">6. The Layer We Are Missing</h2>

<p>But an energy architecture cannot stop at the slogan level. If semantic routing is going to decide how intelligence is spent, the decision layer has to become something engineers can inspect, policy teams can constrain, and infrastructure teams can improve.</p>

<p>That is the missing layer: not another model endpoint, but the system primitives that make routing decisions expressible, observable, measurable, and compatible with the rest of the serving stack. I think it needs at least six pieces.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-primitives.jpg" alt="Diagram showing semantic router primitives: signals, memory, policy, evaluation, co-design, and transparent interfaces." />
  <figcaption>Semantic routing needs primitives that can be inspected, measured, composed, and adopted behind familiar APIs.</figcaption>
</figure>

<p><strong>1. Workload signals.</strong></p>

<p>The system has to understand more than prompt length and tenant ID. It needs signals for intent, domain, difficulty, uncertainty, privacy, safety, tool requirements, expected output type, failure cost, and historical behavior. Without workload signals, routing collapses back into <strong>static rules</strong> and cannot make intelligent allocation decisions.</p>

<p><strong>2. Routing memory.</strong></p>

<p>A router should not repeat the same decision blindly. It should remember which paths worked, which failed, which users or tasks require stricter handling, and which policies caused friction. Routing without memory cannot improve; it can only <strong>re-run yesterday’s assumptions</strong>.</p>

<p><strong>3. Policy languages.</strong></p>

<p>As routing becomes more powerful, organizations need a way to express constraints: what can run where, which data can leave the boundary, when a verifier is mandatory, when escalation is allowed, and how cost-quality tradeoffs should be handled. <strong>Natural language prompts are not enough for infrastructure policy.</strong></p>

<p><strong>4. Evaluation.</strong></p>

<p>If a router claims to be intelligent, it has to be measurable. Accuracy alone is not enough. We need cost-quality frontiers, task completion rates, latency distributions, privacy guarantees, safety outcomes, stability across multi-turn sessions, and evidence that the system improves through feedback. Otherwise “routing” becomes <strong>another hidden optimization with no accountable frontier</strong>.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-cost-quality-frontier.jpg" alt="Cost-quality frontier diagram with waste below the frontier and a good route on the frontier." />
  <figcaption>Routing intelligence should be evaluated as a cost-quality frontier, not a feature checklist.</figcaption>
</figure>

<p><strong>5. System co-design.</strong></p>

<p>I do not think this layer can be designed as an isolated policy box. The useful architecture is a co-designed loop: <strong>Workload -&gt; Router -&gt; Inference Pool</strong>. Workload signals shape routing decisions; routing decisions change batching, caching, queueing, model placement, KV-cache pressure, and hardware utilization; pool state should flow back into routing. A router that ignores the pool is incomplete, and an inference pool that ignores the workload is blind.</p>

<p><strong>6. Transparent interfaces.</strong></p>

<p>If this layer becomes important, it should be mostly invisible to applications and users. Product teams should not have to adopt a new serving surface just to benefit from better routing. OpenAI-compatible APIs, existing gateway protocols, and normal chat, completions, embeddings, and tool-calling semantics should keep working. The intelligence of the router should show up in better placement, policy, observability, and cost-quality behavior, not in a new API tax on the user.</p>

<p>That is where open source matters: not because every company will run the same router, or because one project should own the entire space, but because <strong>shared infrastructure needs shared language and shared contracts</strong>. It needs common workloads, common metrics, common failure cases, common policy concepts, and compatibility expectations, so routing can become infrastructure rather than a private product trick.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-open-control-plane.jpg" alt="Diagram showing signals, policy, memory, evaluation, co-design, and transparent interfaces feeding an open control plane over shared infrastructure." />
  <figcaption>An open control plane makes routing policy observable while preserving familiar API surfaces.</figcaption>
</figure>

<h2 id="7-why-we-built-vllm-semantic-router">7. Why We Built vLLM Semantic Router</h2>

<p>This is the problem space that led us to build <a href="https://github.com/vllm-project/semantic-router">vLLM Semantic Router</a>.</p>

<figure class="essay-figure essay-figure--logo">
  <img src="/images/blog/vllm-semantic-router-logo.png" alt="vLLM Semantic Router logo." />
  <figcaption>vLLM Semantic Router is one open-source attempt to make semantic routing concrete.</figcaption>
</figure>

<p>The project started from a simple frustration: most routing layers could tell whether a backend was alive, busy, or cheap, but they knew <strong>very little about the work itself</strong>.</p>

<p>Early AI gateways made LLMs callable and manageable. That foundation is necessary. But once a system has multiple models, policies, risk levels, and deployment boundaries, routing has to answer a harder question:</p>

<blockquote>
  <p>Given this workload, this policy, this budget, this model pool, and this risk profile, what capability path should the system choose?</p>
</blockquote>

<p>This is the part of Red Hat’s <a href="https://www.redhat.com/en/technically-speaking/open-source-AI-strategy">Technically Speaking conversation</a> between Red Hat CTO Chris Wright and Steve Watt that matters to this argument. Their discussion around vLLM Semantic Router is not framed as another model-routing demo. It is about <strong>where enterprise AI needs control</strong>: which workloads can stay private, which policies decide the route, and how a broader accelerator landscape changes the economics underneath.</p>

<figure class="essay-figure essay-video">
  <div class="essay-video-frame">
    <iframe src="https://www.youtube-nocookie.com/embed/ExbMEW-Os1I" title="Inside open source AI strategy ft. Steve Watt" loading="lazy" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen=""></iframe>
  </div>
  <figcaption>Chris Wright and Steve Watt discuss how open source AI strategy, vLLM Semantic Router, policy control, privacy, and accelerator choice fit together.</figcaption>
</figure>

<p>vLLM Semantic Router is one attempt to make that question concrete in open source. It is not the final answer, and it should not be. The field is still early: the right abstractions are being discovered, evaluation is immature, enterprises have different policies, models are changing quickly, hardware is changing more slowly, and edge, cloud, private deployment, and frontier APIs are evolving at different speeds.</p>

<p>That mismatch is exactly why routing matters. Models will keep improving, and hardware will keep improving, but <strong>mixed fleets do not automatically become intelligent systems</strong>. Someone still has to decide which request should touch which model, which data should cross which boundary, which accelerator should be used, and when the system should spend more reasoning instead of returning a cheaper answer.</p>

<p>There will be old GPUs, new GPUs, edge devices, private clusters, cloud APIs, open models, closed models, specialized models, verifiers, memory systems, and agentic tools all coexisting. The question is not whether one of them wins everything. The question is <strong>how to use all of them well</strong>.</p>

<p>The future of AI infrastructure is not one model. It is a system that knows how much intelligence each task deserves, and can explain the boundary it drew.</p>

<h2 id="8-before-power-becomes-tokens">8. Before Power Becomes Tokens</h2>

<p>My bet is simple: the next important AI infrastructure layer will sit before the token is generated. It will decide whether a piece of work deserves frontier reasoning, open-model inference, local compute, retrieval, verification, or no compute yet.</p>

<p>That layer is semantic routing.</p>

<p>In the cloud era, resource allocation was mostly deterministic. You asked for a machine, a container, or a node with a known shape: 1C / 2G, a memory limit, a CPU quota, a namespace, a cgroup. <strong>The boundary was explicit.</strong> The system could isolate it, meter it, schedule it, and enforce it.</p>

<p>AI changes the allocation primitive. The request is often a prompt, but the prompt carries more than text. It carries intent, uncertainty, context, risk, privacy, expected quality, and failure cost. In the cloud era, users asked for resources by <strong>declaring a shape</strong>. In the AI era, they increasingly ask for resources by <strong>describing a goal</strong>. The boundary is no longer only CPU and memory. <strong>The boundary is semantic.</strong></p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-allocation-boundary.jpg" alt="Diagram comparing cloud-era deterministic compute allocation with AI-era semantic allocation through prompts and semantic routing." />
  <figcaption>Cloud infrastructure allocates deterministic compute boundaries. AI infrastructure has to allocate semantic boundaries.</figcaption>
</figure>

<p>This is why semantic routing is closer to <strong>virtualization</strong> than to a load balancer. Cloud virtualization turned physical machines into isolated, secure, controllable pools of compute. Applications expressed requirements; the infrastructure handled placement, limits, isolation, and enforcement.</p>

<p>AI needs the same abstraction for intelligence. A user should not have to reason directly about the frontier model, the open model, the local model, the verifier, or the accelerator generation underneath. Those are the substrate: intelligence and energy. The interface should be <strong>preference and objective</strong>: quality target, latency budget, privacy boundary, cost ceiling, safety policy, sovereignty constraint, and risk tolerance.</p>

<figure class="essay-figure essay-figure--diagram">
  <img src="/images/blog/semantic-routing-intelligence-virtualization.jpg" alt="Diagram showing semantic routing as intelligence virtualization between user preferences and pools of models, verifiers, and accelerators." />
  <figcaption>Semantic routing virtualizes intelligence: applications express preferences, while the router controls placement across models, verifiers, and accelerators.</figcaption>
</figure>

<p>Every token begins as something physical: watts, hardware time, cooling, memory bandwidth, model capacity, and operational risk. Hardware and inference engines will keep making that conversion more efficient. But efficiency is incomplete if the system still spends its best intelligence on the wrong work.</p>

<p>This is the kind of control plane I think AI needs: one that reads workload signals, applies policy, respects privacy, understands the model and hardware pool, and decides how much intelligence a request is allowed to consume. In older systems, cgroups and namespaces made compute boundaries enforceable. AI needs the same kind of enforcement around intelligence: <strong>not only what can run, but how much reasoning, where, and under which constraints</strong>.</p>

<p>Frontier models remain essential. They expand what builders can imagine and show the rest of the stack what it must learn to support. But mature infrastructure is not defined by sending every request to the strongest resource. It is defined by <strong>knowing when that resource changes the outcome</strong>.</p>

<p>The first phase of AI was about access to intelligence. The next phase is about allocation.</p>

<p>Six months ago, I wrote that the second half of LLM routing would build collective intelligence. I would put it more sharply now:</p>

<blockquote>
  <p>The next stage of routing is where AI systems learn to budget intelligence.</p>
</blockquote>

<p>Not just dollars. Watts, latency, privacy exposure, hardware scarcity, failure risk, and human trust.</p>

<p>That is why semantic routing is energy infrastructure: it defines the boundary of AI resource allocation <strong>before power becomes tokens</strong>.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Not every token deserves a frontier model. Every semantic workload deserves the right intelligence budget.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://liuxunzhuo.com/images/blog/semantic-routing-energy-cover.jpg" /><media:content medium="image" url="https://liuxunzhuo.com/images/blog/semantic-routing-energy-cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">The Second Half of LLM Routing</title><link href="https://liuxunzhuo.com/llm-routing/" rel="alternate" type="text/html" title="The Second Half of LLM Routing" /><published>2025-12-20T00:00:00+00:00</published><updated>2025-12-20T00:00:00+00:00</updated><id>https://liuxunzhuo.com/llm-routing</id><content type="html" xml:base="https://liuxunzhuo.com/llm-routing/"><![CDATA[<p><strong>tldr: We’re reaching LLM routing’s halftime.</strong></p>

<p>Over the past few years, “LLM routing” has been treated as <strong>traditional networking problem in gateway engineering for the AI era</strong>: reliably send requests to a model, stream tokens steadily, and keep latency, cost, and availability within an SLA. It worked — and it worked <em>too</em> well. So well that it’s getting platformized and standardized into a reusable industrial recipe.</p>

<p>So what’s suddenly different?</p>

<p>In one sentence: <strong>models are exploding in number; the traditional AI-gateway recipe now works — and it generalizes — so AI gateways are multiplying.</strong> Not just for a single provider, but across providers; not just for one deployment style, but across the whole chain — from cloud APIs to self-hosted inference clusters.</p>

<p><img src="https://p.ipic.vip/rb5k3w.png" alt="" /></p>

<p>It’s getting hard to say “I built an AI gateway,” because you quickly realize what you built is almost the same thing everyone else built.</p>

<p>When a general recipe solves more and more problems, incremental methods get steamrolled by standardized pipelines. The game shifts from <em>solving problems</em> to <em>defining problems</em>. Evaluation becomes more important than adding more features in the same road.</p>

<p>I think the second half of LLM routing starts at the same moment: <strong>when innovation gets squeezed out, we should rethink what “routing” even means in the AI era.</strong></p>

<h2 id="the-first-half">The first half</h2>

<p>To understand the first half, look at its winners.</p>

<p>In the world of LLM routing, what’s the most “useful,” most “shippable,” and most “sellable to enterprises”? The winners are a complete <strong>Traditional AI Gateway / Inference Gateway</strong> capability set — productized faster than anything else:</p>

<p><img src="https://p.ipic.vip/0fg5ju.png" alt="" /></p>

<ul>
  <li>Like a traditional API gateway: unify backend LLM services, handle auth, token quotas, rate limiting, circuit breaking &amp; retries, failover, canary releases, A/B tests, and auditing.</li>
  <li>Like an inference engine: load-awareness, queues &amp; priority, prefix caching, P/D disaggregation, and scheduling across endpoints.</li>
</ul>

<p><img src="https://p.ipic.vip/ug06tm.png" alt="" /></p>

<p>These solved the first-half core problem: <strong>making LLMs behave like a manageable backend service.</strong></p>

<p>They share one thing: routing decisions are mostly based on <em>system state</em> (health, load, price, SLA, tenant policy). Models are endpoints; requests are packets.</p>

<p><strong>Sure, you can “pick a model.” But you don’t have to answer “why,” and you don’t have to own whether the task actually got done.</strong></p>

<p>That was perfectly reasonable in the first half: when a system is just getting started, fast productization and reliability <em>are</em> the value.</p>

<h2 id="the-recipe">The recipe</h2>

<p>So what force kicks off the second half?</p>

<p>A brutal-but-true structural force: <strong>homogenization</strong>.</p>

<p>If you study multiple AI gateways seriously, you reach a very unromantic conclusion: they look extremely similar. Innovation space gets compressed into “plugin lists” and “product packaging.” It’s not that people aren’t smart — it’s that the first-half objective function naturally converges to the same engineering solution.</p>

<p>You almost always see the same recipe:</p>

<ul>
  <li>A single unified entry point (usually an OpenAI-style API) that hides provider differences.</li>
  <li>Token-based quota &amp; cost governance (otherwise finance can’t close the books).</li>
  <li>The reliability trio: retries, fallback, circuit breaking, plus canary/AB.</li>
  <li>Observability &amp; audit: usage, cost, errors, latency, tenant attribution.</li>
  <li>Inference scheduling &amp; optimization: queues, priorities, load-awareness, prefix caching and reuse.</li>
</ul>

<p>That’s why it’s called a “recipe”: it’s general, replicable, and industrializable.</p>

<p>Once the recipe is established, the industry enters a familiar phase — the recipe crushes incremental methods.</p>

<p>So the question becomes sharp:</p>

<p><strong>If the first-half recipe already works and gets increasingly standardized, what are we even playing in the second half? Just keep adding items to the plugin menu?</strong></p>

<p>I don’t think so. Because <strong>the nature of what sits behind the routing layer has changed.</strong></p>

<p>In the traditional API world, backend services are closer to deterministic systems: you call an API, it either succeeds or fails, and the semantics are relatively stable. Gateway traffic routing makes perfect sense.</p>

<p>But in the LLM world, backend services are generative — and increasingly agent-like: they <strong>reason</strong>, <strong>act</strong>, call tools, and change the external world. The “backend” is no longer a passive service. It’s an entity that makes decisions, makes mistakes, and can self-reinforce.</p>

<p>If you still treat routing as pure forwarding, you’re effectively trying to govern a “thinking, acting” system with the abstraction of a transparent proxy.</p>

<p>So the second-half recipe must upgrade:</p>

<p><strong>Make decisions more deliberative — and let the system become more reliable through feedback from the environment.</strong></p>

<h3 id="routing-needs-reasoning--acting">Routing needs Reasoning + Acting</h3>

<p>The core of ReAct isn’t “write a longer chain-of-thought.” It’s interleaving <strong>reasoning</strong> and <strong>actions</strong>: reasoning helps planning, error correction, and policy updates; actions connect the system to the environment to obtain observations — reducing hallucinations and improving interpretability.</p>

<p><img src="https://p.ipic.vip/obectb.png" alt="" /></p>

<p>Bring this into routing and you get a direct conclusion: routing shouldn’t just make decisions based on static signals. Routing should also <strong>think first, act, then decide</strong>. It needs intelligence.</p>

<p>The “actions” can be concrete: retrieve first, run a verifier first, have an SLM clarify intent first, run safety checks on high-risk spans first, do a lightweight probe (e.g., use a cheap model to test uncertainty), and only then decide whether to escalate to a stronger model.</p>

<p>In other words, second-half routing is not just a traffic router.</p>

<p>It is an agent brain doing <strong>decision-time compute</strong>.</p>

<h3 id="routing-needs-search-backtracking-and-self-evaluation">Routing needs search, backtracking, and self-evaluation</h3>

<p>Tree of Thoughts (ToT) says: standard LM inference is a left-to-right greedy process at the token level, but complex tasks require exploration, foresight, and backtracking. So ToT treats “thinking” as searchable intermediate states: expand multiple paths, self-evaluate, and roll back when needed.</p>

<p><img src="https://p.ipic.vip/bdte5j.png" alt="" /></p>

<p>Bring that into routing and you end up redefining what “a route” even is: routing isn’t an if-else or a one-shot classification. It’s an explorable “strategy tree” — different paths correspond to different capability bundles (model / reasoning mode / tools / verification / caching / audit).</p>

<p>For the same request, you might expand multiple candidate paths:</p>

<ul>
  <li>Path A: SLM direct answer (fast, cheap, risky)</li>
  <li>Path B: mid model + retrieval (steady, higher cost)</li>
  <li>Path C: strong reasoning model + verifier (most reliable, most expensive)</li>
  <li>Path D: clarify first, then answer (push uncertainty to the user)</li>
</ul>

<p>The ToT lesson is: don’t pretend you can one-shot it. Allow the routing layer to do bounded search, using self-evals and external observations to choose next steps — and backtrack when necessary. Routing shifts from “splitting traffic” to “planning.”</p>

<h3 id="routing-needs-feedback-and-reflexion">Routing needs feedback and reflexion</h3>

<p>Reflexion goes one step further: it decouples “getting stronger from mistakes” from weight updates. You don’t necessarily need to fine-tune. The system can turn task feedback into language-based reflection, write it into episodic memory, and make future decisions better.</p>

<p><img src="https://p.ipic.vip/prhyq3.png" alt="" /></p>

<p>Bring that into routing and you get the most critical step of the second half: the routing system must be reflexive. Otherwise it will keep repeating the same class of errors.</p>

<p>And feedback sources can be painfully real: positive/negative user feedback, whether the task was resolved in one pass, tool-call failures, factuality checks, KV-cache hit rates, whether a policy caused complaints or compliance incidents… These aren’t “training data,” but they are the most valuable online signals a system can get.</p>

<p>So the second-half recipe becomes clearer:</p>

<ul>
  <li>The first half: “unified entry + token governance + reliability + pluginization + observability.”</li>
  <li>The second half must add: “semantic signals + think-then-decide + tree search + feedback/reflexion.”</li>
</ul>

<p>That’s the bridge: homogenization isn’t bad — it means the infrastructure layer is getting solved. Real incremental innovation must move to a new abstraction layer:</p>

<blockquote>
  <p>move reasoning / acting / searching / reflexion up into the routing layer.</p>
</blockquote>

<h3 id="theres-an-even-deeper-driver-collective-intelligence">There’s an even deeper driver: collective intelligence</h3>

<p>There’s also a more “anthropological” driver:</p>

<p><strong>Human intelligence has never been just solo brilliance — it’s a composition of collective intelligence.</strong></p>

<p>Teams have a measurable “collective intelligence factor” that explains performance across tasks, beyond just the maximum or average individual IQ.</p>

<p><img src="https://p.ipic.vip/1fi45o.png" alt="" /></p>

<p>MIT’s Center for Collective Intelligence even frames its core question as: how can people and machines be connected so they can “collectively act more intelligently,” i.e., build “superminds.”</p>

<p>Bring that lens into LLM systems and you get a natural analogy:</p>

<p><strong>LLMs are moving from “one big model fighting alone” to “a collective system of multiple models + tools + verifiers + memory.”</strong></p>

<p><strong>Routing should be the organizing mechanism of that collective intelligence.</strong></p>

<p>If you treat SLMs, LLMs, reasoning models, verifiers, retrievers, and tool executors as different “experts,” then the second-half routing task is no longer “pick an endpoint.” It becomes the classic collective-intelligence problem: diversity, independence, decentralization, and aggregation — letting the system collaborate without groupthink, and aggregating results into a useful delivery for the user.</p>

<p>That’s why I say second-half routing is more like a “brain.” It’s not just dispatching traffic — it’s organizing an intelligent group.</p>

<h2 id="the-second-half">The second half</h2>

<p>The core change of the second half can be summarized in one sentence:</p>

<p><strong>the object of routing shifts from endpoints to behavior (system behavior).</strong></p>

<p><img src="https://p.ipic.vip/esuujy.png" alt="" /></p>

<p>You’re no longer just choosing “which model.” You’re choosing “how the system should behave”:</p>

<ul>
  <li>Should we enable reasoning? At what intensity?</li>
  <li>Should we clarify first, then answer? Retrieve first, then reason?</li>
  <li>Should we run a verifier? Force citations? Enable stricter audit policies?</li>
  <li>If semantics drift across turns, should the strategy migrate accordingly?</li>
  <li>Is the failure cost high? Should we be conservative or aggressive?</li>
</ul>

<p>If first-half routing is traffic control, second-half routing is closer to an <strong>Intelligence Control Plane</strong>: decisions driven by signals, constrained by policy, uncertainty reduced via search and actions, and continuously evolved through feedback and reflexion.</p>

<p>And this forces you to redo three things: Evaluation, Stateful, Learning. Because the moment you optimize for “best system behavior,” you’ll realize single-turn accuracy does not represent real-world utility.</p>

<h2 id="thesis-system-intelligence">Thesis: System Intelligence</h2>

<p>The next stage is system intelligence: pushing intelligence up to the system level.</p>

<p>Under a mixture-of-models (SLM + LLM) architecture across edge + cloud, users shouldn’t need to care which model got called — the experience should feel more like “Auto”: the system chooses the capability path.</p>

<p>There are three directions. But they’re not three feature cards — they are three parts of a closed loop: <strong>decision, collaboration, governance</strong>.</p>

<p><img src="https://p.ipic.vip/co9tln.png" alt="" /></p>

<h3 id="1-semantic-routing-signal-driven-decision">1) Semantic Routing: signal-driven decision</h3>

<p>Capture higher-value signals — the semantic signals we used to ignore.</p>

<ul>
  <li>In the first half, signals mostly came from system state: load, health, cost.</li>
  <li>In the second half, signals must come from semantics and task state: domain, intent, uncertainty, risk level, factuality cues, user-feedback trajectories, hidden attack graphs inside conversations, etc.</li>
</ul>

<p>More importantly: these signals shouldn’t just be used to “stamp a label.” They should feed into a <strong>Think-then-Decide</strong> loop: reason about what we’re missing and what we’re uncertain about, act to fill the gaps, then make the final decision (a routing-native version of ReAct).</p>

<h3 id="2-cross-llm-intelligence-make-the-experts-collaborate">2) Cross-LLM Intelligence: make the experts collaborate</h3>

<p>If you view the system as collective intelligence, Cross-LLM is not “pick one” — it’s “divide work + aggregate.”</p>

<p>Different models vary wildly across tasks. Different verifiers, retrievers, and tool executors each excel at different subtasks. The second half is about enabling them to collaborate with minimal coordination overhead, while preserving independence to avoid error amplification through resonance (the classic failure mode of group systems).</p>

<ul>
  <li>ToT gives a direct playbook: treat “what to do next” as a tree search, choose paths using self-evaluation and external feedback, backtrack when needed.</li>
  <li>Reflexion provides another axis: write failures into reusable reflective memory as a prior for future aggregation and scheduling — the system becomes more and more like a real team as it runs.</li>
</ul>

<h3 id="3-guardrails-governance-is-not-an-add-on--its-the-team-norm-of-collective-intelligence">3) Guardrails: governance is not an add-on — it’s the “team norm” of collective intelligence</h3>

<p>Once you build a collective system, the role of guardrails changes:</p>

<p>It’s not just blocking dangerous content. It’s closer to organizational: permissions, audits, norms — who can do what; which scenarios must escalate to stricter paths; which actions require double checks (verifiers); which information must cite sources; which failures require mandatory postmortems written into reflective memory.</p>

<p>In multi-turn conversations, attackers can decompose harmful intent into multiple harmless-looking prompts, gradually steering toward the target through a dialogue graph. Second-half guardrails must have <strong>session-level state</strong> and <strong>graph-level evidence</strong>, otherwise single-turn scanning is trivially bypassed.</p>

<h2 id="where-it-lives">Where it lives</h2>

<p>System intelligence can live in three places — more like three product lines:</p>

<p><img src="https://p.ipic.vip/x3f23n.png" alt="" /></p>

<ul>
  <li><strong>In-engine</strong>: closer to inference engine. Good for multi-LoRA auto-selection, cross-instance semantic caching/stateful communication, and low-latency built-in guardrails.</li>
  <li><strong>Above-LLM</strong>: a cross inference engine / external-provider control plane. Good for multi-model collaboration, memory management, policy search, and reflexion loops. It looks like an agent, but I prefer to call it the “brain above LLMs”: organizing collective intelligence.</li>
  <li><strong>On-edge</strong>: a local-first product line. Put a lightweight intelligent router + SLM on-device to handle privacy-sensitive and high-frequency requests with near-zero marginal cost. When uncertainty, task difficulty, or policy requires more capability, the router escalates to remote LLM providers.</li>
</ul>

<p>Routing becomes not only a control plane for cloud models, but also a <strong>boundary manager between local and remote intelligence</strong> — optimizing quality/cost and data exposure, connectivity, and energy.</p>

<h2 id="evaluation-matters">Evaluation Matters</h2>

<p><img src="https://p.ipic.vip/4br1qz.png" alt="" /></p>

<p>As models multiply and routing gets smarter, we can almost predict what happens next: more and more LLM routers —</p>

<p>open-source, commercial, cloud-native, bundled with inference engines.</p>

<p><img src="https://p.ipic.vip/kyxn0o.png" alt="" /></p>

<p>The hard question is: <strong>how do we evaluate an intelligent router?</strong></p>

<p>For traditional gateways, evaluation is straightforward: latency, throughput, SLA, error rate, cost.</p>

<p>But second-half routing doesn’t just pick an endpoint; it picks behavior: when to reason, when to retrieve, when to clarify, when to refuse, when to escalate to heavier paths.</p>

<p>So evaluation must upgrade:</p>

<p>What dimensions should define “good system intelligence”? Task completion rate? Multi-turn efficiency? Stability and consistency? Risk and compliance? The Pareto frontier of cost vs quality? Or whether the system becomes more reliable under long-term feedback?</p>

<p><img src="https://p.ipic.vip/cael2u.png" alt="" /></p>

<p>Interestingly, we’re already seeing early “evaluation systems” emerge — for example, <strong>RouterArena: An Open Platform for Comprehensive Comparison of LLM Routers</strong>: a public platform/leaderboard that puts routers under the same dataset, difficulty tiers, and metrics — and supports automated updates.</p>

<p>At minimum, it signals one thing: routing intelligence must be measurable. Otherwise it’s a castle in the air — and the narrative will quickly shift from “what features do you have” to “how good are you under the same constraints.”</p>

<p>This will take real effort and real resources.</p>

<h2 id="in-the-end">In the End</h2>

<p>Looking back at the first-half game:</p>

<ul>
  <li>We turned LLMs into callable, governable, scalable services.</li>
  <li>We converged on unified entry, token governance, reliability, and inference scheduling.</li>
  <li>Homogenization arrived; the recipe started crushing incremental innovation.</li>
</ul>

<p>The second-half game should be:</p>

<ul>
  <li>Admit the backend has changed: it’s uncertain, and it can lie.</li>
  <li>Move <strong>reasoning + acting</strong> into routing decisions: think first, act, then decide.</li>
  <li>Move <strong>search and backtracking</strong> into routing search: deliberate over a strategy tree, not one-shot classification.</li>
  <li>Move <strong>feedback and reflexion</strong> into the routing loop: without changing weights, become more reliable through memory and reflection.</li>
  <li>Upgrade from <strong>solo intelligence</strong> to <strong>collective intelligence</strong>: make multiple models, tools, and verifiers collaborate like a team — and routing is the team’s organizing mechanism.</li>
</ul>

<blockquote>
  <ul>
    <li><em>In the first half, routing transports requests.</em></li>
    <li><em>In the second half, routing builds collective intelligence.</em></li>
  </ul>
</blockquote>

<p><strong>Welcome to the second half of LLM routing!</strong></p>

<p><img src="https://p.ipic.vip/aptaxx.png" alt="" /></p>

<h2 id="acknowledgements">Acknowledgements</h2>

<p>This blog post is inspired by <a href="https://ysymyth.github.io/The-Second-Half/">The Second Half</a> by <a href="https://ysymyth.github.io/">Shunyu Yao</a>.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[tldr: We’re reaching LLM routing’s halftime.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://p.ipic.vip/ug06tm.png" /><media:content medium="image" url="https://p.ipic.vip/ug06tm.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>