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
77426266
Commit
77426266
authored
Apr 21, 2024
by
Timothy J. Baek
Browse files
refac: port number update
parent
2717fe7c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
backend/apps/litellm/main.py
backend/apps/litellm/main.py
+5
-3
No files found.
backend/apps/litellm/main.py
View file @
77426266
...
@@ -81,7 +81,9 @@ async def run_background_process(command):
...
@@ -81,7 +81,9 @@ async def run_background_process(command):
async
def
start_litellm_background
():
async
def
start_litellm_background
():
print
(
"start_litellm_background"
)
print
(
"start_litellm_background"
)
# Command to run in the background
# Command to run in the background
command
=
"litellm --telemetry False --config ./data/litellm/config.yaml"
command
=
(
"litellm --port 14365 --telemetry False --config ./data/litellm/config.yaml"
)
await
run_background_process
(
command
)
await
run_background_process
(
command
)
...
@@ -141,7 +143,7 @@ async def restart_litellm(user=Depends(get_admin_user)):
...
@@ -141,7 +143,7 @@ async def restart_litellm(user=Depends(get_admin_user)):
@
app
.
get
(
"/models"
)
@
app
.
get
(
"/models"
)
@
app
.
get
(
"/v1/models"
)
@
app
.
get
(
"/v1/models"
)
async
def
get_models
(
user
=
Depends
(
get_current_user
)):
async
def
get_models
(
user
=
Depends
(
get_current_user
)):
url
=
"http://localhost:
4000
/v1"
url
=
"http://localhost:
14365
/v1"
r
=
None
r
=
None
try
:
try
:
r
=
requests
.
request
(
method
=
"GET"
,
url
=
f
"
{
url
}
/models"
)
r
=
requests
.
request
(
method
=
"GET"
,
url
=
f
"
{
url
}
/models"
)
...
@@ -180,7 +182,7 @@ async def get_models(user=Depends(get_current_user)):
...
@@ -180,7 +182,7 @@ async def get_models(user=Depends(get_current_user)):
async
def
proxy
(
path
:
str
,
request
:
Request
,
user
=
Depends
(
get_verified_user
)):
async
def
proxy
(
path
:
str
,
request
:
Request
,
user
=
Depends
(
get_verified_user
)):
body
=
await
request
.
body
()
body
=
await
request
.
body
()
url
=
"http://localhost:
4000
"
url
=
"http://localhost:
14365
"
target_url
=
f
"
{
url
}
/
{
path
}
"
target_url
=
f
"
{
url
}
/
{
path
}
"
...
...
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