mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
add schema
This commit is contained in:
parent
d29cb2bf5c
commit
a3c3f6ae74
1 changed files with 30 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ model LiteLLM_BudgetTable {
|
|||
updated_at DateTime @default(now()) @updatedAt @map("updated_at")
|
||||
updated_by String
|
||||
organization LiteLLM_OrganizationTable[] // multiple orgs can have the same budget
|
||||
projects LiteLLM_ProjectTable[] // multiple projects 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
|
||||
tags LiteLLM_TagTable[] // multiple tags can have the same budget
|
||||
|
|
@ -115,6 +116,31 @@ model LiteLLM_TeamTable {
|
|||
litellm_organization_table LiteLLM_OrganizationTable? @relation(fields: [organization_id], references: [organization_id])
|
||||
litellm_model_table LiteLLM_ModelTable? @relation(fields: [model_id], references: [id])
|
||||
object_permission LiteLLM_ObjectPermissionTable? @relation(fields: [object_permission_id], references: [object_permission_id])
|
||||
projects LiteLLM_ProjectTable[]
|
||||
}
|
||||
|
||||
// Projects sit between teams and keys for use-case management
|
||||
model LiteLLM_ProjectTable {
|
||||
project_id String @id @default(uuid())
|
||||
project_alias String?
|
||||
team_id String?
|
||||
budget_id String?
|
||||
metadata Json @default("{}")
|
||||
models String[]
|
||||
spend Float @default(0.0)
|
||||
model_spend Json @default("{}")
|
||||
blocked Boolean @default(false)
|
||||
object_permission_id String?
|
||||
created_at DateTime @default(now()) @map("created_at")
|
||||
created_by String
|
||||
updated_at DateTime @default(now()) @updatedAt @map("updated_at")
|
||||
updated_by String
|
||||
|
||||
// Relations
|
||||
litellm_team_table LiteLLM_TeamTable? @relation(fields: [team_id], references: [team_id])
|
||||
litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id])
|
||||
keys LiteLLM_VerificationToken[]
|
||||
object_permission LiteLLM_ObjectPermissionTable? @relation(fields: [object_permission_id], references: [object_permission_id])
|
||||
}
|
||||
|
||||
// Track spend, rate limit, budget Users
|
||||
|
|
@ -160,6 +186,7 @@ model LiteLLM_ObjectPermissionTable {
|
|||
mcp_tool_permissions Json? // Tool-level permissions for MCP servers. Format: {"server_id": ["tool_name_1", "tool_name_2"]}
|
||||
vector_stores String[] @default([])
|
||||
teams LiteLLM_TeamTable[]
|
||||
projects LiteLLM_ProjectTable[]
|
||||
verification_tokens LiteLLM_VerificationToken[]
|
||||
organizations LiteLLM_OrganizationTable[]
|
||||
users LiteLLM_UserTable[]
|
||||
|
|
@ -207,6 +234,7 @@ model LiteLLM_VerificationToken {
|
|||
config Json @default("{}")
|
||||
user_id String?
|
||||
team_id String?
|
||||
project_id String?
|
||||
permissions Json @default("{}")
|
||||
max_parallel_requests Int?
|
||||
metadata Json @default("{}")
|
||||
|
|
@ -234,6 +262,7 @@ model LiteLLM_VerificationToken {
|
|||
key_rotation_at DateTime? // When this key should next be rotated
|
||||
litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id])
|
||||
litellm_organization_table LiteLLM_OrganizationTable? @relation(fields: [organization_id], references: [organization_id])
|
||||
litellm_project_table LiteLLM_ProjectTable? @relation(fields: [project_id], references: [project_id])
|
||||
object_permission LiteLLM_ObjectPermissionTable? @relation(fields: [object_permission_id], references: [object_permission_id])
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +315,7 @@ model LiteLLM_SpendLogs {
|
|||
custom_llm_provider String? @default("") // litellm used custom_llm_provider
|
||||
api_base String? @default("")
|
||||
user String? @default("")
|
||||
metadata Json? @default("{}")
|
||||
metadata Json? @default("{}") // project_id stored here
|
||||
cache_hit String? @default("")
|
||||
cache_key String? @default("")
|
||||
request_tags Json? @default("[]")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue