fix(proxy_server.py): write blocked user list to a db table

lets this persist across workers
This commit is contained in:
Krrish Dholakia 2024-03-16 12:26:29 -07:00
parent 2c2f322d5a
commit ef0002f31c
3 changed files with 42 additions and 25 deletions

View file

@ -24,6 +24,7 @@ model LiteLLM_BudgetTable {
updated_by String
organization LiteLLM_OrganizationTable[] // multiple orgs can have the same budget
keys LiteLLM_VerificationToken[] // multiple keys can have the same budget
end_users LiteLLM_EndUserTable[] // multiple end-users can have the same budget
}
model LiteLLM_OrganizationTable {
@ -127,6 +128,15 @@ model LiteLLM_VerificationToken {
litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id])
}
model LiteLLM_EndUserTable {
id String @id
alias String? // admin-facing alias
spend Float @default(0.0)
budget_id String?
litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id])
blocked Boolean @default(false)
}
// store proxy config.yaml
model LiteLLM_Config {
param_name String @id