From 663c60b356df7275ba92123261db4cef460dda95 Mon Sep 17 00:00:00 2001 From: Chris Van Pelt Date: Mon, 21 Oct 2024 13:54:05 -0400 Subject: [PATCH] Allow port override --- backend/openui/__main__.py | 4 ++-- backend/openui/config.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/openui/__main__.py b/backend/openui/__main__.py index 7866242..3d83e2d 100644 --- a/backend/openui/__main__.py +++ b/backend/openui/__main__.py @@ -68,7 +68,7 @@ def is_running_in_docker(): "openui.server:app", host="0.0.0.0" if is_running_in_docker() else "127.0.0.1", log_config=str(config_file) if ui else None, - port=7878, + port=config.PORT, reload=reload, ) ) @@ -111,7 +111,7 @@ def is_running_in_docker(): uvicorn.run( "openui.server:app", host="0.0.0.0" if is_running_in_docker() else "127.0.0.1", - port=7878, + port=config.PORT, reload=reload, ) else: diff --git a/backend/openui/config.py b/backend/openui/config.py index 5367b3d..933e5a0 100644 --- a/backend/openui/config.py +++ b/backend/openui/config.py @@ -66,3 +66,4 @@ class Env(Enum): GROQ_API_KEY = os.getenv("GROQ_API_KEY") LITELLM_API_KEY = os.getenv("LITELLM_API_KEY", os.getenv("LITELLM_MASTER_KEY")) LITELLM_BASE_URL = os.getenv("LITELLM_BASE_URL", "http://0.0.0.0:4000") +PORT = int(os.getenv("PORT", 7878))