Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
9e9306fd
Commit
9e9306fd
authored
Apr 23, 2024
by
Jun Siang Cheah
Browse files
feat: add LITELLM_PROXY_HOST to configure address litellm listens on
parent
0ea9e19d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
backend/apps/litellm/main.py
backend/apps/litellm/main.py
+2
-1
backend/config.py
backend/config.py
+1
-0
No files found.
backend/apps/litellm/main.py
View file @
9e9306fd
...
...
@@ -28,6 +28,7 @@ from config import (
MODEL_FILTER_LIST
,
DATA_DIR
,
LITELLM_PROXY_PORT
,
LITELLM_PROXY_HOST
,
)
from
litellm.utils
import
get_llm_provider
...
...
@@ -95,7 +96,7 @@ async def run_background_process(command):
async
def
start_litellm_background
():
log
.
info
(
"start_litellm_background"
)
# Command to run in the background
command
=
f
"litellm --port
{
LITELLM_PROXY_PORT
}
--telemetry False --config ./data/litellm/config.yaml"
command
=
f
"litellm --port
{
LITELLM_PROXY_PORT
}
--host
{
LITELLM_PROXY_HOST
}
--telemetry False --config ./data/litellm/config.yaml"
await
run_background_process
(
command
)
...
...
backend/config.py
View file @
9e9306fd
...
...
@@ -507,3 +507,4 @@ AUDIO_OPENAI_API_KEY = os.getenv("AUDIO_OPENAI_API_KEY", OPENAI_API_KEY)
LITELLM_PROXY_PORT
=
int
(
os
.
getenv
(
"LITELLM_PROXY_PORT"
,
"14365"
))
if
LITELLM_PROXY_PORT
<
0
or
LITELLM_PROXY_PORT
>
65535
:
raise
ValueError
(
"Invalid port number for LITELLM_PROXY_PORT"
)
LITELLM_PROXY_HOST
=
os
.
getenv
(
"LITELLM_PROXY_HOST"
,
"127.0.0.1"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment