Skip to main content
Documentation

VSR Routing Headers

This page documents the public x-vsr-* headers emitted by vLLM Semantic Router for routing observability, replay correlation, and debugging.

Version: v0.3

VSR Routing Headers

This page documents the public x-vsr-* headers emitted by vLLM Semantic Router for routing observability, replay correlation, and debugging.

Emission Rules

The router emits protocol headers on every non-cache-hit response. It emits routing decision and matched-signal headers only when all of the following are true:

  1. The upstream response is successful (2xx).
  2. The response was not served from semantic cache.
  3. The router evaluated a routing decision or signal for the request.

Cache-hit responses can emit cache headers, but they do not re-run routing and therefore do not attach fresh matched-signal headers.

Request Headers

HeaderDirectionDescription
x-session-idrequestStable client-provided session identifier for Chat Completions. session_aware uses this to reason about stay-vs-switch decisions across turns.
x-vsr-skip-processingrequestOpts a request out of router processing when global.router.skip_processing.enabled is enabled. Use value true.

Protocol And Replay Headers

HeaderDescription
x-vsr-inbound-protocolInbound protocol shape seen by the router, for example openai or anthropic.
x-vsr-outbound-protocolProtocol shape sent to the selected upstream backend.
x-vsr-lossiness-warningsComma-separated protocol translation warnings encoded as severity;reason;field.
x-vsr-replay-idOpaque router replay record identifier for correlating a response with replay/Insights data.

Decision Headers

HeaderDescriptionExample
x-vsr-selected-categoryDomain/category classifier result when domain routing runs.math
x-vsr-selected-decisionFinal decision selected by the decision engine.formal_math_proof
x-vsr-selected-confidenceConfidence score for the selected decision.0.9100
x-vsr-selected-reasoningReasoning mode selected for the request.on
x-vsr-selected-modalityModality result and optional method.AR;classifier
x-vsr-selected-modelLogical model alias selected by the router.qwen/qwen3.5-rocm
x-vsr-session-phaseSession-aware phase from the selected policy trace.user_turn, tool_loop, provider_state
x-vsr-injected-system-promptWhether a system-prompt plugin injected text into the request.true

Matched Signal Headers

Matched signal headers contain comma-separated rule names. They are omitted when the corresponding signal family did not match.

HeaderSignal family
x-vsr-matched-keywordskeyword
x-vsr-matched-embeddingsembedding
x-vsr-matched-domainsdomain
x-vsr-matched-fact-checkfact_check
x-vsr-matched-user-feedbackuser_feedback
x-vsr-matched-reaskreask
x-vsr-matched-preferencepreference
x-vsr-matched-languagelanguage
x-vsr-matched-contextcontext
x-vsr-context-token-countContext token estimate used by context
x-vsr-matched-structurestructure
x-vsr-matched-complexitycomplexity
x-vsr-matched-modalitymodality
x-vsr-matched-authzauthz
x-vsr-matched-jailbreakjailbreak
x-vsr-matched-piipii
x-vsr-matched-kbkb
x-vsr-matched-conversationconversation
x-vsr-matched-eventevent

Projection Headers

HeaderDescription
x-vsr-matched-projectionsComma-separated projection mapping outputs that matched the request.

Projection scores and full projection traces are stored in router replay records rather than expanded into response headers. Use x-vsr-replay-id to inspect those details in the dashboard or replay APIs.

Cache And Plugin Headers

HeaderDescription
x-vsr-cache-hitResponse came from semantic cache.
x-vsr-cache-similaritySimilarity score from the semantic-cache lookup.
x-vsr-fast-responseResponse was generated by the fast_response plugin without an upstream model call.
x-vsr-tools-strategySemantic tool-selection retriever strategy used for the request.
x-vsr-tools-confidenceHighest tool-selection retriever similarity score.
x-vsr-tools-latency-msTool-selection retriever latency in milliseconds.

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
x-vsr-inbound-protocol: openai
x-vsr-outbound-protocol: openai
x-vsr-selected-decision: critical_event_tool_session_route
x-vsr-selected-confidence: 1.0000
x-vsr-selected-model: anthropic/claude-opus-4.6
x-vsr-session-phase: tool_loop
x-vsr-matched-conversation: active_tool_use
x-vsr-matched-event: critical_payment_event
x-vsr-matched-projections: verification_required
x-vsr-replay-id: replay_01J...

Notes

  • x-vsr-matched-projections is the v0.3 projection header. The old singular form is not part of the public v0.3 contract.
  • event is the public signal type used by decisions and DSL. Canonical YAML stores event rules under routing.signals.events, matching other plural signal containers.
  • session_aware uses router-owned session state internally. Users configure it through routing.decisions[].algorithm.session_aware and pass stable session identity with x-session-id; there is no separate user-managed session-state block in the v0.3 public contract.