mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
fix(ai_usage_chat): route model_group_alias through llm_router
When pass_through_all_models is enabled, _acompletion fell back to litellm.acompletion for any model not in model_names / has_model_id, which incorrectly bypasses router-only aliases configured via model_group_alias. Match route_llm_request's behavior by treating alias lookups as router-managed too.
This commit is contained in:
parent
55191d6f19
commit
b146a1e16b
1 changed files with 2 additions and 0 deletions
|
|
@ -443,10 +443,12 @@ async def _acompletion(**kwargs: Any) -> Any:
|
|||
# does. Otherwise proxies that route some models via the router but
|
||||
# allow pass-through for everything else would 400 here.
|
||||
model = kwargs.get("model")
|
||||
model_group_alias = llm_router.model_group_alias or {}
|
||||
if (
|
||||
llm_router.router_general_settings.pass_through_all_models
|
||||
and model not in llm_router.model_names
|
||||
and not llm_router.has_model_id(model or "")
|
||||
and model not in model_group_alias
|
||||
):
|
||||
return await litellm.acompletion(**kwargs)
|
||||
return await llm_router.acompletion(**kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue