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
b22415d4
Commit
b22415d4
authored
Apr 26, 2024
by
Timothy J. Baek
Browse files
feat: litellm opt-out support
parent
dbf7b155
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
backend/main.py
backend/main.py
+5
-2
No files found.
backend/main.py
View file @
b22415d4
...
@@ -47,6 +47,7 @@ from config import (
...
@@ -47,6 +47,7 @@ from config import (
FRONTEND_BUILD_DIR
,
FRONTEND_BUILD_DIR
,
CACHE_DIR
,
CACHE_DIR
,
STATIC_DIR
,
STATIC_DIR
,
ENABLE_LITELLM
,
ENABLE_MODEL_FILTER
,
ENABLE_MODEL_FILTER
,
MODEL_FILTER_LIST
,
MODEL_FILTER_LIST
,
GLOBAL_LOG_LEVEL
,
GLOBAL_LOG_LEVEL
,
...
@@ -179,7 +180,8 @@ async def check_url(request: Request, call_next):
...
@@ -179,7 +180,8 @@ async def check_url(request: Request, call_next):
@
app
.
on_event
(
"startup"
)
@
app
.
on_event
(
"startup"
)
async
def
on_startup
():
async
def
on_startup
():
asyncio
.
create_task
(
start_litellm_background
())
if
ENABLE_LITELLM
:
asyncio
.
create_task
(
start_litellm_background
())
app
.
mount
(
"/api/v1"
,
webui_app
)
app
.
mount
(
"/api/v1"
,
webui_app
)
...
@@ -329,4 +331,5 @@ app.mount(
...
@@ -329,4 +331,5 @@ app.mount(
@
app
.
on_event
(
"shutdown"
)
@
app
.
on_event
(
"shutdown"
)
async
def
shutdown_event
():
async
def
shutdown_event
():
await
shutdown_litellm_background
()
if
ENABLE_LITELLM
:
await
shutdown_litellm_background
()
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