From c42cb438f99428243ae049df7fa15da793f4c4a9 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 28 Mar 2024 02:45:56 -0700 Subject: [PATCH] fix: litellm model filter issue --- backend/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/main.py b/backend/main.py index b118c673..4c13c0cd 100644 --- a/backend/main.py +++ b/backend/main.py @@ -50,6 +50,7 @@ logging.basicConfig(stream=sys.stdout, level=GLOBAL_LOG_LEVEL) log = logging.getLogger(__name__) log.setLevel(SRC_LOG_LEVELS["MAIN"]) + class SPAStaticFiles(StaticFiles): async def get_response(self, path: str, scope): try: @@ -200,6 +201,9 @@ async def update_model_filter_config( openai_app.state.MODEL_FILTER_ENABLED = app.state.MODEL_FILTER_ENABLED openai_app.state.MODEL_FILTER_LIST = app.state.MODEL_FILTER_LIST + litellm_app.state.MODEL_FILTER_ENABLED = app.state.MODEL_FILTER_ENABLED + litellm_app.state.MODEL_FILTER_LIST = app.state.MODEL_FILTER_LIST + return { "enabled": app.state.MODEL_FILTER_ENABLED, "models": app.state.MODEL_FILTER_LIST,