{"record":{"id":"62219b6c563729d0","repo":"BerriAI/litellm","slug":"team-id-model-params-model-info-team-id-does-not","errorCode":null,"errorMessage":"Team id={model_params.model_info.team_id} does not exist in db","messagePattern":"Team id=(.+?) does not exist in db","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_management_endpoints.py","lineNumber":1477,"sourceCode":"        model_params: Deployment | updateDeployment,\n        user_api_key_dict: UserAPIKeyAuth,\n        prisma_client: PrismaClient,\n        premium_user: bool,\n    ) -> Literal[True]:\n        if model_params.model_info is None or model_params.model_info.team_id is None:\n            return True\n        if model_params.model_info.team_id is not None and premium_user is not True:\n            raise HTTPException(\n                status_code=403,\n                detail={\"error\": CommonProxyErrors.not_premium_user.value},\n            )\n\n        _existing_team_row: Final = await _repo_team_table(prisma_client).find_unique(\n            where={\"team_id\": model_params.model_info.team_id}\n        )\n\n        if _existing_team_row is None:\n            raise HTTPException(\n                status_code=400,\n                detail={\"error\": f\"Team id={model_params.model_info.team_id} does not exist in db\"},\n            )\n        existing_team_row: Final = LiteLLM_TeamTable.model_validate(_existing_team_row.model_dump())\n\n        ModelManagementAuthChecks.can_user_make_team_model_call(\n            team_id=model_params.model_info.team_id,\n            user_api_key_dict=user_api_key_dict,\n            team_obj=existing_team_row,\n            premium_user=premium_user,\n        )\n        return True\n\n    @staticmethod\n    async def can_user_make_model_call(\n        model_params: Deployment,\n        user_api_key_dict: UserAPIKeyAuth,\n        prisma_client: PrismaClient,","sourceCodeStart":1459,"sourceCodeEnd":1495,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_management_endpoints.py#L1459-L1495","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:1477 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the team first, or set model_info.team_id to an existing team."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}