fix: add isinstance(str) check to get_api_base fast path

Ensures non-string api_base values (e.g. int, list) fall through
to Pydantic validation instead of being returned directly.
This commit is contained in:
Ryan Crabbe 2026-02-07 09:51:51 -08:00
parent f655f47d84
commit 769d1777fc

View file

@ -32,7 +32,7 @@ def get_api_base(
# without constructing a full LiteLLM_Params Pydantic model.
if isinstance(optional_params, dict):
_api_base = optional_params.get("api_base")
if _api_base is not None:
if isinstance(_api_base, str):
return _api_base
try: