{"record":{"id":"9536d150d5e2e0ea","repo":"BerriAI/litellm","slug":"allocated-tpm-limit-allocated-tpm-team-tpm-lim","errorCode":null,"errorMessage":"Allocated TPM limit={allocated_tpm} + Team TPM limit={data.tpm_limit} is greater than {entity_type} TPM limit={entity_tpm_limit}","messagePattern":"Allocated TPM limit=(.+?) \\+ Team TPM limit=(.+?) is greater than (.+?) TPM limit=(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_endpoints.py","lineNumber":851,"sourceCode":"    entity_type: str,  # \"organization\"\n) -> None:\n    \"\"\"\n    Generic function to check if a team is allocating rpm/tpm limits.\n    Raises an error if we're overallocating.\n    \"\"\"\n    if teams is not None and len(teams) > 0:\n        allocated_tpm = sum(team.tpm_limit for team in teams if team.tpm_limit is not None)\n        allocated_rpm = sum(team.rpm_limit for team in teams if team.rpm_limit is not None)\n    else:\n        allocated_tpm = 0\n        allocated_rpm = 0\n\n    if (\n        data.tpm_limit is not None\n        and entity_tpm_limit is not None\n        and data.tpm_limit + allocated_tpm > entity_tpm_limit\n    ):\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Allocated TPM limit={allocated_tpm} + Team TPM limit={data.tpm_limit} is greater than {entity_type} TPM limit={entity_tpm_limit}\",\n        )\n    if (\n        data.rpm_limit is not None\n        and entity_rpm_limit is not None\n        and data.rpm_limit + allocated_rpm > entity_rpm_limit\n    ):\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Allocated RPM limit={allocated_rpm} + Team RPM limit={data.rpm_limit} is greater than {entity_type} RPM limit={entity_rpm_limit}\",\n        )\n\n\ndef check_org_team_model_specific_limits(\n    teams: list[LiteLLM_TeamTable],\n    org_table: LiteLLM_OrganizationTable,\n    data: NewTeamRequest | UpdateTeamRequest,","sourceCodeStart":833,"sourceCodeEnd":869,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_endpoints.py#L833-L869","documentation":"Whole-entity TPM check: sum of tpm_limit already allocated to sibling teams plus data.tpm_limit exceeds the organization's tpm_limit, so team creation/update under that org is refused with 400 to avoid overallocating guaranteed throughput.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_endpoints.py:851 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Lower the team TPM limit so allocated + team TPM does not exceed the entity TPM limit."],"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"}