Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

add schema.prisma

Ishaan Jaffer9e02a3800290
diff --git a/schema.prisma b/schema.prisma
index 52170f2f3e6..d7aa6e9f0d0 100644
--- a/schema.prisma
+++ b/schema.prisma
@@ -126,6 +126,7 @@ model LiteLLM_TeamTable {
model_max_budget Json @default("{}")
router_settings Json? @default("{}")
team_member_permissions String[] @default([])
+ policies String[] @default([])
model_id Int? @unique // id for LiteLLM_ModelTable -> stores team-level model aliases
litellm_organization_table LiteLLM_OrganizationTable? @relation(fields: [organization_id], references: [organization_id])
litellm_model_table LiteLLM_ModelTable? @relation(fields: [model_id], references: [id])
@@ -156,6 +157,7 @@ model LiteLLM_DeletedTeamTable {
model_max_budget Json @default("{}")
router_settings Json? @default("{}")
team_member_permissions String[] @default([])
+ policies String[] @default([])
model_id Int? // id for LiteLLM_ModelTable -> stores team-level model aliases
// Original timestamps from team creation/updates
@@ -197,6 +199,7 @@ model LiteLLM_UserTable {
budget_duration String?
budget_reset_at DateTime?
allowed_cache_controls String[] @default([])
+ policies String[] @default([])
model_spend Json @default("{}")
model_max_budget Json @default("{}")
created_at DateTime? @default(now()) @map("created_at")
@@ -283,6 +286,7 @@ model LiteLLM_VerificationToken {
budget_reset_at DateTime?
allowed_cache_controls String[] @default([])
allowed_routes String[] @default([])
+ policies String[] @default([])
model_spend Json @default("{}")
model_max_budget Json @default("{}")
budget_id String?
@@ -327,6 +331,7 @@ model LiteLLM_DeletedVerificationToken {
budget_reset_at DateTime?
allowed_cache_controls String[] @default([])
allowed_routes String[] @default([])
+ policies String[] @default([])
model_spend Json @default("{}")
model_max_budget Json @default("{}")
router_settings Json? @default("{}")
@@ -863,3 +868,32 @@ model LiteLLM_SkillsTable {
updated_at DateTime @default(now()) @updatedAt
updated_by String?
}
+
+// Policy table for storing guardrail policies
+model LiteLLM_PolicyTable {
+ policy_id String @id @default(uuid())
+ policy_name String @unique
+ inherit String? // Name of parent policy to inherit from
+ description String?
+ guardrails_add String[] @default([])
+ guardrails_remove String[] @default([])
+ condition Json? @default("{}") // Policy conditions (e.g., model matching)
+ created_at DateTime @default(now())
+ created_by String?
+ updated_at DateTime @default(now()) @updatedAt
+ updated_by String?
+}
+
+// Policy attachment table for defining where policies apply
+model LiteLLM_PolicyAttachmentTable {
+ attachment_id String @id @default(uuid())
+ policy_name String // Name of the policy to attach
+ scope String? // Use '*' for global scope
+ teams String[] @default([]) // Team aliases or patterns
+ keys String[] @default([]) // Key aliases or patterns
+ models String[] @default([]) // Model names or patterns
+ created_at DateTime @default(now())
+ created_by String?
+ updated_at DateTime @default(now()) @updatedAt
+ updated_by String?
+}