fix(internal_user_endpoints.py): allow internal user to query their own info, without knowing their id

make it easy to debug when admin endpoints don't work as expected
This commit is contained in:
Krrish Dholakia 2025-03-11 20:24:51 -07:00
parent 41e0e0f0c3
commit c784b8b74c
2 changed files with 14 additions and 4 deletions

View file

@ -7566,6 +7566,18 @@
"litellm_provider": "bedrock", "litellm_provider": "bedrock",
"mode": "embedding" "mode": "embedding"
}, },
"us.deepseek.r1-v1:0": {
"max_tokens": 4096,
"max_input_tokens": 128000,
"max_output_tokens": 4096,
"input_cost_per_token": 0.00000135,
"output_cost_per_token": 0.0000054,
"litellm_provider": "bedrock_converse",
"mode": "chat",
"supports_function_calling": false,
"supports_tool_choice": false
},
"meta.llama3-3-70b-instruct-v1:0": { "meta.llama3-3-70b-instruct-v1:0": {
"max_tokens": 4096, "max_tokens": 4096,
"max_input_tokens": 128000, "max_input_tokens": 128000,

View file

@ -365,6 +365,8 @@ async def user_info(
and user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN and user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN
): ):
return await _get_user_info_for_proxy_admin() return await _get_user_info_for_proxy_admin()
elif user_id is None:
user_id = user_api_key_dict.user_id
## GET USER ROW ## ## GET USER ROW ##
if user_id is not None: if user_id is not None:
user_info = await prisma_client.get_data(user_id=user_id) user_info = await prisma_client.get_data(user_id=user_id)
@ -373,10 +375,6 @@ async def user_info(
## GET ALL TEAMS ## ## GET ALL TEAMS ##
team_list = [] team_list = []
team_id_list = [] team_id_list = []
# get all teams user belongs to
# teams_1 = await prisma_client.get_data(
# user_id=user_id, table_name="team", query_type="find_all"
# )
from litellm.proxy.management_endpoints.team_endpoints import list_team from litellm.proxy.management_endpoints.team_endpoints import list_team
teams_1 = await list_team( teams_1 = await list_team(