feat(proxy_server.py): enable /organizations/new endpoint

allows admins to create organizations which can own teams
This commit is contained in:
Krrish Dholakia 2024-03-02 11:55:16 -08:00
parent 468995b288
commit 2602102ce6
4 changed files with 202 additions and 17 deletions

View file

@ -7,10 +7,42 @@ generator client {
provider = "prisma-client-py"
}
// Budget / Rate Limits for an org
model LiteLLM_BudgetTable {
budget_id String @id @default(uuid())
max_budget Float?
max_parallel_requests Int?
tpm_limit BigInt?
rpm_limit BigInt?
model_max_budget Json @default("{}")
budget_duration String?
budget_reset_at DateTime?
created_at DateTime @default(now()) @map("created_at")
created_by String
updated_at DateTime @default(now()) @updatedAt @map("updated_at")
updated_by String
}
model LiteLLM_OrganizationTable {
organization_id String @id @default(uuid())
organization_alias String?
budget_id String
metadata Json @default("{}")
models String[]
spend Float @default(0.0)
model_spend Json @default("{}")
created_at DateTime @default(now()) @map("created_at")
created_by String
updated_at DateTime @default(now()) @updatedAt @map("updated_at")
updated_by String
litellm_budget_table LiteLLM_BudgetTable @relation(fields: [budget_id], references: [budget_id])
}
// Assign prod keys to groups, not individuals
model LiteLLM_TeamTable {
team_id String @unique
team_id String @id @default(uuid())
team_alias String?
organization_id String?
admins String[]
members String[]
members_with_roles Json @default("{}")
@ -27,11 +59,12 @@ model LiteLLM_TeamTable {
updated_at DateTime @default(now()) @updatedAt @map("updated_at")
model_spend Json @default("{}")
model_max_budget Json @default("{}")
litellm_organization_table LiteLLM_OrganizationTable @relation(fields: [organization_id], references: [organization_id])
}
// Track spend, rate limit, budget Users
model LiteLLM_UserTable {
user_id String @unique
user_id String @id
team_id String?
teams String[] @default([])
user_role String?
@ -51,7 +84,7 @@ model LiteLLM_UserTable {
// Generate Tokens for Proxy
model LiteLLM_VerificationToken {
token String @unique
token String @id
key_name String?
key_alias String?
spend Float @default(0.0)
@ -82,7 +115,7 @@ model LiteLLM_Config {
// View spend, model, api_key per request
model LiteLLM_SpendLogs {
request_id String @unique
request_id String @id
call_type String
api_key String @default ("")
spend Float @default(0.0)
@ -103,7 +136,7 @@ model LiteLLM_SpendLogs {
// Beta - allow team members to request access to a model
model LiteLLM_UserNotifications {
request_id String @unique
request_id String @id
user_id String
models String[]
justification String