From 259240fb469360bca76d65ec672351bc8941e311 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Fri, 13 Mar 2026 18:04:25 -0700 Subject: [PATCH] refactor(tag_regex): remove unnecessary _healthy_list copy --- litellm/router_strategy/tag_based_routing.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/litellm/router_strategy/tag_based_routing.py b/litellm/router_strategy/tag_based_routing.py index c4940d04aa8..825972712db 100644 --- a/litellm/router_strategy/tag_based_routing.py +++ b/litellm/router_strategy/tag_based_routing.py @@ -124,14 +124,9 @@ async def get_deployments_for_tag( # behaviour for operators who use plain tags: a request that carries a # User-Agent (all proxy requests do) but targets deployments with no # tag_regex will continue to use the original tag-only code path. - _healthy_list = ( - healthy_deployments - if isinstance(healthy_deployments, list) - else list(healthy_deployments) - ) has_regex_deployments = any( d.get("litellm_params", {}).get("tag_regex") - for d in _healthy_list + for d in healthy_deployments ) has_tag_filter = bool(request_tags) or ( bool(header_strings) and has_regex_deployments