diff --git a/litellm/proxy/management_endpoints/scim/scim_transformations.py b/litellm/proxy/management_endpoints/scim/scim_transformations.py index 6a67093fde8..26d48d96845 100644 --- a/litellm/proxy/management_endpoints/scim/scim_transformations.py +++ b/litellm/proxy/management_endpoints/scim/scim_transformations.py @@ -165,7 +165,7 @@ class ScimTransformations: raise HTTPException(status_code=500, detail={"error": "No database connected"}) if isinstance(team, dict): - team = LiteLLM_TeamTable(**team) + team = LiteLLM_TeamTable.model_validate(team) # Get team members with proper display names scim_members: Final[list[SCIMMember]] = [] diff --git a/litellm/proxy/management_endpoints/team_callback_endpoints.py b/litellm/proxy/management_endpoints/team_callback_endpoints.py index 3908ab3c927..9d05c431c45 100644 --- a/litellm/proxy/management_endpoints/team_callback_endpoints.py +++ b/litellm/proxy/management_endpoints/team_callback_endpoints.py @@ -341,7 +341,7 @@ async def add_team_callbacks( # authenticated key holder could overwrite another team's logging # config (and read back the credentials they wrote). if not await get_team_access().allows( - user_api_key_dict, LiteLLM_TeamTable(**_existing_team.model_dump()), TEAM_OR_ORG_ADMIN + user_api_key_dict, LiteLLM_TeamTable.model_validate(_existing_team.model_dump()), TEAM_OR_ORG_ADMIN ): team_access_denied() @@ -516,7 +516,7 @@ async def delete_team_callback( # deregister its callbacks, otherwise any authenticated key holder could # silence another team's observability integration. if not await get_team_access().allows( - user_api_key_dict, LiteLLM_TeamTable(**_existing_team.model_dump()), TEAM_OR_ORG_ADMIN + user_api_key_dict, LiteLLM_TeamTable.model_validate(_existing_team.model_dump()), TEAM_OR_ORG_ADMIN ): team_access_denied() @@ -649,7 +649,7 @@ async def disable_team_logging( # team may disable its logging — otherwise any authenticated key # holder can silence audit logging for any team. if not await get_team_access().allows( - user_api_key_dict, LiteLLM_TeamTable(**_existing_team.model_dump()), TEAM_OR_ORG_ADMIN + user_api_key_dict, LiteLLM_TeamTable.model_validate(_existing_team.model_dump()), TEAM_OR_ORG_ADMIN ): team_access_denied() @@ -790,7 +790,7 @@ async def get_team_callbacks( # (Langfuse / Langsmith / GCS). Only proxy admins / org admins / # team admins of THIS team may read them. if not await get_team_access().allows( - user_api_key_dict, LiteLLM_TeamTable(**_existing_team.model_dump()), TEAM_OR_ORG_ADMIN + user_api_key_dict, LiteLLM_TeamTable.model_validate(_existing_team.model_dump()), TEAM_OR_ORG_ADMIN ): team_access_denied() diff --git a/litellm/proxy/management_endpoints/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.py index ae6da2ea98e..db3c31bd39d 100644 --- a/litellm/proxy/management_endpoints/team_endpoints.py +++ b/litellm/proxy/management_endpoints/team_endpoints.py @@ -1769,9 +1769,8 @@ async def new_team( ) ## ADD TO TEAM TABLE - complete_team_data: Final = LiteLLM_TeamTable( - **data_json, - model_id=_model_id, + complete_team_data: Final = LiteLLM_TeamTable.model_validate( + {**data_json, "model_id": _model_id}, ) # Set Management Endpoint Metadata Fields