fix: resolve empty/wrong domain classifications#827
Conversation
✅ Deploy Preview for vllm-semantic-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
db737d4 to
2711b04
Compare
👥 vLLM Semantic Team NotificationThe following members have been identified for the changed files in this PR and have been automatically assigned: 📁
|
0ea9dc7 to
a8973dc
Compare
There was a problem hiding this comment.
Pull request overview
This pull request resolves issues with empty or incorrect domain classifications by implementing fallback behavior, adding PII type translation, improving model loading, and consolidating test cases into JSON files.
Key Changes:
- Implemented fallback to "other" category when classification confidence is below threshold
- Added PII type translation from Rust binding format (class_X) to named types (e.g., DATE_TIME)
- Auto-load supplement dataset from HuggingFace to improve fallback detection
- Updated Helm defaults to use newly trained ModernBERT model
- Moved test cases to JSON files with go:embed for better maintainability
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/training/classifier_model_fine_tuning/ft_linear.py | Added supplement dataset loading from HuggingFace and updated training defaults |
| src/semantic-router/pkg/utils/http/response.go | Added category and decision headers to PII and cache responses |
| src/semantic-router/pkg/utils/http/response_test.go | Updated test calls to include new category and decision parameters |
| src/semantic-router/pkg/extproc/req_filter_pii.go | Updated PII response call to include category parameter |
| src/semantic-router/pkg/extproc/req_filter_cache.go | Updated cache response call to include category and decision parameters |
| src/semantic-router/pkg/config/config.go | Added FallbackCategory configuration field |
| src/semantic-router/pkg/classification/mcp_classifier.go | Implemented fallback category logic when confidence is below threshold |
| src/semantic-router/pkg/classification/mapping.go | Added TranslatePIIType function for PII type translation |
| src/semantic-router/pkg/classification/classifier.go | Added ModernBERT fallback and PII type translation in detection functions |
| e2e/testcases/testdata/plugin_config_cases.json | New JSON file with plugin configuration test cases |
| e2e/testcases/testdata/domain_classify_cases.json | Expanded domain classification test cases with additional examples |
| e2e/testcases/testdata/decision_fallback_cases.json | New JSON file with decision fallback test cases |
| e2e/testcases/plugin_config_variations.go | Refactored to load test cases from embedded JSON file |
| e2e/testcases/decision_fallback.go | Refactored to load test cases from embedded JSON file |
| e2e/profiles/routing-strategies/values.yaml | Updated PII model configuration |
| e2e/profiles/production-stack/values.yaml | Updated to use ModernBERT category classifier |
| e2e/profiles/llm-d/values.yaml | Updated to use ModernBERT and aligned decision naming |
| e2e/profiles/dynamic-config/values.yaml | Updated to use ModernBERT category classifier |
| e2e/profiles/dynamic-config/profile.go | Removed CRD-incompatible test cases |
| e2e/profiles/ai-gateway/values.yaml | Updated to use ModernBERT and adjusted cache thresholds |
| deploy/kubernetes/aibrix/semantic-router-values/values.yaml | Updated to use ModernBERT classifier |
| deploy/helm/semantic-router/values.yaml | Changed model repository to use trained ModernBERT model |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3321f1e to
5402b25
Compare
Signed-off-by: Yehudit Kerido <ykerido@ykerido-thinkpadp1gen7.raanaii.csb>
5402b25 to
70e51a1
Compare

Fix domain classifier returning empty or incorrect categories.
Changes:
HuggingFace resources (LLM-Semantic-Router org):
Resolves #714