From e2d7c226e09b4f8436cdc3dbc24660c11f349ed7 Mon Sep 17 00:00:00 2001 From: Shxiao101 Date: Mon, 28 Sep 2026 21:01:14 +0900 Subject: [PATCH 1/2] refactor(types): support ModelInfo in DeploymentTypedDict model_info --- litellm/types/router.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/litellm/types/router.py b/litellm/types/router.py index d545f7ae639..14c0be1fb07 100644 --- a/litellm/types/router.py +++ b/litellm/types/router.py @@ -637,8 +637,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) From 6878adca2bb92b0a64d596fc5bebd7c3ef8c2f79 Mon Sep 17 00:00:00 2001 From: Shxiao101 Date: Mon, 28 Sep 2026 21:53:59 +0900 Subject: [PATCH 2/2] fix(router): normalize model_info to dict in set_model_list --- litellm/router.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/litellm/router.py b/litellm/router.py index cfed5dc81c0..cab3deb0ca1 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -9428,7 +9428,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"])