(DB fix) don't run apply_db_fixes on startup (#6604)

* fix don't apply_db_fixes on startup

* fix remove unused import
This commit is contained in:
Ishaan Jaff 2024-11-05 13:43:08 -08:00 committed by GitHub
parent 305821902d
commit 0fe8cde7c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 4 deletions

View file

@ -4,7 +4,6 @@ python script to pre-create all views required by LiteLLM Proxy Server
import asyncio
import os
from update_unassigned_teams import apply_db_fixes
# Enter your DATABASE_URL here
@ -205,7 +204,6 @@ async def check_view_exists(): # noqa: PLR0915
print("Last30dTopEndUsersSpend Created!") # noqa
await apply_db_fixes(db=db)
return

View file

@ -1,7 +1,14 @@
from prisma import Prisma
from litellm._logging import verbose_logger
async def apply_db_fixes(db: Prisma):
"""
Do Not Run this in production, only use it as a one-time fix
"""
verbose_logger.warning(
"DO NOT run this in Production....Running update_unassigned_teams"
)
try:
sql_query = """
UPDATE "LiteLLM_SpendLogs"

View file

@ -1,7 +1,7 @@
model_list:
- model_name: gpt-4o
- model_name: fake-openai-endpoint
litellm_params:
model: openai/gpt-5
model: openai/fake
api_key: os.environ/OPENAI_API_KEY
api_base: https://exampleopenaiendpoint-production.up.railway.app/