Merge b374d8a7df into 6126ede963
This commit is contained in:
commit
a399cce466
1 changed files with 9 additions and 1 deletions
|
|
@ -1360,7 +1360,7 @@ func (c *Config) GetModelConfig(modelName string) (*ModelConfig, error) {
|
|||
return matches[idx], nil
|
||||
}
|
||||
|
||||
// findMatches finds all ModelConfig entries with the given model_name.
|
||||
// findMatches finds all ModelConfig entries with the given model_name or model id.
|
||||
func (c *Config) findMatches(modelName string) []*ModelConfig {
|
||||
var matches []*ModelConfig
|
||||
for i := range c.ModelList {
|
||||
|
|
@ -1368,6 +1368,14 @@ func (c *Config) findMatches(modelName string) []*ModelConfig {
|
|||
matches = append(matches, c.ModelList[i])
|
||||
}
|
||||
}
|
||||
// If no matches found, also try matching by model id (e.g., "openai/gpt-4o")
|
||||
if len(matches) == 0 {
|
||||
for i := range c.ModelList {
|
||||
if c.ModelList[i].Model == modelName {
|
||||
matches = append(matches, c.ModelList[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
return matches
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue