Commit graph

104 commits

Author SHA1 Message Date
Ishaan Jaff
16673ab488 (UI - View SpendLogs Table) (#7842)
* litellm log messages / responses

* add messages/response to schema.prisma

* add support for logging messages / responses in DB

* test_spend_logs_payload_with_prompts_enabled

* _get_messages_for_spend_logs_payload

* ui_view_spend_logs endpoint

* add tanstack and moment

* add uiSpendLogsCall

* ui view logs table

* ui view spendLogs table

* ui_view_spend_logs

* fix code quality

* test_spend_logs_payload_with_prompts_enabled

* _get_messages_for_spend_logs_payload

* test_spend_logs_payload_with_prompts_enabled

* test_spend_logs_payload_with_prompts_enabled

* ui view spend logs

* minor ui fix

* ui - update leftnav

* ui - clean up ui

* fix leftnav

* ui fix navbar

* ui fix moving chat ui tab
2025-01-17 18:53:45 -08:00
Krish Dholakia
ebe113810b Create and view organizations + assign org admins on the Proxy UI (#7557)
* feat: initial commit for new 'organizations' tab on ui

* build(ui/): create generic card for rendering complete org data table

can be reused in teams as well

simplifies things

* build(ui/): display created orgs on ui

* build(ui/): support adding orgs via UI

* build(ui/): add org in selection dropdown

* build(organizations.tsx): allow assigning org admins

* build(ui/): show org members on ui

* build(ui/): cleanup + show actual models on org dropdown

* build(ui/): explain user roles within organization
2025-01-04 17:31:24 -08:00
Ishaan Jaff
92a8f09655 litellm db fixes LiteLLM_UserTable (#7089) 2024-12-07 19:08:37 -08:00
Ishaan Jaff
ed9ebf3489 (feat) Track custom_llm_provider in LiteLLMSpendLogs (#7081)
* add custom_llm_provider to SpendLogsPayload

* add custom_llm_provider to SpendLogs

* add custom llm provider to SpendLogs payload

* test_spend_logs_payload
2024-12-07 13:40:22 -08:00
Ishaan Jaff
861888a709 track created, updated at virtual keys 2024-10-25 07:19:29 +04:00
Ishaan Jaff
6c764021f2 fix schema.prisma change 2024-10-09 15:25:27 +05:30
Ishaan Jaff
a163464197 (feat proxy) [beta] add support for organization role based access controls (#6112)
* track LiteLLM_OrganizationMembership

* add add_internal_user_to_organization

* add org membership to schema

* read organization membership when reading user info in auth checks

* add check for valid organization_id

* add test for test_create_new_user_in_organization

* test test_create_new_user_in_organization

* add new ADMIN role

* add test for org admins creating teams

* add test for test_org_admin_create_user_permissions

* test_org_admin_create_user_team_wrong_org_permissions

* test_org_admin_create_user_team_wrong_org_permissions

* fix organization_role_based_access_check

* fix getting user members

* fix TeamBase

* fix types used for use role

* fix type checks

* sync prisma schema

* docs - organization admins

* fix use organization_endpoints for /organization management

* add types for org member endpoints

* fix role name for org admin

* add type for member add response

* add organization/member_add

* add error handling for adding members to an org

* add nice doc string for oranization/member_add

* fix test_create_new_user_in_organization

* linting fix

* use simple route changes

* fix types

* add organization member roles

* add org admin auth checks

* add auth checks for orgs

* test for creating teams as org admin

* simplify org id usage

* fix typo

* test test_org_admin_create_user_team_wrong_org_permissions

* fix type check issue

* code quality fix

* fix schema.prisma
2024-10-09 15:18:18 +05:30
Ishaan Jaff
7afc836b7e [Feat UI sso] store 'provider' in user metadata (#5856)
* store sso provider in user metadata

* store user metadata

* store user auth_provider in user metadata

* add "metadata" for LiteLLM_UserTable

* fix sso test
2024-09-23 17:49:36 -07:00
Krrish Dholakia
cf83dcf979 build(schema.prisma): add column 'blocked' for litellm keys
enables blocking/unblocking litellm keys
2024-09-20 19:40:45 -07:00
Krish Dholakia
0b249278bb Refactor 'check_view_exists' logic (#5659)
* fix(proxy/utils.py): comment out auto-upsert logic in check_view_exists

Prevents proxy from failing on startup due to faulty logic

* fix(db/migration_scripts/create_views.py): fix 'DailyTagSpend' quotation on check

* fix(create_views.py): mongly global spend time period should be 30d not 20d

* fix(schema.prisma): index on startTime and endUser for efficient UI querying
2024-09-12 13:39:50 -07:00
Ishaan Jaff
d682d5ed95 fix created_at and updated_at not existing error 2024-08-26 21:04:39 -07:00
Ishaan Jaff
a6b5ba69ca fix schema 2024-08-26 17:27:06 -07:00
Ishaan Jaff
ac39aefabe update schema 2024-08-26 16:52:19 -07:00
Ishaan Jaff
314d9f007d fix DB accept null values for api_base, user, etc 2024-07-23 16:33:04 -07:00
Ishaan Jaff
78839eb46e SpendLogsPayload- track user ip 2024-07-08 10:16:58 -07:00
Krish Dholakia
b2cc37c971 Merge pull request #4084 from BerriAI/litellm_batch_add_team_members
fix(proxy_server.py): allow passing in a list of team members
2024-06-10 20:26:35 -07:00
Krrish Dholakia
cdf693a9bf fix(proxy_server.py): allow passing in a list of team members
allows batch adding members to a team by passing in a list. fixes concurrency issue caused by calling team/member_add in parallel
2024-06-08 19:03:45 -07:00
Ishaan Jaff
e81511a960 fix schema.prisma 2024-06-08 17:39:04 -07:00
Krrish Dholakia
f7f8bcb21b fix(proxy/utils.py): security fix
use typed dict for spendlogs payload. assert no sensitive information logged.
2024-06-07 13:44:11 -07:00
Ishaan Jaff
ed14b02b07 feat - working audit logs for create, update delete team 2024-06-05 17:50:27 -07:00
Krrish Dholakia
b5e17de0bc feat(proxy_server.py): allow admin to invite users via invite link
Closes https://github.com/BerriAI/litellm/issues/3863
2024-05-27 20:32:25 -07:00
Krish Dholakia
8e0825295f Merge pull request #3789 from BerriAI/litellm_ttft_ui
feat(schema.prisma): store model id + model group as part of spend logs allows precise model metrics
2024-05-22 18:22:39 -07:00
Krrish Dholakia
2bdff9b19e feat(schema.prisma): store model id + model group as part of spend logs
allows precise model metrics
2024-05-22 17:29:44 -07:00
Ishaan Jaff
c070b4b010 build - prisma schema change 2024-05-22 17:19:31 -07:00
Krrish Dholakia
fda9e7107a build(schema.prisma): add completion_start_time to spend logs
enables time to first token tracking for models
2024-05-22 16:43:08 -07:00
Krrish Dholakia
7c99808529 feat(proxy_server.py): add CRUD endpoints for 'end_user' management
allow admin to specify region + default models for end users
2024-05-08 18:50:36 -07:00
Ishaan Jaff
26ffb6c4a3 fix - prisma schema 2024-04-30 23:09:53 -07:00
Krrish Dholakia
da216c6915 fix(proxy_server.py): allow mapping a user to an org 2024-04-08 20:45:11 -07:00
Krrish Dholakia
ca607f64aa build(schema.prisma): add user alias to prisma schema 2024-04-05 17:06:30 -07:00
Krish Dholakia
b01e1c24df Merge branch 'main' into litellm_model_add_api 2024-04-03 20:29:44 -07:00
Krrish Dholakia
db9f674937 build(schema.prisma): add proxy model table to prisma schema 2024-04-03 20:17:38 -07:00
Krrish Dholakia
129bb52e9d fix(proxy_server.py): persist models added via /model/new to db
allows models to be used across instances

https://github.com/BerriAI/litellm/issues/2319 , https://github.com/BerriAI/litellm/issues/2329
2024-04-03 20:16:41 -07:00
Ishaan Jaff
2d1adaf293 (fix) prisma - use original prisma client py generator 2024-03-28 12:25:28 -07:00
Ishaan Jaff
98a48434ff (fix) prisma remove json protocol 2024-03-28 12:06:57 -07:00
Tim
216618be4e Remove duplicated "blocked" field on LiteLLM_TeamTable 2024-03-27 17:02:18 +01:00
Krish Dholakia
11a241d056 Merge pull request #2705 from BerriAI/litellm_permissions_table
enable new `/team/disable` endpoint
2024-03-26 18:47:34 -07:00
Krrish Dholakia
313f58c483 build(schema.prisma): update schema to enable team blocking 2024-03-26 17:03:32 -07:00
Krrish Dholakia
94c5d9f82f fix(proxy_server.py): use consistent naming schema - move to /team/block 2024-03-26 16:59:36 -07:00
Krrish Dholakia
ce44645000 feat(proxy_server.py): enable new /team/disable endpoint
reject all requests from this team id, without deleting it.
2024-03-26 15:40:50 -07:00
Krrish Dholakia
6076a31411 build(schema.prisma): use jsonProtocol to fix db connection issues
https://github.com/prisma/prisma/discussions/19978
2024-03-21 18:01:45 -07:00
Krrish Dholakia
be33918438 fix(blocked_user_list.py): check if end user blocked in db 2024-03-16 13:03:52 -07:00
Krrish Dholakia
588b252cab fix(proxy_server.py): write blocked user list to a db table
lets this persist across workers
2024-03-16 12:26:29 -07:00
Krrish Dholakia
82b8a227ed build(schema.prisma): add support for team-based model aliases 2024-03-06 18:55:44 -08:00
Krish Dholakia
cbeb65a442 Merge branch 'main' into litellm_slack_budget_alerting 2024-03-02 19:13:57 -08:00
Krrish Dholakia
5e37a24a36 fix(proxy_server.py): actual implementation of slack soft budget alerting 2024-03-02 18:34:18 -08:00
Krish Dholakia
84e45b385d Merge branch 'main' into litellm_organization_table 2024-03-02 16:09:28 -08:00
ishaan-jaff
894bc9a1dd (feat) set soft_budgets on keys 2024-03-02 12:25:40 -08:00
Krrish Dholakia
376f4cb581 build(schema.prisma): update schema with new orgs and budget table 2024-03-02 12:18:31 -08:00
Krrish Dholakia
64b760fc1a test(test_organizations.py): add testing for /organization/new endpoint 2024-03-02 12:13:54 -08:00
Ishaan Jaff
6bcec573e3 Merge pull request #2301 from BerriAI/litellm_log_api_base_spend_logs
[FEAT] log api_base in spend logs
2024-03-02 12:08:16 -08:00