From cc8a8c0a2a523c28446ca29c27cfd49ad8244840 Mon Sep 17 00:00:00 2001 From: shivam Date: Fri, 4 Sep 2026 02:57:01 +0000 Subject: [PATCH] fix(router): keep model_group_alias precedence over team marker lookup Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/router.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index 8873ac16506..58fc6b1cfd3 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -13021,13 +13021,13 @@ class Router: `model` is whatever the caller asked for, which may be a `model_group_alias` key, while the strategy registries and the marker deployment are keyed by the marker's own `model_name`, so - every lookup below resolves the team public name or alias first. Only the lookups: the + every lookup below resolves the alias, then the team public name, first. Only the lookups: the caller-facing name stays the alias, since spend metadata is stamped before routing and the response carries the tier group the strategy picked. """ requested_registered_model_name: Final = ( - self._team_strategy_marker_model_name(model=model, request_kwargs=request_kwargs) - or self._get_model_from_alias(model=model) + self._get_model_from_alias(model=model) + or self._team_strategy_marker_model_name(model=model, request_kwargs=request_kwargs) or model ) registered_model_name: Final = await self._resolve_claude_code_session_router(