Skip to content

Commit 93e4cc3

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

File tree

15 files changed

+2183
-444
lines changed

15 files changed

+2183
-444
lines changed

.crd-ref-docs.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
processor:
2+
# Ignore fields that are common to all Kubernetes resources
3+
ignoreFields:
4+
- "TypeMeta"
5+
- "ObjectMeta"
6+
- "ListMeta"
7+
8+
# Ignore types that are not relevant for documentation
9+
ignoreTypes:
10+
- "metav1.Time"
11+
- "metav1.Duration"
12+
- "metav1.ObjectMeta"
13+
- "metav1.TypeMeta"
14+
- "metav1.ListMeta"
15+
16+
# Source path for Go API types
17+
sourcePath: "./src/semantic-router/pkg/apis/vllm.ai/v1alpha1"
18+
19+
render:
20+
# Enable Kubebuilder markers rendering
21+
kubebuilderMarkers: true
22+
23+
# Group resources by Kind
24+
groupByKind: true
25+
26+
# Include table of contents
27+
includeTableOfContents: true
28+
29+
# Custom templates (optional)
30+
# templatesDir: "./docs/crd-templates"
31+
32+
# Output format: markdown, asciidoc, or html
33+
format: markdown
34+
35+
# Custom configuration for your CRDs
36+
groups:
37+
- name: vllm.ai
38+
displayName: "vLLM Semantic Router"
39+
description: |
40+
Custom Resource Definitions for vLLM Semantic Router.
41+
These CRDs enable declarative configuration of intelligent routing and model pools.
42+
43+
kinds:
44+
- name: IntelligentRoute
45+
displayName: "Intelligent Route"
46+
description: |
47+
IntelligentRoute defines intelligent routing rules and decisions for LLM requests.
48+
It supports decision-based routing with rule combinations, model references, and plugins.
49+
50+
- name: IntelligentPool
51+
displayName: "Intelligent Pool"
52+
description: |
53+
IntelligentPool defines a pool of LLM models with their configurations.
54+
It manages model endpoints, reasoning families, and model-specific settings.
55+
56+
# Markdown rendering options
57+
markdown:
58+
# Header level for the main title
59+
headerLevel: 1
60+
61+
# Include examples in the documentation
62+
includeExamples: true
63+
64+
# Include status subresource documentation
65+
includeStatus: true
66+
67+
# Code block language for YAML examples
68+
codeBlockLanguage: yaml

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

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,47 @@ classifier:
1717

1818
# Define your generic categories and map them to MMLU-Pro categories.
1919
# The classifier will translate predicted MMLU categories into these generic names.
20+
# Categories now only contain metadata - routing logic is defined in decisions below.
2021
categories:
2122
- name: tech
2223
mmlu_categories: ["computer science", "engineering"]
23-
model_scores:
24-
- model: phi4
25-
score: 0.9
26-
- model: mistral-small3.1
27-
score: 0.7
2824
- name: finance
2925
mmlu_categories: ["economics"]
30-
model_scores:
31-
- model: gemma3:27b
32-
score: 0.8
3326
- name: politics
3427
# If omitted, identity mapping applies when this name matches MMLU
35-
model_scores:
28+
29+
# Decisions define routing logic by combining rules and model selection
30+
decisions:
31+
- name: tech
32+
description: "Route technology-related queries"
33+
priority: 10
34+
rules:
35+
operator: "OR"
36+
conditions:
37+
- type: "domain"
38+
name: "tech"
39+
modelRefs:
40+
- model: phi4
41+
- name: finance
42+
description: "Route finance and economics queries"
43+
priority: 10
44+
rules:
45+
operator: "OR"
46+
conditions:
47+
- type: "domain"
48+
name: "finance"
49+
modelRefs:
50+
- model: gemma3:27b
51+
- name: politics
52+
description: "Route politics-related queries"
53+
priority: 10
54+
rules:
55+
operator: "OR"
56+
conditions:
57+
- type: "domain"
58+
name: "politics"
59+
modelRefs:
3660
- model: gemma3:27b
37-
score: 0.6
3861

3962
# A default model is recommended for fallback
4063
default_model: mistral-small3.1

0 commit comments

Comments
 (0)