Commit 8df29e7
fix(e2e): enable LoRA PII auto-detection for ai-gateway and aibrix E2E tests
Fixes the PII detection test failures for both ai-gateway and aibrix profiles
by switching from ModernBERT to LoRA-based PII detection.
## Root Cause
Both profiles were using the old ModernBERT PII model instead of the new
LoRA-based auto-detection model, causing 0% PII detection accuracy in tests.
## Applied Fixes
### 1. AI Gateway E2E Profile (e2e/profiles/ai-gateway/values.yaml)
**Fix 1: LoRA PII Model Configuration** (lines 469-476)
Updated classifier.pii_model to use LoRA auto-detection:
- model_id: "models/lora_pii_detector_bert-base-uncased_model"
- model_type: "auto" (enables LoRA auto-detection)
- pii_mapping_path: points to LoRA model's pii_type_mapping.json
**Fix 2: Default Decision Fallback** (lines 413-432)
Added default_decision to enable PII detection when no route matches:
- priority: 0 (lowest, fallback only)
- pii_types_allowed: [] (block ALL PII)
- Works with policy.go fallback mechanism
### 2. Aibrix Deployment Config (deploy/kubernetes/aibrix/semantic-router-values/values.yaml)
**Fix: LoRA PII Model Configuration** (lines 176-183)
Same LoRA model update as ai-gateway.
Note: Aibrix uses old category-based routing, so no default_decision needed.
## Test Results
**AI Gateway**: Verified locally with Kind cluster - 100% PII detection accuracy (100/100 tests)
**Aibrix**: Uses same LoRA model configuration, should achieve same 100% accuracy
## Why Both Fixes Were Necessary
1. **LoRA Model**: Switches to the new auto-detection infrastructure
2. **Default Decision** (ai-gateway only): Ensures PII policy applies even when
no specific decision matches the request content
Fixes #647
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Yossi Ovadia <yovadia@redhat.com>1 parent f0d58dd commit 8df29e7
File tree
2 files changed
+31
-6
lines changed- deploy/kubernetes/aibrix/semantic-router-values
- e2e/profiles/ai-gateway
2 files changed
+31
-6
lines changedLines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
441 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
442 | 444 | | |
443 | 445 | | |
444 | | - | |
| 446 | + | |
445 | 447 | | |
446 | 448 | | |
447 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
413 | 434 | | |
414 | 435 | | |
415 | 436 | | |
| |||
467 | 488 | | |
468 | 489 | | |
469 | 490 | | |
470 | | - | |
471 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
472 | 495 | | |
473 | 496 | | |
474 | | - | |
| 497 | + | |
475 | 498 | | |
476 | 499 | | |
477 | 500 | | |
| |||
0 commit comments