From 33df79adb6a15579cdb8b34d6d98702c35bd96ec Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Thu, 19 Jun 2025 15:14:21 +0300 Subject: [PATCH] skip model name validation with custom provider URL --- internal/models/providers.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/models/providers.go b/internal/models/providers.go index 8f4f2aa9..a3e5cc76 100644 --- a/internal/models/providers.go +++ b/internal/models/providers.go @@ -48,8 +48,8 @@ func CreateProvider(ctx context.Context, config *ProviderConfig) (model.ToolCall // Get the global registry for validation registry := GetGlobalRegistry() - // Validate the model exists (skip for ollama as it's not in models.dev) - if provider != "ollama" { + // Validate the model exists (skip for ollama as it's not in models.dev, and skip when using custom provider URL) + if provider != "ollama" && config.ProviderURL == "" { modelInfo, err := registry.ValidateModel(provider, modelName) if err != nil { // Provide helpful suggestions @@ -162,11 +162,13 @@ func createOpenAIProvider(ctx context.Context, config *ProviderConfig, modelName openaiConfig.BaseURL = config.ProviderURL } - // Check if this is a reasoning model to handle beta limitations + // Check if this is a reasoning model to handle beta limitations (skip validation if using custom URL) registry := GetGlobalRegistry() isReasoningModel := false - if modelInfo, err := registry.ValidateModel("openai", modelName); err == nil && modelInfo.Reasoning { - isReasoningModel = true + if config.ProviderURL == "" { + if modelInfo, err := registry.ValidateModel("openai", modelName); err == nil && modelInfo.Reasoning { + isReasoningModel = true + } } if config.MaxTokens > 0 {