mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
fix - proxy /health checks
This commit is contained in:
parent
0e2bd57e94
commit
be1e88bead
1 changed files with 3 additions and 3 deletions
|
@ -8369,7 +8369,7 @@ async def health_endpoint(
|
||||||
```
|
```
|
||||||
else, the health checks will be run on models when /health is called.
|
else, the health checks will be run on models when /health is called.
|
||||||
"""
|
"""
|
||||||
global health_check_results, use_background_health_checks, user_model
|
global health_check_results, use_background_health_checks, user_model, llm_model_list
|
||||||
try:
|
try:
|
||||||
if llm_model_list is None:
|
if llm_model_list is None:
|
||||||
# if no router set, check if user set a model using litellm --model ollama/llama2
|
# if no router set, check if user set a model using litellm --model ollama/llama2
|
||||||
|
@ -8387,7 +8387,7 @@ async def health_endpoint(
|
||||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||||
detail={"error": "Model list not initialized"},
|
detail={"error": "Model list not initialized"},
|
||||||
)
|
)
|
||||||
|
_llm_model_list = copy.deepcopy(llm_model_list)
|
||||||
### FILTER MODELS FOR ONLY THOSE USER HAS ACCESS TO ###
|
### FILTER MODELS FOR ONLY THOSE USER HAS ACCESS TO ###
|
||||||
if len(user_api_key_dict.models) > 0:
|
if len(user_api_key_dict.models) > 0:
|
||||||
allowed_model_names = user_api_key_dict.models
|
allowed_model_names = user_api_key_dict.models
|
||||||
|
@ -8397,7 +8397,7 @@ async def health_endpoint(
|
||||||
return health_check_results
|
return health_check_results
|
||||||
else:
|
else:
|
||||||
healthy_endpoints, unhealthy_endpoints = await perform_health_check(
|
healthy_endpoints, unhealthy_endpoints = await perform_health_check(
|
||||||
llm_model_list, model
|
_llm_model_list, model
|
||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue