Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

style: make _model_supports_effort_param more concise

mateo-berri1ac430cfeafd
diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.py
index 6e76a9c85e9..de021ed0c46 100644
--- a/litellm/llms/anthropic/chat/transformation.py
+++ b/litellm/llms/anthropic/chat/transformation.py
@@ -285,10 +285,8 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
@staticmethod
def _model_supports_effort_param(model: str) -> bool:
"""Whether the model accepts ``output_config.effort`` at all."""
- for level in ("low", "minimal", "medium", "high", "xhigh", "max"):
- if AnthropicConfig._supports_effort_level(model, level):
- return True
- return False
+ return any(AnthropicConfig._supports_effort_level(model, level)
+ for level in ("low", "minimal", "medium", "high", "xhigh", "max"))
def get_supported_openai_params(self, model: str):
params = [