From ec0fdf35ddffd80f985a25d42cfaf0db1dfecf5d Mon Sep 17 00:00:00 2001 From: Hasnaat Hussain Date: Thu, 13 Aug 2026 01:28:29 +0500 Subject: [PATCH] fix(utils): avoid mutable fallback in dimension guard Signed-off-by: Hasnaat Hussain --- litellm/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index 4bc3d9e2a9b..ec8ee0b0e86 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -3764,13 +3764,12 @@ def get_optional_params_embeddings( if "extra_body" in final_params and len(final_params["extra_body"]) == 0: final_params.pop("extra_body", None) - # High-performance check optimized to avoid allocations in hot paths if ( (litellm.drop_params is True or drop_params is True) and (custom_llm_provider == "azure" or custom_llm_provider in litellm.openai_compatible_providers) and model is not None and "text-embedding-3" not in model - and "dimensions" not in (allowed_openai_params or []) + and "dimensions" not in (allowed_openai_params or ()) ): final_params.pop("dimensions", None)