fix(router): read a deployment's upstream model without a not-required key access

This commit is contained in:
ryan-crabbe-berri 2026-11-02 22:57:46 -08:00
parent 2e0939d2f2
commit 1526df0851

View file

@ -12754,8 +12754,11 @@ class PythonCore(DeprecatedRouterMembers):
Returns an empty tuple for wildcard-expanded or unknown names.
"""
return tuple(
self._core_cached_deployment_model_info(deployment_id, deployment["litellm_params"]["model"])
self._core_cached_deployment_model_info(deployment_id, model)
if isinstance(deployment_id := _configured_model_info(deployment).get("id"), str)
and isinstance(
model := _LITELLM_PARAMS_ADAPTER.validate_python(deployment["litellm_params"]).get("model"), str
)
else None
for deployment in self._routable_deployments(model_name, team_id)
)