mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-13 22:23:04 +00:00
set PROXY_BASE_URL when server root path set
This commit is contained in:
committed by
Krrish Dholakia
parent
b7826ed7c3
commit
3b8fc93091
@@ -281,9 +281,12 @@ except Exception as e:
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
server_root_path = os.getenv("SERVER_ROOT_PATH", "")
|
||||
if server_root_path != "" and os.getenv("PROXY_BASE_URL") is None:
|
||||
os.environ["PROXY_BASE_URL"] = server_root_path
|
||||
_license_check = LicenseCheck()
|
||||
premium_user: bool = _license_check.is_premium()
|
||||
ui_link = f"/ui/"
|
||||
ui_link = f"{server_root_path}/ui/"
|
||||
ui_message = (
|
||||
f"👉 [```LiteLLM Admin Panel on /ui```]({ui_link}). Create, Edit Keys with SSO"
|
||||
)
|
||||
@@ -303,14 +306,13 @@ _description = (
|
||||
else f"Proxy Server to call 100+ LLMs in the OpenAI format. {custom_swagger_message}\n\n{ui_message}"
|
||||
)
|
||||
|
||||
|
||||
app = FastAPI(
|
||||
docs_url=_docs_url,
|
||||
title=_title,
|
||||
description=_description,
|
||||
version=version,
|
||||
root_path=os.environ.get(
|
||||
"SERVER_ROOT_PATH", ""
|
||||
), # check if user passed root path, FastAPI defaults this value to ""
|
||||
root_path=server_root_path, # check if user passed root path, FastAPI defaults this value to ""
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user