-
Notifications
You must be signed in to change notification settings - Fork 236
Implement Signal Fusion Engine for prompt classification routing #437
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vllm-semantic-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…sed evaluation Co-authored-by: wangchen615 <[email protected]>
Co-authored-by: wangchen615 <[email protected]>
Co-authored-by: wangchen615 <[email protected]>
Co-authored-by: wangchen615 <[email protected]>
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.
The engine implementation looks good to me, yet I need more support from how to configure the config.yaml and how the router can read those routing rules and use the engine to route the request. @copilot
👥 vLLM Semantic Team NotificationThe following members have been identified for the changed files in this PR and have been automatically assigned: 📁
|
Co-authored-by: wangchen615 <[email protected]>
I've added comprehensive configuration documentation and integration examples. See the new files: Configuration Guide:
Example Config Files:
Integration Examples:
The configuration guide shows:
All examples are tested and working (commit 8ae9adb). |
Overview
This PR implements the Signal Fusion Engine, a policy-driven decision-making system that combines multiple signals (keyword, regex, embedding similarity, and BERT) into actionable routing decisions. This is a core component of the Prompt Classification Routing proposal.
Motivation
The Signal Fusion Engine enables intelligent routing decisions by:
Implementation
Core Components
1. Boolean Expression Parser (
expression.go
)2. Priority-Based Engine (
engine.go
)3. Type-Safe Data Structures (
types.go
)Signal
- Results from signal providersRule
- Policy rule with condition and actionPolicy
- Collection of rules evaluated in priority orderEvaluationResult
- Result with matched rule and action detailsFeatures
Action Types
Expression Language
&&
(AND),||
(OR),!
(NOT)==
,!=
,>
,<
,>=
,<=
provider.name.field
(e.g.,keyword.kubernetes.matched
,similarity.reasoning.score
)Testing
Comprehensive test coverage using Ginkgo/Gomega (consistent with project standards):
27 unit test specs covering:
10 example tests demonstrating real-world usage:
All tests passing:
27 Passed | 0 Failed
Example Usage
Configuration and Integration
Configuration Guide
Comprehensive configuration documentation is provided in
CONFIGURATION.md
, including:RouterConfig
withContentScanningConfig
Example Configuration Files
Ready-to-use example configurations in
config/fusion/
:config.fusion-example.yaml
- Complete router configuration with fusion engine enabledpolicy_rules.yaml
- Example fusion policy rules organized by priority (safety, routing, boosting, consensus)keyword_rules.yaml
- Keyword matching rules for various topics (Kubernetes, security, databases, etc.)regex_patterns.yaml
- Security patterns for PII detection, CVE IDs, and injection attemptssimilarity_concepts.yaml
- Embedding similarity concepts for reasoning, infrastructure, and code generationIntegration Examples
Working integration examples in
integration_example_test.go
demonstrate:Integration Path
This engine integrates with the existing semantic router architecture:
See
CONFIGURATION.md
for detailed integration guide with code examples.Documentation
Closes
Resolves the Signal Fusion Engine requirements from the Prompt Classification Routing issue.
Fixes #367
Original prompt
Fixes #367
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.