Merge pull request #4518 from BerriAI/litellm_fix_background_health_checks

[Fix-Proxy] Background health checks use deep copy of model list for _run_background_health_check
This commit is contained in:
Ishaan Jaff 2024-07-02 16:42:34 -07:00 committed by GitHub
commit 174b2b69df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1182,9 +1182,13 @@ async def _run_background_health_check():
Update health_check_results, based on this.
"""
global health_check_results, llm_model_list, health_check_interval
# make 1 deep copy of llm_model_list -> use this for all background health checks
_llm_model_list = copy.deepcopy(llm_model_list)
while True:
healthy_endpoints, unhealthy_endpoints = await perform_health_check(
model_list=llm_model_list
model_list=_llm_model_list
)
# Update the global variable with the health check results