Refactor: Modularize native router model bindings and runtime capability contracts - #2458
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 when their GitHub accounts are assignable in this repository: 📁
|
✅ Supply Chain Security Report — All Clear
Scanned at |
5f44f7c to
57e70d2
Compare
Signed-off-by: Param <param15.veer.singh@gmail.com>
Signed-off-by: Param <param15.veer.singh@gmail.com>
… errors Signed-off-by: Param <param15.veer.singh@gmail.com>
Signed-off-by: Param <param15.veer.singh@gmail.com>
3f2a821 to
082b858
Compare
FAUST-BENCHOU
left a comment
There was a problem hiding this comment.
make sure ci green
Signed-off-by: Param <param15.veer.singh@gmail.com>
5f6bd64 to
a48dd94
Compare
Xunzhuo
left a comment
There was a problem hiding this comment.
Thanks for taking on this large refactor. The backend-neutral contract is a reasonable direction, but the current branch is not a behavior-preserving refactor and should be moved to draft while it is split up.
The main blockers are structural, not just the 12 failing CI jobs:
- The Candle, ONNX, and OpenVINO adapters do not load a model;
Inferreturns an empty successful response,Unloadis a no-op, andInfo().IsLoadedis always true. - Nothing imports the adapter subpackages, so their
init()registration does not run and the global registry remains empty. classification/unified_classifier.goandembedding/provider.goare emptied, removing existing behavior before a working replacement exists.- The API advertises capabilities/load state that the adapters do not actually provide.
Please split this into staged PRs:
- Contract/registry types and tests only, while preserving every existing call site and runtime behavior.
- A real Candle adapter that delegates to the existing binding, with load/infer/unload lifecycle and parity tests.
- ONNX/OpenVINO adapters only when they perform real inference and have backend-specific tests.
For the first slice, restore the deleted implementations, remove placeholder adapters/capability claims, add deterministic registry-composition tests, use a module-prefixed PR title, and get the smallest harness gates green. Once that slice is small and behavior-preserving, it will be much easier to review and merge.
|
Thanks for splitting this work into #2530, #2532, #2533, and #2534 — that is a much easier shape to review. This original branch is now superseded and still contains the placeholder behavior called out in the review, so please close #2458 and focus first on getting #2530 to a stable additive contract. After Phase 1 is addressed, please make the later PRs a real sequential stack (#2532 based on #2530, #2533 on #2532, and #2534 on #2533). There is no need to spend more effort repairing CI on this original branch; we can review each smaller phase as its base stabilizes. |
Overview This is Phase 1 of splitting PR vllm-project#2458 into smaller, staged, and behavior-preserving pull requests. Part of vllm-project#2396 Signed-off-by: Param <param15.veer.singh@gmail.com>
|
This pull request has had no activity from the submitter for 30 days and has been marked as stale. It will be closed in 30 days if no further activity occurs. |

Overview
This PR addresses Issue #2396 by introducing a binding-neutral native runtime contract for all router-owned model assets, completely decoupling the Go semantic router from the legacy CGO/Rust sprawl in
candle-binding. It establishes the foundation for extensible backends (Candle, ONNX, OpenVINO) without hard-coding provider logic in the critical path.Key Changes
pkg/modelruntime/native)BackendAdapter,ModelHandle,LoadRequest, andInferenceRequestto establish a stable, backend-neutral API.taxonomy.goto remove duplicated strings across Rust/Go.router_runtime.go: Removed all direct legacycandle_binding.InitModel(...)calls; now initializes models natively throughnative.LoadModel(ctx, backend, request).classification/unified_classifier.go: Removed manual CGO initialization, migrating dynamic labels and thresholding logic to standardLoadRequestparameters via the registry.embedding/provider.go: The unifiedNewProvidernow first queries the nativeAdapterRegistrybefore falling back to remote OpenAI configurations.candle-binding)state_manager.rsfrom sprawlingRwLock<Option<Arc<...>>>singletons to a centralizedHashMap-basedModelRegistryinregistry.rsto streamline dynamic model swaps.config/validator_native.go: AddedvalidateNativeBackendContractsto explicitly catch invalid backend/capability configurations and reject them before serving API traffic.apiserver/route_model_info_embeddings.go: Refactored the/modelsendpoints to programmatically iterate overnative.Registry.List()and expose capabilities, matching the normalized discovery schema.Related Issues
Fixes #2396 - Modularize native router model bindings and runtime capability contracts.