litellm-proxy-extras 0.2.25__py3-none-any.whl → 0.2.27__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of litellm-proxy-extras might be problematic. Click here for more details.
- litellm_proxy_extras/migrations/20250918083359_drop_spec_version_column_from_mcp_table/migration.sql +1 -1
- litellm_proxy_extras/migrations/20251006143948_add_mcp_tool_permissions/migration.sql +3 -0
- litellm_proxy_extras/migrations/20251011084309_add_tag_table/migration.sql +18 -0
- litellm_proxy_extras/schema.prisma +16 -0
- litellm_proxy_extras/utils.py +12 -1
- {litellm_proxy_extras-0.2.25.dist-info → litellm_proxy_extras-0.2.27.dist-info}/METADATA +2 -5
- {litellm_proxy_extras-0.2.25.dist-info → litellm_proxy_extras-0.2.27.dist-info}/RECORD +9 -7
- {litellm_proxy_extras-0.2.25.dist-info → litellm_proxy_extras-0.2.27.dist-info}/WHEEL +1 -1
- {litellm_proxy_extras-0.2.25.dist-info/licenses → litellm_proxy_extras-0.2.27.dist-info}/LICENSE +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "LiteLLM_TagTable" (
|
|
3
|
+
"tag_name" TEXT NOT NULL,
|
|
4
|
+
"description" TEXT,
|
|
5
|
+
"models" TEXT[],
|
|
6
|
+
"model_info" JSONB,
|
|
7
|
+
"spend" DOUBLE PRECISION NOT NULL DEFAULT 0.0,
|
|
8
|
+
"budget_id" TEXT,
|
|
9
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
10
|
+
"created_by" TEXT,
|
|
11
|
+
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
12
|
+
|
|
13
|
+
CONSTRAINT "LiteLLM_TagTable_pkey" PRIMARY KEY ("tag_name")
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
-- AddForeignKey
|
|
17
|
+
ALTER TABLE "LiteLLM_TagTable" ADD CONSTRAINT "LiteLLM_TagTable_budget_id_fkey" FOREIGN KEY ("budget_id") REFERENCES "LiteLLM_BudgetTable"("budget_id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
18
|
+
|
|
@@ -25,6 +25,7 @@ model LiteLLM_BudgetTable {
|
|
|
25
25
|
organization LiteLLM_OrganizationTable[] // multiple orgs can have the same budget
|
|
26
26
|
keys LiteLLM_VerificationToken[] // multiple keys can have the same budget
|
|
27
27
|
end_users LiteLLM_EndUserTable[] // multiple end-users can have the same budget
|
|
28
|
+
tags LiteLLM_TagTable[] // multiple tags can have the same budget
|
|
28
29
|
team_membership LiteLLM_TeamMembership[] // budgets of Users within a Team
|
|
29
30
|
organization_membership LiteLLM_OrganizationMembership[] // budgets of Users within a Organization
|
|
30
31
|
}
|
|
@@ -156,6 +157,7 @@ model LiteLLM_ObjectPermissionTable {
|
|
|
156
157
|
object_permission_id String @id @default(uuid())
|
|
157
158
|
mcp_servers String[] @default([])
|
|
158
159
|
mcp_access_groups String[] @default([])
|
|
160
|
+
mcp_tool_permissions Json? // Tool-level permissions for MCP servers. Format: {"server_id": ["tool_name_1", "tool_name_2"]}
|
|
159
161
|
vector_stores String[] @default([])
|
|
160
162
|
teams LiteLLM_TeamTable[]
|
|
161
163
|
verification_tokens LiteLLM_VerificationToken[]
|
|
@@ -244,6 +246,20 @@ model LiteLLM_EndUserTable {
|
|
|
244
246
|
blocked Boolean @default(false)
|
|
245
247
|
}
|
|
246
248
|
|
|
249
|
+
// Track tags with budgets and spend
|
|
250
|
+
model LiteLLM_TagTable {
|
|
251
|
+
tag_name String @id
|
|
252
|
+
description String?
|
|
253
|
+
models String[]
|
|
254
|
+
model_info Json? // maps model_id to model_name
|
|
255
|
+
spend Float @default(0.0)
|
|
256
|
+
budget_id String?
|
|
257
|
+
litellm_budget_table LiteLLM_BudgetTable? @relation(fields: [budget_id], references: [budget_id])
|
|
258
|
+
created_at DateTime @default(now()) @map("created_at")
|
|
259
|
+
created_by String?
|
|
260
|
+
updated_at DateTime @default(now()) @updatedAt @map("updated_at")
|
|
261
|
+
}
|
|
262
|
+
|
|
247
263
|
// store proxy config.yaml
|
|
248
264
|
model LiteLLM_Config {
|
|
249
265
|
param_name String @id
|
litellm_proxy_extras/utils.py
CHANGED
|
@@ -131,7 +131,9 @@ class ProxyExtrasDBManager:
|
|
|
131
131
|
)
|
|
132
132
|
|
|
133
133
|
@staticmethod
|
|
134
|
-
def _resolve_all_migrations(
|
|
134
|
+
def _resolve_all_migrations(
|
|
135
|
+
migrations_dir: str, schema_path: str, mark_all_applied: bool = True
|
|
136
|
+
):
|
|
135
137
|
"""
|
|
136
138
|
1. Compare the current database state to schema.prisma and generate a migration for the diff.
|
|
137
139
|
2. Run prisma migrate deploy to apply any pending migrations.
|
|
@@ -210,6 +212,8 @@ class ProxyExtrasDBManager:
|
|
|
210
212
|
logger.warning("Migration diff application timed out.")
|
|
211
213
|
|
|
212
214
|
# 3. Mark all migrations as applied
|
|
215
|
+
if not mark_all_applied:
|
|
216
|
+
return
|
|
213
217
|
migration_names = ProxyExtrasDBManager._get_migration_names(migrations_dir)
|
|
214
218
|
logger.info(f"Resolving {len(migration_names)} migrations")
|
|
215
219
|
for migration_name in migration_names:
|
|
@@ -263,6 +267,13 @@ class ProxyExtrasDBManager:
|
|
|
263
267
|
logger.info(f"prisma migrate deploy stdout: {result.stdout}")
|
|
264
268
|
|
|
265
269
|
logger.info("prisma migrate deploy completed")
|
|
270
|
+
|
|
271
|
+
# Run sanity check to ensure DB matches schema
|
|
272
|
+
logger.info("Running post-migration sanity check...")
|
|
273
|
+
ProxyExtrasDBManager._resolve_all_migrations(
|
|
274
|
+
migrations_dir, schema_path, mark_all_applied=False
|
|
275
|
+
)
|
|
276
|
+
logger.info("✅ Post-migration sanity check completed")
|
|
266
277
|
return True
|
|
267
278
|
except subprocess.CalledProcessError as e:
|
|
268
279
|
logger.info(f"prisma db error: {e.stderr}, e: {e.stdout}")
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: litellm-proxy-extras
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.27
|
|
4
4
|
Summary: Additional files for the LiteLLM Proxy. Reduces the size of the main litellm package.
|
|
5
|
-
License-File: LICENSE
|
|
6
5
|
Author: BerriAI
|
|
7
6
|
Requires-Python: >=3.8, !=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*
|
|
8
7
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -10,8 +9,6 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
10
9
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
15
12
|
Project-URL: Documentation, https://docs.litellm.ai
|
|
16
13
|
Project-URL: Homepage, https://litellm.ai
|
|
17
14
|
Project-URL: Repository, https://github.com/BerriAI/litellm
|
|
@@ -34,14 +34,16 @@ litellm_proxy_extras/migrations/20250711220620_add_stdio_mcp/migration.sql,sha25
|
|
|
34
34
|
litellm_proxy_extras/migrations/20250718125714_add_litellm_params_to_vector_stores/migration.sql,sha256=yZfez4-HKbZeRQs4E6QhrMA7wuyrBQrYzTrW9S1HwcY,101
|
|
35
35
|
litellm_proxy_extras/migrations/20250802162330_prompt_table/migration.sql,sha256=rssp_rCzwY5veFUJeGSOoGOvck3IZ9sL86RuHzQJ-s0,452
|
|
36
36
|
litellm_proxy_extras/migrations/20250806095134_rename_alias_to_server_name_mcp_table/migration.sql,sha256=Bge3bWO96jFhVzdjHX5sD7SzCLnrrYMq_6ilzJFAQ6w,465
|
|
37
|
-
litellm_proxy_extras/migrations/20250918083359_drop_spec_version_column_from_mcp_table/migration.sql,sha256=
|
|
37
|
+
litellm_proxy_extras/migrations/20250918083359_drop_spec_version_column_from_mcp_table/migration.sql,sha256=hmAt0uvPXq9Nvtf92HqRhrGTcBxEFWwxOjsG2zTCtg4,231
|
|
38
38
|
litellm_proxy_extras/migrations/20250926194702_unnamed_migration/migration.sql,sha256=YCdSPn3yPse6HoZGW9lFEqy49xOf4yuJH_qrf8lrJIE,294
|
|
39
39
|
litellm_proxy_extras/migrations/20251003165142_add_allowed_tools_to_mcp/migration.sql,sha256=D8olxfIAbERAzYLI6ldT40KUB_3t9CeRgl4n2DT45lU,115
|
|
40
40
|
litellm_proxy_extras/migrations/20251003190954_extra_headers_to_mcp_table/migration.sql,sha256=TEi08V1ZQAondOxdSIP6MAU2P5nueSpVvhtmdoSGp-c,115
|
|
41
|
+
litellm_proxy_extras/migrations/20251006143948_add_mcp_tool_permissions/migration.sql,sha256=RFISpCSAb9YawwQHBdkap9RBn-NrBcmhflOTyUJuljk,104
|
|
42
|
+
litellm_proxy_extras/migrations/20251011084309_add_tag_table/migration.sql,sha256=z1fiUODOMNByeSMzIBgs3Ee0DuDBVwJBJEZQV8eNXVk,653
|
|
41
43
|
litellm_proxy_extras/migrations/migration_lock.toml,sha256=HbF6jQUaoTYRBzZ1LF4fi37ZK26o6AMRL7viSXBHwhA,24
|
|
42
|
-
litellm_proxy_extras/schema.prisma,sha256=
|
|
43
|
-
litellm_proxy_extras/utils.py,sha256=
|
|
44
|
-
litellm_proxy_extras-0.2.
|
|
45
|
-
litellm_proxy_extras-0.2.
|
|
46
|
-
litellm_proxy_extras-0.2.
|
|
47
|
-
litellm_proxy_extras-0.2.
|
|
44
|
+
litellm_proxy_extras/schema.prisma,sha256=NVHRxWZIpj9neb-I3zqB0k9aBOCoEWLMcHbvRpErXbY,22224
|
|
45
|
+
litellm_proxy_extras/utils.py,sha256=2g3sHuOMy_9sjze2Kw42lBXcS6ustYBygd4vaiJ6Kkk,15679
|
|
46
|
+
litellm_proxy_extras-0.2.27.dist-info/LICENSE,sha256=sXDWv46INd01fgEWgdsCj01R4vsOqJIFj1bgH7ObgnM,1419
|
|
47
|
+
litellm_proxy_extras-0.2.27.dist-info/METADATA,sha256=GdGRU2C4h_Zm12ohfrqb4a1MlfjAtzvr26cFyGaKx9g,1267
|
|
48
|
+
litellm_proxy_extras-0.2.27.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
49
|
+
litellm_proxy_extras-0.2.27.dist-info/RECORD,,
|
{litellm_proxy_extras-0.2.25.dist-info/licenses → litellm_proxy_extras-0.2.27.dist-info}/LICENSE
RENAMED
|
File without changes
|