BerriAI/litellm · error · HTTPException
Team id={model_params.model_info.team_id} does not exist in
Error message
Team id={model_params.model_info.team_id} does not exist in db What it means
Referential-integrity guard in ModelManagementAuthChecks: model_info carries a team_id (premium feature gating team-scoped models) but no LiteLLM_TeamTable row exists for it in the DB, so the model would reference a phantom team; rejected with 403.
Source
Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:1477
model_params: Deployment | updateDeployment,
user_api_key_dict: UserAPIKeyAuth,
prisma_client: PrismaClient,
premium_user: bool,
) -> Literal[True]:
if model_params.model_info is None or model_params.model_info.team_id is None:
return True
if model_params.model_info.team_id is not None and premium_user is not True:
raise HTTPException(
status_code=403,
detail={"error": CommonProxyErrors.not_premium_user.value},
)
_existing_team_row: Final = await _repo_team_table(prisma_client).find_unique(
where={"team_id": model_params.model_info.team_id}
)
if _existing_team_row is None:
raise HTTPException(
status_code=400,
detail={"error": f"Team id={model_params.model_info.team_id} does not exist in db"},
)
existing_team_row: Final = LiteLLM_TeamTable.model_validate(_existing_team_row.model_dump())
ModelManagementAuthChecks.can_user_make_team_model_call(
team_id=model_params.model_info.team_id,
user_api_key_dict=user_api_key_dict,
team_obj=existing_team_row,
premium_user=premium_user,
)
return True
@staticmethod
async def can_user_make_model_call(
model_params: Deployment,
user_api_key_dict: UserAPIKeyAuth,
prisma_client: PrismaClient,View on GitHub (pinned to 77b7c6c40c)
Solutions
- Create the team first, or set model_info.team_id to an existing team.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:1477 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/62219b6c563729d0.
Report an issue: GitHub.