Merge pull request #5431 from BerriAI/litellm_Add_fireworks_ai_health_check

[Fix-Proxy] /health check for provider wildcard models (fireworks/*)
This commit is contained in:
Ishaan Jaff 2024-08-29 14:25:05 -07:00 committed by GitHub
commit 5851a8f901
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 71 additions and 2 deletions

View file

@ -5076,6 +5076,18 @@ async def ahealth_check(
model_params["prompt"] = prompt
await litellm.aimage_generation(**model_params)
response = {}
elif "*" in model:
from litellm.litellm_core_utils.llm_request_utils import (
pick_cheapest_model_from_llm_provider,
)
# this is a wildcard model, we need to pick a random model from the provider
cheapest_model = pick_cheapest_model_from_llm_provider(
custom_llm_provider=custom_llm_provider
)
model_params["model"] = cheapest_model
await acompletion(**model_params)
response = {} # args like remaining ratelimit etc.
else: # default to completion calls
await acompletion(**model_params)
response = {} # args like remaining ratelimit etc.