This commit is contained in:
Shxiao 2026-09-30 16:58:05 -04:00 • committed by GitHub
commit 3051a39ad2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -9513,7 +9513,12 @@ class Router:
if isinstance(v, str) and v.startswith("os.environ/"):
_litellm_params[k] = get_secret(v)
_model_info: dict = model.pop("model_info", {})
_raw_model_info = model.pop("model_info", {})
_model_info: dict = (
_raw_model_info.model_dump(exclude_none=True)
if hasattr(_raw_model_info, "model_dump")
else (_raw_model_info or {})
)
declared_id = None if _model_info.get("id") is None else str(_model_info["id"])

View file

@ -638,8 +638,7 @@ class LiteLLMParamsTypedDict(TypedDict, total=False):
class DeploymentTypedDict(TypedDict, total=False):
model_name: Required[str]
litellm_params: Required[LiteLLMParamsTypedDict]
model_info: dict
model_info: dict | ModelInfo
SPECIAL_MODEL_INFO_PARAMS = tuple(MirroredPricingParams.model_fields)