mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix(health_check): preserve resolved api_base and api_key in ahealth_check (#37321)
This commit is contained in:
parent
0b82b087fd
commit
8a90b93714
1 changed files with 5 additions and 1 deletions
|
|
@ -8395,12 +8395,16 @@ async def ahealth_check(
|
|||
api_base_from_params: Final = model_params.get("api_base", None)
|
||||
api_key_from_params: Final = model_params.get("api_key", None)
|
||||
|
||||
model, custom_llm_provider, _, _ = get_llm_provider(
|
||||
model, custom_llm_provider, dynamic_api_key, returned_api_base = get_llm_provider(
|
||||
model=model,
|
||||
custom_llm_provider=custom_llm_provider_from_params,
|
||||
api_base=api_base_from_params,
|
||||
api_key=api_key_from_params,
|
||||
)
|
||||
if returned_api_base is not None and not model_params.get("api_base"):
|
||||
model_params["api_base"] = returned_api_base
|
||||
if dynamic_api_key is not None and not model_params.get("api_key"):
|
||||
model_params["api_key"] = dynamic_api_key
|
||||
if model in litellm.model_cost and mode is None:
|
||||
mode = litellm.model_cost[model].get("mode")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue