14 lines
671 B
Diff
14 lines
671 B
Diff
# UNDF: UNDF-2026-000000869
|
|
--- a/litellm/proxy/proxy_server.py
|
|
+++ b/litellm/proxy/proxy_server.py
|
|
@@ -3876,8 +3876,9 @@ class ProxyConfig:
|
|
router_model_ids = llm_router.get_model_ids()
|
|
# Check for model IDs in llm_router not present in combined_id_list and delete them
|
|
|
|
+ combined_id_set = set(combined_id_list) # O(1) lookup instead of O(N) list scan
|
|
deleted_deployments = 0
|
|
for model_id in router_model_ids:
|
|
- if model_id not in combined_id_list:
|
|
+ if model_id not in combined_id_set:
|
|
is_deleted = llm_router.delete_deployment(id=model_id)
|
|
if is_deleted is not None:
|