feat(config): add support for disabling OpenAI compatibility providers
- Introduced a `Disabled` flag to OpenAI compatibility configurations. - Updated routing, auth selection, and API handling logic to respect the `Disabled` state. - Extended relevant APIs, YAML configurations, and data structures to include the `Disabled` field. - Adjusted all relevant loops and filters to skip disabled providers. Closes: #3060 #3059 #2977
This commit is contained in:
@@ -98,6 +98,9 @@ func IsOpenAICompatibilityAlias(modelName string, cfg *config.Config) bool {
|
||||
}
|
||||
|
||||
for _, compat := range cfg.OpenAICompatibility {
|
||||
if compat.Disabled {
|
||||
continue
|
||||
}
|
||||
for _, model := range compat.Models {
|
||||
if model.Alias == modelName {
|
||||
return true
|
||||
@@ -123,6 +126,9 @@ func GetOpenAICompatibilityConfig(alias string, cfg *config.Config) (*config.Ope
|
||||
}
|
||||
|
||||
for _, compat := range cfg.OpenAICompatibility {
|
||||
if compat.Disabled {
|
||||
continue
|
||||
}
|
||||
for _, model := range compat.Models {
|
||||
if model.Alias == alias {
|
||||
return &compat, &model
|
||||
|
||||
Reference in New Issue
Block a user