hasCustomBaseURL checks if a model config has a custom base_url, either directly or through a referenced provider definition.
(modelCfg *latest.ModelConfig, providers map[string]latest.ProviderConfig)
| 57 | // hasCustomBaseURL checks if a model config has a custom base_url, either directly |
| 58 | // or through a referenced provider definition. |
| 59 | func hasCustomBaseURL(modelCfg *latest.ModelConfig, providers map[string]latest.ProviderConfig) bool { |
| 60 | // Check if the model has a direct base_url |
| 61 | if modelCfg.BaseURL != "" { |
| 62 | return true |
| 63 | } |
| 64 | |
| 65 | // Check if the model references a provider with a base_url |
| 66 | if providers != nil && modelCfg.Provider != "" { |
| 67 | if providerCfg, exists := providers[modelCfg.Provider]; exists { |
| 68 | return providerCfg.BaseURL != "" |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | return false |
| 73 | } |
no outgoing calls