diff --git a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py index fdad7851f1..112d378378 100644 --- a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py +++ b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py @@ -220,11 +220,8 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig): def _supports_penalty_parameters(self, model: str) -> bool: unsupported_models = ["gemini-2.5-pro-preview-06-05"] - - for pattern in unsupported_models: - if model in pattern: - return False - + if model in unsupported_models: + return False return True def get_supported_openai_params(self, model: str) -> List[str]: diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index eaf2c6c4ff..dbd795e1b3 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -985,7 +985,7 @@ class ProxyLogging: ) else: _callback = callback # type: ignore - if _callback is not None and isinstance(_callback, CustomGuardrail): + if _callback is not None and isinstance(_callback, CustomGuardrail) and data is not None: result = await self._process_guardrail_callback( callback=_callback, data=data,