-
Notifications
You must be signed in to change notification settings - Fork 181
fix: use both unified and legacy classifier to prevent failure #332
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
Signed-off-by: Huamin Chen <hchen@redhat.com>
✅ 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: 📁
|
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 modifies the classification service to use both unified and legacy classifiers as fallbacks to prevent service failures. The changes ensure that if one classifier fails to initialize, the service can still operate using the other classifier.
Key changes:
- Modified
NewUnifiedClassificationService
to accept both unified and legacy classifiers - Updated auto-discovery logic to attempt initializing both classifier types
- Added a new
createLegacyClassifier
function to properly initialize legacy classifiers
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
if ucErr != nil { | ||
observability.Infof("Unified classifier auto-discovery failed: %v", ucErr) | ||
} | ||
// create legacy classifier |
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.
Comment should start with a capital letter: 'Create legacy classifier'.
// create legacy classifier | |
// Create legacy classifier |
Copilot uses AI. Check for mistakes.
test result: $ curl -X POST http://localhost:8080/api/v1/classify/intent -H "Content-Type: application/json" -d '{"text": "What is machine learning?"}'
{"classification":{"category":"computer science","confidence":0.8515688180923462,"processing_time_ms":131},"recommended_model":"computer science-specialized-model","routing_decision":"high_confidence_specialized"} |
…project#332) Signed-off-by: Huamin Chen <hchen@redhat.com> Signed-off-by: liuhy <liuhongyu@apache.org>
…project#332) Signed-off-by: Huamin Chen <hchen@redhat.com> Signed-off-by: liuhy <liuhongyu@apache.org>
…project#332) Signed-off-by: Huamin Chen <hchen@redhat.com> Signed-off-by: liuhy <liuhongyu@apache.org>
…project#332) Signed-off-by: Huamin Chen <hchen@redhat.com> Signed-off-by: liuhy <liuhongyu@apache.org>
What type of PR is this?
Fix #318
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Release Notes: Yes/No