From d57ecf337194301c9164e38225eb7bbd58595616 Mon Sep 17 00:00:00 2001 From: Rahul Kataria Date: Sun, 12 May 2024 18:05:57 +0530 Subject: [PATCH] Remove duplicate code in router_strategy --- litellm/router_strategy/lowest_cost.py | 3 --- litellm/router_strategy/lowest_latency.py | 3 --- 2 files changed, 6 deletions(-) diff --git a/litellm/router_strategy/lowest_cost.py b/litellm/router_strategy/lowest_cost.py index fde7781b9b0..1670490e168 100644 --- a/litellm/router_strategy/lowest_cost.py +++ b/litellm/router_strategy/lowest_cost.py @@ -101,9 +101,6 @@ class LowestCostLoggingHandler(CustomLogger): if precise_minute not in request_count_dict[id]: request_count_dict[id][precise_minute] = {} - if precise_minute not in request_count_dict[id]: - request_count_dict[id][precise_minute] = {} - ## TPM request_count_dict[id][precise_minute]["tpm"] = ( request_count_dict[id][precise_minute].get("tpm", 0) + total_tokens diff --git a/litellm/router_strategy/lowest_latency.py b/litellm/router_strategy/lowest_latency.py index a7b93d344db..81a0133a90f 100644 --- a/litellm/router_strategy/lowest_latency.py +++ b/litellm/router_strategy/lowest_latency.py @@ -115,9 +115,6 @@ class LowestLatencyLoggingHandler(CustomLogger): if precise_minute not in request_count_dict[id]: request_count_dict[id][precise_minute] = {} - if precise_minute not in request_count_dict[id]: - request_count_dict[id][precise_minute] = {} - ## TPM request_count_dict[id][precise_minute]["tpm"] = ( request_count_dict[id][precise_minute].get("tpm", 0) + total_tokens