From 83a5e44ed954fe47e2c70bcb0e1aa19087558e5a Mon Sep 17 00:00:00 2001 From: Kevin Pedretti Date: Tue, 25 Nov 2025 16:57:24 -0700 Subject: [PATCH] Add catch-all to if/elseif block... if no other provider detected, set the OPENAI_API_KEY by default. This fixes an issue where if the model_url doesn't contain one of the expected strings, no api_key gets set. Since OPENAI_API_KEY seems to be the most common, use it by default. --- backend/modules/llm/litellm_caller.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/modules/llm/litellm_caller.py b/backend/modules/llm/litellm_caller.py index b81ef58..931f05f 100644 --- a/backend/modules/llm/litellm_caller.py +++ b/backend/modules/llm/litellm_caller.py @@ -99,6 +99,8 @@ def _get_model_kwargs(self, model_name: str, temperature: Optional[float] = None os.environ["GOOGLE_API_KEY"] = api_key elif "cerebras" in model_config.model_url: os.environ["CEREBRAS_API_KEY"] = api_key + else: + os.environ["OPENAI_API_KEY"] = api_key # Set custom API base for non-standard endpoints if hasattr(model_config, 'model_url') and model_config.model_url: