From 0fe8cde7c78d6b975b936f7802a4124b58bd253a Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 5 Nov 2024 13:43:08 -0800 Subject: [PATCH] (DB fix) don't run apply_db_fixes on startup (#6604) * fix don't apply_db_fixes on startup * fix remove unused import --- db_scripts/create_views.py | 2 -- db_scripts/update_unassigned_teams.py | 7 +++++++ litellm/proxy/proxy_config.yaml | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/db_scripts/create_views.py b/db_scripts/create_views.py index 2b6a28ccb..7a913c7f8 100644 --- a/db_scripts/create_views.py +++ b/db_scripts/create_views.py @@ -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 diff --git a/db_scripts/update_unassigned_teams.py b/db_scripts/update_unassigned_teams.py index dc65e4c20..bf2cd2075 100644 --- a/db_scripts/update_unassigned_teams.py +++ b/db_scripts/update_unassigned_teams.py @@ -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" diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yaml index 23834f759..f3edf79d0 100644 --- a/litellm/proxy/proxy_config.yaml +++ b/litellm/proxy/proxy_config.yaml @@ -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/