From b22415d456d67dc30b8145ece9a069ff09e7bfb6 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 26 Apr 2024 17:19:50 -0400 Subject: [PATCH] feat: litellm opt-out support --- backend/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/main.py b/backend/main.py index 2ccc7a8f1..cbcbc72f3 100644 --- a/backend/main.py +++ b/backend/main.py @@ -47,6 +47,7 @@ from config import ( FRONTEND_BUILD_DIR, CACHE_DIR, STATIC_DIR, + ENABLE_LITELLM, ENABLE_MODEL_FILTER, MODEL_FILTER_LIST, GLOBAL_LOG_LEVEL, @@ -179,7 +180,8 @@ async def check_url(request: Request, call_next): @app.on_event("startup") async def on_startup(): - asyncio.create_task(start_litellm_background()) + if ENABLE_LITELLM: + asyncio.create_task(start_litellm_background()) app.mount("/api/v1", webui_app) @@ -329,4 +331,5 @@ app.mount( @app.on_event("shutdown") async def shutdown_event(): - await shutdown_litellm_background() + if ENABLE_LITELLM: + await shutdown_litellm_background()