From 78fc27bb742ab7b143a5db9bf648bd01c6f687af Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 31 Jan 2024 15:24:46 -0800 Subject: [PATCH] (fix) ui use relative path --- litellm/proxy/proxy_server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 03a03a66bcf..430be55c6b2 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -160,8 +160,10 @@ async def openai_exception_handler(request: Request, exc: ProxyException): router = APIRouter() origins = ["*"] - -app.mount("/ui", StaticFiles(directory="_experimental/out", html=True), name="ui") +# get current directory +current_dir = os.getcwd() +ui_path = os.path.join(current_dir, "_experimental", "out") +app.mount("/ui", StaticFiles(directory=ui_path, html=True), name="ui") app.add_middleware( CORSMiddleware, allow_origins=origins,