vllm-project/semantic-router

Extend Router Learning adaptation composition

Open

#2,241 opened on Jun 18, 2026

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Go (699 forks)github user discovery
area/agentarea/corearea/model-selectionenhancementhelp wantedpriority/P2roadmap

Repository metrics

Stars
 (4,293 stars)
PR merge metrics
 (PR metrics pending)

Description

Parent: #2238
Depends on: #2239
Related: #2240, #2308, #2346

Goal

Extend Router Learning's typed adaptation evidence and final-decision explanation while preserving the current fixed pipeline and one operator-facing strategy selection.

Audited current-main baseline (2026-07-15)

Current main composes learning in this order:

base recipe selection
  -> protection preflight
  -> one adaptation strategy (default: routing_sampling)
  -> protection switch/hold/rescue
  -> final logical model + typed diagnostics

It does not implement the previously described method-keyed composer for simultaneous bandit, Elo, personalization, and cache/cost adapters. Those historical names are not current public Router Learning config.

Scope

  1. Define a typed contribution/explanation contract for evidence used by one strategy: source, score/delta, uncertainty, freshness, sample count, suppression reason, and provenance.
  2. Preserve one final adaptation proposal before protection; avoid multiple components mutating the model independently.
  3. If future strategies combine evidence internally, define normalization, tie-breaking, missing/stale evidence, and deterministic ordering within that strategy.
  4. Keep protection a separate hard boundary that can suppress sampling, hold the current model, or rescue a route.
  5. Keep headers compact; detailed evidence belongs in typed Replay diagnostics.
  6. Prove observe/apply/bypass behavior and candidate-set boundaries under conflicts.
  7. Benchmark added complexity through #2346 before adding a new production strategy.

Non-goals

  • Do not expose adaptations.bandit, adaptations.elo, adaptations.personalization, or other legacy method-keyed public blocks.
  • Do not soften authorization, safety, privacy, residency, context, explicit decision bypass, or protection rules.
  • Do not turn the composer into a general multi-objective policy language.
  • Do not add synchronous durable evidence reads.

Acceptance criteria

  • One adaptation proposal and one final protection decision remain reconstructable.
  • Evidence contributions are typed, bounded, and deterministic.
  • Missing/stale/conflicting evidence and ties have explicit behavior.
  • Observe mode records the proposed result without changing the final model.
  • Decision bypass prevents both adaptation and protection changes as defined by the contract.
  • Headers remain bounded and Replay contains the detailed trace.
  • Tests cover conflict, tie, hard constraint, protection override, observe/apply/bypass, and reload.

Validation entrypoint

make agent-report ENV=cpu CHANGED_FILES="<space-separated changed files>"

Contributor guide