From 78b8a5f415597d453c6f37fb20fa4e2fdade8933 Mon Sep 17 00:00:00 2001 From: Syed Ahmed Mubasiruddin Date: Mon, 31 Aug 2026 09:42:26 +0000 Subject: [PATCH] fix: declare batched embedding accumulator final --- litellm/router_strategy/auto_router/litellm_encoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/router_strategy/auto_router/litellm_encoder.py b/litellm/router_strategy/auto_router/litellm_encoder.py index 71267f7d955..d68754743f0 100644 --- a/litellm/router_strategy/auto_router/litellm_encoder.py +++ b/litellm/router_strategy/auto_router/litellm_encoder.py @@ -147,7 +147,7 @@ class LiteLLMRouterEncoder(CustomDenseEncoder, AsymmetricDenseMixin): if self.litellm_router_instance is None: raise ValueError("litellm_router_instance is not set") - embeddings: list[list[float]] = [] # mutable-ok: used to accumulate embeddings in batches + embeddings: Final[list[list[float]]] = [] # mutable-ok: used to accumulate embeddings in batches for i in range(0, len(docs), EMBEDDING_BATCH_SIZE): batch = docs[i : i + EMBEDDING_BATCH_SIZE]