Skip to content

Commit a6fcf61

Browse files
committed
more
1 parent e6cccd7 commit a6fcf61

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

config/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ default_model: "qwen3"
154154
# Example: auto_model_name: "MoM" # or any other name you prefer
155155
# auto_model_name: "MoM"
156156

157+
# Include configured models in /v1/models list endpoint (optional, default: false)
158+
# When false (default): only the auto model name is returned in the /v1/models endpoint
159+
# When true: all models configured in model_config are also included in the /v1/models endpoint
160+
# This is useful for clients that need to discover all available models
161+
# Example: include_config_models_in_list: true
162+
# include_config_models_in_list: false
163+
157164
# Reasoning family configurations
158165
reasoning_families:
159166
deepseek:

src/semantic-router/pkg/api/server_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@ func TestOpenAIModelsEndpoint(t *testing.T) {
359359
}
360360
}
361361

362-
// Must contain only 'auto' when IncludeConfigModelsInList is false
363-
if !got["auto"] {
364-
t.Errorf("expected list to contain 'auto'")
362+
// Must contain only 'MoM' (default auto model name) when IncludeConfigModelsInList is false
363+
if !got["MoM"] {
364+
t.Errorf("expected list to contain 'MoM', got: %v", got)
365365
}
366366
if len(resp.Data) != 1 {
367-
t.Errorf("expected only 1 model (auto), got %d: %v", len(resp.Data), got)
367+
t.Errorf("expected only 1 model (MoM), got %d: %v", len(resp.Data), got)
368368
}
369369
}
370370

@@ -425,9 +425,9 @@ func TestOpenAIModelsEndpointWithConfigModels(t *testing.T) {
425425
}
426426
}
427427

428-
// Must contain 'auto' and the configured models when IncludeConfigModelsInList is true
429-
if !got["auto"] {
430-
t.Errorf("expected list to contain 'auto'")
428+
// Must contain 'MoM' (default auto model name) and the configured models when IncludeConfigModelsInList is true
429+
if !got["MoM"] {
430+
t.Errorf("expected list to contain 'MoM', got: %v", got)
431431
}
432432
if !got["gpt-4o-mini"] || !got["llama-3.1-8b-instruct"] {
433433
t.Errorf("expected configured models to be present, got=%v", got)

src/semantic-router/pkg/extproc/models_endpoint_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,28 @@ func TestHandleModelsRequest(t *testing.T) {
6464
name: "GET /v1/models - only auto model (default)",
6565
config: cfg,
6666
path: "/v1/models",
67-
expectedModels: []string{"auto"},
67+
expectedModels: []string{"MoM"},
6868
expectedCount: 1,
6969
},
7070
{
7171
name: "GET /v1/models - with include_config_models_in_list enabled",
7272
config: cfgWithModels,
7373
path: "/v1/models",
74-
expectedModels: []string{"auto", "gpt-4o-mini", "llama-3.1-8b-instruct"},
74+
expectedModels: []string{"MoM", "gpt-4o-mini", "llama-3.1-8b-instruct"},
7575
expectedCount: 3,
7676
},
7777
{
7878
name: "GET /v1/models?model=auto - only auto model (default)",
7979
config: cfg,
8080
path: "/v1/models?model=auto",
81-
expectedModels: []string{"auto"},
81+
expectedModels: []string{"MoM"},
8282
expectedCount: 1,
8383
},
8484
{
8585
name: "GET /v1/models?model=auto - with include_config_models_in_list enabled",
8686
config: cfgWithModels,
8787
path: "/v1/models?model=auto",
88-
expectedModels: []string{"auto", "gpt-4o-mini", "llama-3.1-8b-instruct"},
88+
expectedModels: []string{"MoM", "gpt-4o-mini", "llama-3.1-8b-instruct"},
8989
expectedCount: 3,
9090
},
9191
}

0 commit comments

Comments
 (0)