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]

refactor(proxy): use a walrus assignment in the deployment model gate

mateo-berri07321225360c
diff --git a/litellm/proxy/common_request_processing.py b/litellm/proxy/common_request_processing.py
index d25ef8a3039..07dea5268d8 100644
--- a/litellm/proxy/common_request_processing.py
+++ b/litellm/proxy/common_request_processing.py
@@ -277,8 +277,7 @@ def _model_deployments_support_stream_options(
deployment_models = tuple(
litellm_model
for deployment in deployments or ()
- for litellm_model in (_deployment_litellm_model(deployment),)
- if litellm_model is not None
+ if (litellm_model := _deployment_litellm_model(deployment)) is not None
)
candidate_models = deployment_models if deployment_models else (model,)
return all(_litellm_model_supports_stream_options(m) for m in candidate_models)