Merge pull request #2255 from BerriAI/litellm_admin_ui_user_panel_load_time_high

[FEAT] proxy add pagination on /user/info endpoint (Admin UI does not load all users)
This commit is contained in:
Ishaan Jaff 2024-02-29 13:22:00 -08:00 committed by GitHub
commit e044d6332f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 91 additions and 8 deletions

View file

@ -641,6 +641,10 @@ class PrismaClient:
query_type: Literal["find_unique", "find_all"] = "find_unique",
expires: Optional[datetime] = None,
reset_at: Optional[datetime] = None,
offset: Optional[int] = None, # pagination, what row number to start from
limit: Optional[
int
] = None, # pagination, number of rows to getch when find_all==True
):
try:
response: Any = None
@ -776,7 +780,7 @@ class PrismaClient:
)
else:
response = await self.db.litellm_usertable.find_many( # type: ignore
order={"spend": "desc"},
order={"spend": "desc"}, take=limit, skip=offset
)
return response
elif table_name == "spend":