feat: add supported/experimental tier classification to model-selection algorithms (#1514)#1693
Conversation
✅ Deploy Preview for vllm-semantic-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
👥 vLLM Semantic Team NotificationThe following members have been identified for the changed files in this PR and have been automatically assigned: 📁
|
✅ Supply Chain Security Report — All Clear
Scanned at |
e0fb6cb to
f0eaf9b
Compare
There was a problem hiding this comment.
Pull request overview
Adds tier classification and dependency introspection to model-selection algorithms, with associated startup logging/warnings, health checks, and Prometheus labeling/metrics to improve operational clarity around “supported” vs “experimental” selectors.
Changes:
- Extend
Selectorinterface withTier()andExternalDependencies()and plumb tier intoSelectionResult. - Add
tierlabel to selection metrics and introduce a dependency health gauge. - Add startup logging for registered algorithms plus warnings/health checks for experimentally configured algorithms; update config catalog to include tiers.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/tutorials/algorithm/selection/mlp.md | Documents MLP as experimental. |
| src/semantic-router/pkg/selection/static.go | Implements Tier()/ExternalDependencies() for Static selector. |
| src/semantic-router/pkg/selection/selector_test.go | Adds tests covering tier/dependency constants and selector tier behavior. |
| src/semantic-router/pkg/selection/selector.go | Introduces tier/dependency types; extends Selector; populates SelectionResult.Tier. |
| src/semantic-router/pkg/selection/router_dc.go | Implements Tier()/ExternalDependencies() for RouterDC. |
| src/semantic-router/pkg/selection/rl_driven.go | Implements tier/deps; updates RL metrics recording to include tier. |
| src/semantic-router/pkg/selection/ml_adapter.go | Marks ML adapters experimental and declares pretrained-model dependency. |
| src/semantic-router/pkg/selection/metrics_test.go | Updates metrics tests for tier labels and new recording APIs. |
| src/semantic-router/pkg/selection/metrics.go | Adds tier labels; adds dependency health gauge; introduces tier-aware recorders. |
| src/semantic-router/pkg/selection/latency_aware.go | Implements Tier()/ExternalDependencies() for LatencyAware. |
| src/semantic-router/pkg/selection/hybrid.go | Implements Tier()/ExternalDependencies() for Hybrid. |
| src/semantic-router/pkg/selection/gmtrouter.go | Implements tier/deps for GMTRouter. |
| src/semantic-router/pkg/selection/factory.go | Adds algorithm registry logging, experimental warnings, and dependency health checks. |
| src/semantic-router/pkg/selection/elo.go | Implements Tier()/ExternalDependencies() for Elo. |
| src/semantic-router/pkg/selection/automix.go | Implements tier/deps for AutoMix (verifier service dependency). |
| src/semantic-router/pkg/extproc/router_selection.go | Wires startup warnings and dependency checks based on configured decisions. |
| src/semantic-router/pkg/extproc/req_filter_classification.go | Records selection metrics with tier. |
| src/semantic-router/pkg/config/routing_surface_catalog_test.go | Adds tests for catalog tiers and backward compatibility. |
| src/semantic-router/pkg/config/routing_surface_catalog.go | Replaces flat algorithm list with structured catalog including tier. |
| src/semantic-router/pkg/config/fragment_catalog_test.go | Adds selection fragment mapping for mlp. |
| docs/superpowers/specs/2026-03-29-algorithm-tier-classification-design.md | Adds design spec for tier classification and guardrails. |
| config/config.yaml | Adds example decision using experimental mlp algorithm. |
|
The tier classification (supported vs experimental) for model-selection algorithms is the right governance pattern. A mathematical framework for the tier criteria: Promotion criteria from experimental to supported:
For the 12 algorithms specifically: Algorithms with theoretical guarantees (strong supported candidates):
Algorithms without guarantees (experimental until empirically validated):
Health check pattern for external dependencies: Beyond startup UNREACHABLE logs, consider a circuit breaker: if the external service fails 3 consecutive times within 30 seconds, fallback to the best local algorithm (Thompson Sampling) until the external recovers. This prevents external service flakiness from degrading production routing. |
…#1514) Design for adding supported/experimental tier classification to model-selection algorithms so operators can distinguish production-ready algorithms from research experiments at config and runtime level. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Senan Zedan <szedan@redhat.com>
…-project#1514) 9-task TDD implementation plan covering interface changes, tier methods on all 12 algorithms, startup warnings, metrics labels, structured config catalog, and integration testing. Signed-off-by: Senan Zedan <szedan@redhat.com>
…nterface (vllm-project#1514) This commit adds foundational types for algorithm tier classification: - AlgorithmTier enum with TierSupported and TierExperimental values - DependencyType enum for external_service, pretrained_model, and embedding_function - Dependency struct to describe external dependencies (name, type, description, health URL, required flag) - Tier field added to SelectionResult to track production readiness - Tier() and ExternalDependencies() methods added to Selector interface Tests verify the new types and constants compile correctly. Note: Existing algorithm structs (EloSelector, AutoMixSelector, etc.) do not yet implement the new interface methods - this is intentional and will be addressed in subsequent commits. The package will not build until Tasks 2 and 3 add the implementations to all 12 algorithm structs. Signed-off-by: Senan Zedan <szedan@redhat.com>
…ect#1514) Add Tier() and ExternalDependencies() methods to the 5 supported algorithm selectors (static, elo, router_dc, latency_aware, hybrid). All return TierSupported and empty dependency lists. Add TestSupportedAlgorithms_Tier to verify correct implementation. Signed-off-by: Senan Zedan <szedan@redhat.com>
…roject#1514) Add Tier() and ExternalDependencies() methods to experimental algorithm selectors: - automix.go: AutoMixSelector now declares TierExperimental and optional verifier service dependency - rl_driven.go: RLDrivenSelector now declares TierExperimental and optional Router-R1 service dependency - gmtrouter.go: GMTRouterSelector now declares TierExperimental and optional pretrained graph model dependency - ml_adapter.go: MLSelectorAdapter now declares TierExperimental and required pretrained model dependency Tests added: - TestExperimentalAlgorithms_Tier: Verifies tier and dependencies for automix, rl_driven, gmtrouter - TestMLAdapterAlgorithms_Tier: Verifies tier and pretrained model dependencies for KNN, KMeans, SVM, MLP - TestAutoMixSelector_DependenciesWithVerifier: Verifies conditional external service dependency declaration All 12 algorithms now implement the full Selector interface with tier classification. Signed-off-by: Senan Zedan <szedan@redhat.com>
vllm-project#1514) Signed-off-by: Senan Zedan <szedan@redhat.com>
…health gauge (vllm-project#1514) This commit adds tier-awareness to the Prometheus metrics system and introduces a new dependency health gauge for monitoring external service availability. Changes: - Add "tier" label to ModelSelectionTotal, ModelSelectionDuration, and ModelSelectionConfidence - Add new ModelSelectionDependencyHealth gauge for tracking dependency reachability - Update all metric call sites to pass tier labels (empty string for legacy calls) - Add RecordSelectionWithTier() for tier-aware recording - Add RecordDependencyHealth() for dependency monitoring - Update preInitializeMetrics() to pre-populate tier-labeled metrics - Add tests for new tier-aware functions The tier label enables operators to filter Prometheus dashboards by algorithm stability (tier="supported" vs tier="experimental"), providing better visibility into production-ready vs research-grade algorithm usage. Signed-off-by: Senan Zedan <szedan@redhat.com>
vllm-project#1514) Replace the flat `supportedDecisionAlgorithmTypes` string list with a structured `decisionAlgorithmCatalog` that includes tier information ("supported" or "experimental") for each algorithm type. Key changes: - Add `AlgorithmCatalogEntry` struct with Type and Tier fields - Replace flat list with structured catalog in routing_surface_catalog.go - Add `DecisionAlgorithmCatalog()` and `GetAlgorithmTier()` public functions - Add "mlp" algorithm as experimental with supporting config fragments - Maintain backwards compatibility via derived `supportedDecisionAlgorithmTypes` - Add comprehensive tests for catalog and tier lookups All existing callers of `IsSupportedDecisionAlgorithmType()` and `SupportedDecisionAlgorithmTypes()` continue to work unchanged. Signed-off-by: Senan Zedan <szedan@redhat.com>
…up (vllm-project#1514) Signed-off-by: Senan Zedan <szedan@redhat.com>
Signed-off-by: Senan Zedan <szedan@redhat.com>
785554f to
25a211f
Compare
Signed-off-by: Senan Zedan <szedan@redhat.com>

supported/experimentaltier classification to all 12 model-selection algorithms via theSelectorinterfacetierlabel to Prometheus metrics (model_selection_total,model_selection_duration_seconds,model_selection_confidence) for dashboard filteringmodel_selection_dependency_healthgauge for external dependency monitoringrouting_surface_catalog.go