Skip to content

Commit c7aa690

Browse files
committed
feat: implement decision-based routing with plugin architecture
Signed-off-by: bitliu <[email protected]>
1 parent b732076 commit c7aa690

File tree

24 files changed

+2059
-818
lines changed

24 files changed

+2059
-818
lines changed

config/config.yaml

Lines changed: 325 additions & 80 deletions
Large diffs are not rendered by default.

config/intelligent-routing/in-tree/bert_classification.yaml

Lines changed: 325 additions & 80 deletions
Large diffs are not rendered by default.

config/intelligent-routing/in-tree/embedding.yaml

Lines changed: 103 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ model_config:
5454
"qwen3":
5555
reasoning_family: "qwen3" # This model uses Qwen-3 reasoning syntax
5656
preferred_endpoints: ["endpoint1"]
57-
pii_policy:
5857

5958
# Classifier configuration
6059
classifier:
@@ -125,44 +124,115 @@ embedding_rules:
125124
quality_priority: 0.5
126125
latency_priority: 0.5
127126

128-
# Categories with model scores
127+
# Categories define domain metadata only (no routing logic)
129128
categories:
130-
# Embedding-based categories
131129
- name: technical_support
132-
system_prompt: "You are a technical support specialist. Provide detailed, step-by-step guidance for technical issues. Use clear explanations and include relevant troubleshooting steps."
133-
model_scores:
134-
- model: qwen3
135-
score: 0.9
136-
use_reasoning: true
137-
jailbreak_enabled: true
138-
pii_enabled: true
139-
130+
description: "Technical support and troubleshooting queries"
131+
mmlu_categories: ["technical_support"]
140132
- name: product_inquiry
141-
system_prompt: "You are a product specialist. Provide accurate information about products, features, pricing, and availability. Be helpful and informative."
142-
model_scores:
143-
- model: qwen3
144-
score: 0.85
145-
use_reasoning: false
146-
jailbreak_enabled: true
147-
pii_enabled: false
148-
133+
description: "Product information and specifications"
134+
mmlu_categories: ["product_inquiry"]
149135
- name: account_management
150-
system_prompt: "You are an account management assistant. Help users with account-related tasks such as password resets, profile updates, and subscription management. Prioritize security and privacy."
151-
model_scores:
152-
- model: qwen3
153-
score: 0.88
154-
use_reasoning: false
155-
jailbreak_enabled: true
156-
pii_enabled: true
157-
136+
description: "Account and subscription management"
137+
mmlu_categories: ["account_management"]
158138
- name: general_inquiry
159-
system_prompt: "You are a helpful general assistant. Answer questions clearly and concisely. If you need more information, ask clarifying questions."
160-
model_scores:
161-
- model: qwen3
162-
score: 0.75
139+
description: "General questions and information requests"
140+
mmlu_categories: ["general_inquiry"]
141+
142+
strategy: "priority"
143+
144+
decisions:
145+
- name: "technical_support_decision"
146+
description: "Technical support and troubleshooting queries"
147+
priority: 100
148+
rules:
149+
operator: "AND"
150+
conditions:
151+
- type: "domain"
152+
name: "technical_support"
153+
modelRefs:
154+
- model: "qwen3"
155+
use_reasoning: true
156+
plugins:
157+
- type: "system_prompt"
158+
configuration:
159+
system_prompt: "You are a technical support specialist. Provide detailed, step-by-step guidance for technical issues. Use clear explanations and include relevant troubleshooting steps."
160+
- type: "jailbreak"
161+
configuration:
162+
enabled: true
163+
- type: "pii"
164+
configuration:
165+
enabled: true
166+
pii_types_allowed: []
167+
168+
- name: "product_inquiry_decision"
169+
description: "Product information and specifications"
170+
priority: 100
171+
rules:
172+
operator: "AND"
173+
conditions:
174+
- type: "domain"
175+
name: "product_inquiry"
176+
modelRefs:
177+
- model: "qwen3"
178+
use_reasoning: false
179+
plugins:
180+
- type: "system_prompt"
181+
configuration:
182+
system_prompt: "You are a product specialist. Provide accurate information about products, features, pricing, and availability. Be helpful and informative."
183+
- type: "jailbreak"
184+
configuration:
185+
enabled: true
186+
- type: "pii"
187+
configuration:
188+
enabled: false
189+
pii_types_allowed: []
190+
191+
- name: "account_management_decision"
192+
description: "Account and subscription management"
193+
priority: 100
194+
rules:
195+
operator: "AND"
196+
conditions:
197+
- type: "domain"
198+
name: "account_management"
199+
modelRefs:
200+
- model: "qwen3"
201+
use_reasoning: false
202+
plugins:
203+
- type: "system_prompt"
204+
configuration:
205+
system_prompt: "You are an account management assistant. Help users with account-related tasks such as password resets, profile updates, and subscription management. Prioritize security and privacy."
206+
- type: "jailbreak"
207+
configuration:
208+
enabled: true
209+
- type: "pii"
210+
configuration:
211+
enabled: true
212+
pii_types_allowed: []
213+
214+
- name: "general_inquiry_decision"
215+
description: "General questions and information requests"
216+
priority: 50
217+
rules:
218+
operator: "AND"
219+
conditions:
220+
- type: "domain"
221+
name: "general_inquiry"
222+
modelRefs:
223+
- model: "qwen3"
163224
use_reasoning: false
164-
jailbreak_enabled: true
165-
pii_enabled: false
225+
plugins:
226+
- type: "system_prompt"
227+
configuration:
228+
system_prompt: "You are a helpful general assistant. Answer questions clearly and concisely. If you need more information, ask clarifying questions."
229+
- type: "jailbreak"
230+
configuration:
231+
enabled: true
232+
- type: "pii"
233+
configuration:
234+
enabled: false
235+
pii_types_allowed: []
166236

167237
# Embedding Models Configuration
168238
# These models provide intelligent embedding generation with automatic routing:

0 commit comments

Comments
 (0)