From eea7fa381eb65d69ca2f156c53d6d144d4025e6b Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 19 Mar 2026 09:14:50 -0400 Subject: [PATCH] Remove unreachable tool-model validation check _TOOL_CALLING_MODELS equals _SUPPORTED_MODELS, so any model passing _validate_model() at init always passes this check too. --- src/pipecat/services/sarvam/llm.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/pipecat/services/sarvam/llm.py b/src/pipecat/services/sarvam/llm.py index d00d2a5cc..9b237d11b 100644 --- a/src/pipecat/services/sarvam/llm.py +++ b/src/pipecat/services/sarvam/llm.py @@ -210,14 +210,6 @@ class SarvamLLMService(OpenAILLMService): if has_tool_choice and not has_tools: raise ValueError("Sarvam requires non-empty `tools` when `tool_choice` is provided.") - # Validate early to provide deterministic errors before network calls. - if has_tools and self._settings.model not in self._TOOL_CALLING_MODELS: - allowed = ", ".join(sorted(self._TOOL_CALLING_MODELS)) - raise ValueError( - f"Model '{self._settings.model}' does not support tools. " - f"Supported models: {allowed}." - ) - def _format_raw_server_error(self, error: Exception) -> str: raw_message = self._extract_raw_server_message(error) return f"Sarvam server error: {raw_message}"