-
Notifications
You must be signed in to change notification settings - Fork 296
[Feat]: Signal-Decision Driven Semantic Routing with Dynamic Plugin Architecture #681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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: 📁
|
51c60a3 to
eb0d095
Compare
25f435e to
51cefd8
Compare
fa33e47 to
d7b2c50
Compare
f70cd77 to
316ccb7
Compare
7e1d896 to
57046e1
Compare
Signed-off-by: bitliu <bitliu@tencent.com>
57046e1 to
91171f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive decision-based routing system with a flexible plugin architecture, replacing the previous category-based approach. The changes enable signal-driven semantic routing with dynamic plugin configurations through Kubernetes CRDs (IntelligentRoute and IntelligentPool).
Key changes:
- Replaced Category-based routing with Decision-based routing that combines multiple rules using AND/OR operators
- Introduced a flexible plugin architecture for decision-level configurations (semantic-cache, jailbreak, pii, system_prompt)
- Renamed ModelScores to ModelRefs and removed the score field, simplifying model selection
- Added Kubernetes CRD integration with IntelligentPool and IntelligentRoute resources
Reviewed Changes
Copilot reviewed 79 out of 146 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/extproc/extproc_test.go | Removed deprecated PII policy tests and category-based test cases |
| pkg/decision/engine.go | New decision engine for evaluating rule combinations with AND/OR logic |
| pkg/decision/engine_test.go | Tests for decision engine evaluation logic |
| pkg/config/validator.go | Updated validation to check decisions instead of categories |
| pkg/config/loader.go | Added config update notification channel for dynamic updates |
| pkg/config/helper.go | Refactored helpers to use decisions instead of categories |
| pkg/config/config_test.go | Updated tests to use decisions and removed category-based tests |
| pkg/config/config.go | Added Decision, ModelRef, and plugin configuration structures |
| pkg/classification/mcp_classifier.go | Updated to use decisions instead of categories |
| pkg/classification/keyword_entropy_test.go | Removed deprecated keyword entropy test file |
| pkg/classification/keyword_classifier.go | Changed Category field to Name in keyword rules |
| pkg/classification/embedding_classifier.go | Renamed Keywords to Candidates in embedding rules |
| pkg/classification/classifier_test.go | Removed category-based test cases |
| pkg/classification/classifier.go | Added decision evaluation engine and refactored to use decisions |
| pkg/apiserver/server_test.go | Removed deprecated system prompt endpoint tests |
| pkg/apiserver/server.go | Updated to use global config instead of loading from file |
| pkg/apiserver/route_system_prompt.go | Updated to work with decisions instead of categories |
| pkg/apis/vllm.ai/v1alpha1/zz_generated.deepcopy.go | Generated deepcopy methods for new CRD types |
| pkg/apis/vllm.ai/v1alpha1/types_route.go | New file defining IntelligentRoute CRD structure |
| pkg/apis/vllm.ai/v1alpha1/types.go | Replaced SemanticRoute with IntelligentPool and IntelligentRoute |
| pkg/apis/vllm.ai/v1alpha1/register.go | Updated to register new CRD types |
| pkg/apis/vllm.ai/v1alpha1/filter_types.go | Removed deprecated filter types file |
| cmd/main.go | Added Kubernetes controller initialization for CRD-based config |
| deploy/kubernetes/observability/dashboard/config.yaml | Removed deprecated pii_policy configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2672c15 to
f9a0096
Compare
|
thank you! this is really impressive! |
…lm-project#681 merge After PR vllm-project#681 merge, Categories no longer have ModelScores field. The reasoning config moved to Decisions.ModelRefs, but there's no direct mapping from category names to decision names. Set useReasoning=false as safe default until proper category-to-decision mapping is implemented. Related: PR vllm-project#648, PR vllm-project#681 Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
After PR vllm-project#681 introduced decision-based routing, PII detection requires a decision to be selected. Using model="MoM" triggers domain classification, but PII test data is domain-agnostic, so no domain matches, no decision is selected, and PII detection gets disabled. Solution: Use model="base-model" directly which matches all decisions in the CRD. This ensures a decision is selected and PII detection is enabled. This still tests LoRA PII auto-detection as configured in the classifier settings, but ensures the decision-based PII plugin is activated. Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
After PR vllm-project#681 introduced decision-based routing, PII detection requires a decision to be selected. Using model="MoM" triggers domain classification, but PII test data is domain-agnostic, so no domain matches, no decision is selected, and PII detection gets disabled. Solution: Use model="base-model" directly which matches all decisions in the CRD. This ensures a decision is selected and PII detection is enabled. This still tests LoRA PII auto-detection as configured in the classifier settings, but ensures the decision-based PII plugin is activated. Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
…rchitecture (vllm-project#681) * feat: implement decision-based routing with plugin architecture Signed-off-by: bitliu <bitliu@tencent.com> * fix ci Signed-off-by: bitliu <bitliu@tencent.com> --------- Signed-off-by: bitliu <bitliu@tencent.com>
…lm-project#681 merge After PR vllm-project#681 merge, Categories no longer have ModelScores field. The reasoning config moved to Decisions.ModelRefs, but there's no direct mapping from category names to decision names. Set useReasoning=false as safe default until proper category-to-decision mapping is implemented. Related: PR vllm-project#648, PR vllm-project#681 Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
After PR vllm-project#681 introduced decision-based routing, PII detection requires a decision to be selected. Using model="MoM" triggers domain classification, but PII test data is domain-agnostic, so no domain matches, no decision is selected, and PII detection gets disabled. Solution: Use model="base-model" directly which matches all decisions in the CRD. This ensures a decision is selected and PII detection is enabled. This still tests LoRA PII auto-detection as configured in the classifier settings, but ensures the decision-based PII plugin is activated. Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

This commit introduces a comprehensive decision-based routing system with a flexible plugin architecture, replacing the previous category-based approach.
IntelligentRoute
IntelligentPool:
Core Changes
1. Decision-Based Architecture
2. Plugin System
3. Model References
4. Kubernetes CRD Integration
Key Components
Decision Engine (pkg/decision/engine.go)
Configuration (pkg/config/config.go)
CRD Types (pkg/apis/vllm.ai/v1alpha1/)
Kubernetes Integration (pkg/k8s/)
-swhen doinggit commit[Bugfix],[Feat], and[CI].Detailed Checklist (Click to Expand)
Thank you for your contribution to semantic-router! Before submitting the pull request, please ensure the PR meets the following criteria. This helps us maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Please try to classify PRs for easy understanding of the type of changes. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]for bug fixes.[CI/Build]for build or continuous integration improvements.[Doc]for documentation fixes and improvements.[Feat]for new features in the cluster (e.g., autoscaling, disaggregated prefill, etc.).[Router]for changes to thevllm_router(e.g., routing algorithm, router observability, etc.).[Misc]for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
pre-committo format your code. SeeREADME.mdfor installation.DCO and Signed-off-by
When contributing changes to this project, you must agree to the DCO. Commits must include a
Signed-off-by:header which certifies agreement with the terms of the DCO.Using
-swithgit commitwill automatically add this header.What to Expect for the Reviews