MCPcopy Create free account
hub / github.com/InferCore/InferCore / testRouterConfig

Function testRouterConfig

internal/router/rule_router_test.go:12–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10)
11
12func testRouterConfig() *config.Config {
13 return &config.Config{
14 Backends: []config.BackendConfig{
15 {
16 Name: "small-model",
17 Cost: config.CostConfig{Unit: 1},
18 Capabilities: []string{"chat", "summarization"},
19 },
20 {
21 Name: "large-model",
22 Cost: config.CostConfig{Unit: 5},
23 Capabilities: []string{"chat", "reasoning", "summarization"},
24 },
25 },
26 Tenants: []config.TenantConfig{
27 {ID: "team-a", Class: "premium", BudgetPerRequest: 10},
28 },
29 Routing: config.RoutingConfig{
30 DefaultBackend: "small-model",
31 Rules: []config.RouteRule{
32 {
33 Name: "premium-simple-expensive-route",
34 When: config.RouteWhen{
35 TenantClass: "premium",
36 TaskType: "simple",
37 },
38 UseBackend: "large-model",
39 },
40 },
41 },
42 }
43}
44
45func TestRuleRouter_UsesRuleMatch(t *testing.T) {
46 r := NewRuleRouter(testRouterConfig(), nil)

Calls

no outgoing calls

Tested by

no test coverage detected