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
1c2c2440
Unverified
Commit
1c2c2440
authored
May 22, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
May 22, 2024
Browse files
Merge branch 'dev' into feature/translation-fixes-croatian
parents
ab1aeba1
f8e77ea1
Changes
48
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
853 additions
and
204 deletions
+853
-204
.github/workflows/build-release.yml
.github/workflows/build-release.yml
+3
-3
.github/workflows/format-backend.yaml
.github/workflows/format-backend.yaml
+1
-1
.github/workflows/format-build-frontend.yaml
.github/workflows/format-build-frontend.yaml
+1
-1
.github/workflows/integration-test.yml
.github/workflows/integration-test.yml
+1
-1
backend/apps/ollama/main.py
backend/apps/ollama/main.py
+34
-7
backend/config.py
backend/config.py
+7
-0
backend/requirements.txt
backend/requirements.txt
+19
-19
pyproject.toml
pyproject.toml
+18
-18
requirements-dev.lock
requirements-dev.lock
+42
-31
requirements.lock
requirements.lock
+42
-31
src/lib/apis/ollama/index.ts
src/lib/apis/ollama/index.ts
+67
-0
src/lib/components/chat/Settings/Connections.svelte
src/lib/components/chat/Settings/Connections.svelte
+108
-85
src/lib/i18n/locales/ar-BH/translation.json
src/lib/i18n/locales/ar-BH/translation.json
+1
-1
src/lib/i18n/locales/bg-BG/translation.json
src/lib/i18n/locales/bg-BG/translation.json
+1
-1
src/lib/i18n/locales/bn-BD/translation.json
src/lib/i18n/locales/bn-BD/translation.json
+1
-1
src/lib/i18n/locales/ca-ES/translation.json
src/lib/i18n/locales/ca-ES/translation.json
+1
-1
src/lib/i18n/locales/ceb-PH/translation.json
src/lib/i18n/locales/ceb-PH/translation.json
+503
-0
src/lib/i18n/locales/de-DE/translation.json
src/lib/i18n/locales/de-DE/translation.json
+1
-1
src/lib/i18n/locales/dg-DG/translation.json
src/lib/i18n/locales/dg-DG/translation.json
+1
-1
src/lib/i18n/locales/en-GB/translation.json
src/lib/i18n/locales/en-GB/translation.json
+1
-1
No files found.
.github/workflows/build-release.yml
View file @
1c2c2440
...
...
@@ -11,7 +11,7 @@ jobs:
steps
:
-
name
:
Checkout repository
uses
:
actions/checkout@v
2
uses
:
actions/checkout@v
4
-
name
:
Check for changes in package.json
run
:
|
...
...
@@ -36,7 +36,7 @@ jobs:
echo "::set-output name=content::$CHANGELOG_ESCAPED"
-
name
:
Create GitHub release
uses
:
actions/github-script@v
5
uses
:
actions/github-script@v
7
with
:
github-token
:
${{ secrets.GITHUB_TOKEN }}
script
:
|
...
...
@@ -51,7 +51,7 @@ jobs:
console.log(`Created release ${release.data.html_url}`)
-
name
:
Upload package to GitHub release
uses
:
actions/upload-artifact@v
3
uses
:
actions/upload-artifact@v
4
with
:
name
:
package
path
:
.
...
...
.github/workflows/format-backend.yaml
View file @
1c2c2440
...
...
@@ -23,7 +23,7 @@ jobs:
-
uses
:
actions/checkout@v4
-
name
:
Set up Python
uses
:
actions/setup-python@v
2
uses
:
actions/setup-python@v
4
with
:
python-version
:
${{ matrix.python-version }}
...
...
.github/workflows/format-build-frontend.yaml
View file @
1c2c2440
...
...
@@ -19,7 +19,7 @@ jobs:
uses
:
actions/checkout@v4
-
name
:
Setup Node.js
uses
:
actions/setup-node@v
3
uses
:
actions/setup-node@v
4
with
:
node-version
:
'
20'
# Or specify any other version you want to use
...
...
.github/workflows/integration-test.yml
View file @
1c2c2440
...
...
@@ -99,7 +99,7 @@ jobs:
uses
:
actions/checkout@v4
-
name
:
Set up Python
uses
:
actions/setup-python@v
2
uses
:
actions/setup-python@v
5
with
:
python-version
:
${{ matrix.python-version }}
...
...
backend/apps/ollama/main.py
View file @
1c2c2440
...
...
@@ -43,6 +43,7 @@ from utils.utils import (
from
config
import
(
SRC_LOG_LEVELS
,
OLLAMA_BASE_URLS
,
ENABLE_OLLAMA_API
,
ENABLE_MODEL_FILTER
,
MODEL_FILTER_LIST
,
UPLOAD_DIR
,
...
...
@@ -67,6 +68,8 @@ app.state.config = AppConfig()
app
.
state
.
config
.
ENABLE_MODEL_FILTER
=
ENABLE_MODEL_FILTER
app
.
state
.
config
.
MODEL_FILTER_LIST
=
MODEL_FILTER_LIST
app
.
state
.
config
.
ENABLE_OLLAMA_API
=
ENABLE_OLLAMA_API
app
.
state
.
config
.
OLLAMA_BASE_URLS
=
OLLAMA_BASE_URLS
app
.
state
.
MODELS
=
{}
...
...
@@ -96,6 +99,21 @@ async def get_status():
return
{
"status"
:
True
}
@
app
.
get
(
"/config"
)
async
def
get_config
(
user
=
Depends
(
get_admin_user
)):
return
{
"ENABLE_OLLAMA_API"
:
app
.
state
.
config
.
ENABLE_OLLAMA_API
}
class
OllamaConfigForm
(
BaseModel
):
enable_ollama_api
:
Optional
[
bool
]
=
None
@
app
.
post
(
"/config/update"
)
async
def
update_config
(
form_data
:
OllamaConfigForm
,
user
=
Depends
(
get_admin_user
)):
app
.
state
.
config
.
ENABLE_OLLAMA_API
=
form_data
.
enable_ollama_api
return
{
"ENABLE_OLLAMA_API"
:
app
.
state
.
config
.
ENABLE_OLLAMA_API
}
@
app
.
get
(
"/urls"
)
async
def
get_ollama_api_urls
(
user
=
Depends
(
get_admin_user
)):
return
{
"OLLAMA_BASE_URLS"
:
app
.
state
.
config
.
OLLAMA_BASE_URLS
}
...
...
@@ -156,14 +174,23 @@ def merge_models_lists(model_lists):
async
def
get_all_models
():
log
.
info
(
"get_all_models()"
)
tasks
=
[
fetch_url
(
f
"
{
url
}
/api/tags"
)
for
url
in
app
.
state
.
config
.
OLLAMA_BASE_URLS
]
responses
=
await
asyncio
.
gather
(
*
tasks
)
models
=
{
"models"
:
merge_models_lists
(
map
(
lambda
response
:
response
[
"models"
]
if
response
else
None
,
responses
)
)
}
if
app
.
state
.
config
.
ENABLE_OLLAMA_API
:
tasks
=
[
fetch_url
(
f
"
{
url
}
/api/tags"
)
for
url
in
app
.
state
.
config
.
OLLAMA_BASE_URLS
]
responses
=
await
asyncio
.
gather
(
*
tasks
)
models
=
{
"models"
:
merge_models_lists
(
map
(
lambda
response
:
response
[
"models"
]
if
response
else
None
,
responses
)
)
}
else
:
models
=
{
"models"
:
[]}
app
.
state
.
MODELS
=
{
model
[
"model"
]:
model
for
model
in
models
[
"models"
]}
...
...
backend/config.py
View file @
1c2c2440
...
...
@@ -384,6 +384,13 @@ if not os.path.exists(LITELLM_CONFIG_PATH):
# OLLAMA_BASE_URL
####################################
ENABLE_OLLAMA_API
=
PersistentConfig
(
"ENABLE_OLLAMA_API"
,
"ollama.enable"
,
os
.
environ
.
get
(
"ENABLE_OLLAMA_API"
,
"True"
).
lower
()
==
"true"
,
)
OLLAMA_API_BASE_URL
=
os
.
environ
.
get
(
"OLLAMA_API_BASE_URL"
,
"http://localhost:11434/api"
)
...
...
backend/requirements.txt
View file @
1c2c2440
fastapi==0.1
09.2
fastapi==0.1
11.0
uvicorn[standard]==0.22.0
pydantic==2.7.1
python-multipart==0.0.9
Flask==3.0.3
Flask-Cors==4.0.
0
Flask-Cors==4.0.
1
python-socketio==5.11.2
python-jose==3.3.0
passlib[bcrypt]==1.7.4
requests==2.3
1.0
requests==2.3
2.2
aiohttp==3.9.5
peewee==3.17.
3
peewee==3.17.
5
peewee-migrate==1.12.2
psycopg2-binary==2.9.9
PyMySQL==1.1.
0
bcrypt==4.1.
2
PyMySQL==1.1.
1
bcrypt==4.1.
3
litellm[proxy]==1.3
5
.2
8
litellm[proxy]==1.3
7
.2
0
boto3==1.34.
95
boto3==1.34.
110
argon2-cffi==23.1.0
APScheduler==3.10.4
google-generativeai==0.5.
2
google-generativeai==0.5.
4
langchain==0.
1.16
langchain-community==0.
0.34
langchain-chroma==0.1.
0
langchain==0.
2.0
langchain-community==0.
2.0
langchain-chroma==0.1.
1
fake-useragent==1.5.1
chromadb==0.
4.24
chromadb==0.
5.0
sentence-transformers==2.7.0
pypdf==4.2.0
docx2txt==0.8
python-pptx==0.6.23
unstructured==0.1
1.8
unstructured==0.1
4.0
Markdown==3.6
pypandoc==1.13
pandas==2.2.2
...
...
@@ -46,16 +46,16 @@ xlrd==2.0.1
validators==0.28.1
opencv-python-headless==4.9.0.80
rapidocr-onnxruntime==1.
2.3
rapidocr-onnxruntime==1.
3.22
fpdf2==2.7.
8
fpdf2==2.7.
9
rank-bm25==0.2.2
faster-whisper==1.0.
1
faster-whisper==1.0.
2
PyJWT[crypto]==2.8.0
black==24.4.2
langfuse==2.
27.3
langfuse==2.
33.0
youtube-transcript-api==0.6.2
pytube
\ No newline at end of file
pytube==15.0.0
\ No newline at end of file
pyproject.toml
View file @
1c2c2440
...
...
@@ -6,44 +6,44 @@ authors = [
]
license
=
{
file
=
"LICENSE"
}
dependencies
=
[
"fastapi==0.1
09.2
"
,
"fastapi==0.1
11.0
"
,
"uvicorn[standard]==0.22.0"
,
"pydantic==2.7.1"
,
"python-multipart==0.0.9"
,
"Flask==3.0.3"
,
"Flask-Cors==4.0.
0
"
,
"Flask-Cors==4.0.
1
"
,
"python-socketio==5.11.2"
,
"python-jose==3.3.0"
,
"passlib[bcrypt]==1.7.4"
,
"requests==2.3
1.0
"
,
"requests==2.3
2.2
"
,
"aiohttp==3.9.5"
,
"peewee==3.17.
3
"
,
"peewee==3.17.
5
"
,
"peewee-migrate==1.12.2"
,
"psycopg2-binary==2.9.9"
,
"PyMySQL==1.1.0"
,
"bcrypt==4.1.
2
"
,
"bcrypt==4.1.
3
"
,
"litellm[proxy]==1.3
5
.2
8
"
,
"litellm[proxy]==1.3
7
.2
0
"
,
"boto3==1.34.
95
"
,
"boto3==1.34.
110
"
,
"argon2-cffi==23.1.0"
,
"APScheduler==3.10.4"
,
"google-generativeai==0.5.
2
"
,
"google-generativeai==0.5.
4
"
,
"langchain==0.
1.16
"
,
"langchain-community==0.
0.34
"
,
"langchain-chroma==0.1.
0
"
,
"langchain==0.
2.0
"
,
"langchain-community==0.
2.0
"
,
"langchain-chroma==0.1.
1
"
,
"fake-useragent==1.5.1"
,
"chromadb==0.
4.24
"
,
"chromadb==0.
5.0
"
,
"sentence-transformers==2.7.0"
,
"pypdf==4.2.0"
,
"docx2txt==0.8"
,
"unstructured==0.1
1.8
"
,
"unstructured==0.1
4.0
"
,
"Markdown==3.6"
,
"pypandoc==1.13"
,
"pandas==2.2.2"
,
...
...
@@ -53,19 +53,19 @@ dependencies = [
"validators==0.28.1"
,
"opencv-python-headless==4.9.0.80"
,
"rapidocr-onnxruntime==1.
2.3
"
,
"rapidocr-onnxruntime==1.
3.22
"
,
"fpdf2==2.7.
8
"
,
"fpdf2==2.7.
9
"
,
"rank-bm25==0.2.2"
,
"faster-whisper==1.0.
1
"
,
"faster-whisper==1.0.
2
"
,
"PyJWT[crypto]==2.8.0"
,
"black==24.4.2"
,
"langfuse==2.
27.3
"
,
"langfuse==2.
33.0
"
,
"youtube-transcript-api==0.6.2"
,
"pytube"
,
"pytube
==15.0.0
"
,
]
readme
=
"README.md"
requires-python
=
">= 3.11, < 3.12.0a1"
...
...
requirements-dev.lock
View file @
1c2c2440
...
...
@@ -41,7 +41,7 @@ backoff==2.2.1
# via litellm
# via posthog
# via unstructured
bcrypt==4.1.
2
bcrypt==4.1.
3
# via chromadb
# via open-webui
# via passlib
...
...
@@ -53,9 +53,9 @@ black==24.4.2
# via open-webui
blinker==1.8.2
# via flask
boto3==1.34.
95
boto3==1.34.
110
# via open-webui
botocore==1.34.10
3
botocore==1.34.1
1
0
# via boto3
# via s3transfer
build==1.2.1
...
...
@@ -66,7 +66,6 @@ certifi==2024.2.2
# via httpcore
# via httpx
# via kubernetes
# via pulsar-client
# via requests
# via unstructured-client
cffi==1.16.0
...
...
@@ -79,7 +78,7 @@ charset-normalizer==3.3.2
# via unstructured-client
chroma-hnswlib==0.7.3
# via chromadb
chromadb==0.
4.24
chromadb==0.
5.0
# via langchain-chroma
# via open-webui
click==8.1.7
...
...
@@ -119,6 +118,7 @@ docx2txt==0.8
ecdsa==0.19.0
# via python-jose
email-validator==2.1.1
# via fastapi
# via pydantic
emoji==2.11.1
# via unstructured
...
...
@@ -126,15 +126,17 @@ et-xmlfile==1.1.0
# via openpyxl
fake-useragent==1.5.1
# via open-webui
fastapi==0.1
09.2
fastapi==0.1
11.0
# via chromadb
# via fastapi-sso
# via langchain-chroma
# via litellm
# via open-webui
fastapi-cli==0.0.4
# via fastapi
fastapi-sso==0.10.0
# via litellm
faster-whisper==1.0.
1
faster-whisper==1.0.
2
# via open-webui
filelock==3.14.0
# via huggingface-hub
...
...
@@ -145,13 +147,13 @@ filetype==1.2.0
flask==3.0.3
# via flask-cors
# via open-webui
flask-cors==4.0.
0
flask-cors==4.0.
1
# via open-webui
flatbuffers==24.3.25
# via onnxruntime
fonttools==4.51.0
# via fpdf2
fpdf2==2.7.
8
fpdf2==2.7.
9
# via open-webui
frozenlist==1.4.1
# via aiohttp
...
...
@@ -159,7 +161,7 @@ frozenlist==1.4.1
fsspec==2024.3.1
# via huggingface-hub
# via torch
google-ai-generativelanguage==0.6.
2
google-ai-generativelanguage==0.6.
4
# via google-generativeai
google-api-core==2.19.0
# via google-ai-generativelanguage
...
...
@@ -176,7 +178,7 @@ google-auth==2.29.0
# via kubernetes
google-auth-httplib2==0.2.0
# via google-api-python-client
google-generativeai==0.5.
2
google-generativeai==0.5.
4
# via open-webui
googleapis-common-protos==1.63.0
# via google-api-core
...
...
@@ -189,7 +191,7 @@ grpcio==1.63.0
# via opentelemetry-exporter-otlp-proto-grpc
grpcio-status==1.62.2
# via google-api-core
gunicorn==2
1.
2.0
gunicorn==22.0
.0
# via litellm
h11==0.14.0
# via httpcore
...
...
@@ -203,6 +205,7 @@ httplib2==0.22.0
httptools==0.6.1
# via uvicorn
httpx==0.27.0
# via fastapi
# via fastapi-sso
# via langfuse
# via openai
...
...
@@ -229,6 +232,7 @@ importlib-resources==6.4.0
itsdangerous==2.2.0
# via flask
jinja2==3.1.4
# via fastapi
# via flask
# via litellm
# via torch
...
...
@@ -239,7 +243,6 @@ joblib==1.4.2
# via nltk
# via scikit-learn
jsonpatch==1.33
# via langchain
# via langchain-core
jsonpath-python==1.0.6
# via unstructured-client
...
...
@@ -247,29 +250,30 @@ jsonpointer==2.4
# via jsonpatch
kubernetes==29.0.0
# via chromadb
langchain==0.1.16
langchain==0.2.0
# via langchain-community
# via open-webui
langchain-chroma==0.1.
0
langchain-chroma==0.1.
1
# via open-webui
langchain-community==0.0.34
# via langchain
langchain-community==0.2.0
# via open-webui
langchain-core==0.
1.52
langchain-core==0.
2.1
# via langchain
# via langchain-chroma
# via langchain-community
# via langchain-text-splitters
langchain-text-splitters==0.
0.1
langchain-text-splitters==0.
2.0
# via langchain
langdetect==1.0.9
# via unstructured
langfuse==2.
27.3
langfuse==2.
33.0
# via open-webui
langsmith==0.1.57
# via langchain
# via langchain-community
# via langchain-core
litellm==1.35.28
litellm==1.37.20
# via litellm
# via open-webui
lxml==5.2.2
# via unstructured
...
...
@@ -372,6 +376,7 @@ ordered-set==4.1.0
# via deepdiff
orjson==3.10.3
# via chromadb
# via fastapi
# via langsmith
# via litellm
overrides==7.7.0
...
...
@@ -391,9 +396,10 @@ pandas==2.2.2
# via open-webui
passlib==1.7.4
# via open-webui
# via passlib
pathspec==0.12.1
# via black
peewee==3.17.
3
peewee==3.17.
5
# via open-webui
# via peewee-migrate
peewee-migrate==1.12.2
...
...
@@ -420,8 +426,6 @@ protobuf==4.25.3
# via proto-plus
psycopg2-binary==2.9.9
# via open-webui
pulsar-client==3.5.0
# via chromadb
pyasn1==0.6.0
# via pyasn1-modules
# via python-jose
...
...
@@ -450,6 +454,7 @@ pygments==2.18.0
pyjwt==2.8.0
# via litellm
# via open-webui
# via pyjwt
pymysql==1.1.0
# via open-webui
pypandoc==1.13
...
...
@@ -481,6 +486,7 @@ python-jose==3.3.0
python-magic==0.4.27
# via unstructured
python-multipart==0.0.9
# via fastapi
# via litellm
# via open-webui
python-socketio==5.11.2
...
...
@@ -508,7 +514,7 @@ rank-bm25==0.2.2
# via open-webui
rapidfuzz==3.9.0
# via unstructured
rapidocr-onnxruntime==1.
2.3
rapidocr-onnxruntime==1.
3.22
# via open-webui
redis==5.0.4
# via rq
...
...
@@ -516,7 +522,7 @@ regex==2024.5.10
# via nltk
# via tiktoken
# via transformers
requests==2.3
1.0
requests==2.3
2.2
# via chromadb
# via google-api-core
# via huggingface-hub
...
...
@@ -553,9 +559,6 @@ scipy==1.13.0
# via sentence-transformers
sentence-transformers==2.7.0
# via open-webui
setuptools==69.5.1
# via ctranslate2
# via opentelemetry-instrumentation
shapely==2.0.4
# via rapidocr-onnxruntime
shellingham==1.5.4
...
...
@@ -580,7 +583,7 @@ soupsieve==2.5
sqlalchemy==2.0.30
# via langchain
# via langchain-community
starlette==0.3
6.3
starlette==0.3
7.2
# via fastapi
sympy==1.12
# via onnxruntime
...
...
@@ -615,6 +618,7 @@ transformers==4.39.3
# via sentence-transformers
typer==0.12.3
# via chromadb
# via fastapi-cli
typing-extensions==4.11.0
# via chromadb
# via fastapi
...
...
@@ -637,7 +641,9 @@ tzdata==2024.1
# via pandas
tzlocal==5.2
# via apscheduler
unstructured==0.11.8
ujson==5.10.0
# via fastapi
unstructured==0.14.0
# via open-webui
unstructured-client==0.22.0
# via unstructured
...
...
@@ -650,8 +656,10 @@ urllib3==2.2.1
# via unstructured-client
uvicorn==0.22.0
# via chromadb
# via fastapi
# via litellm
# via open-webui
# via uvicorn
uvloop==0.19.0
# via uvicorn
validators==0.28.1
...
...
@@ -679,3 +687,6 @@ youtube-transcript-api==0.6.2
# via open-webui
zipp==3.18.1
# via importlib-metadata
setuptools==69.5.1
# via ctranslate2
# via opentelemetry-instrumentation
requirements.lock
View file @
1c2c2440
...
...
@@ -41,7 +41,7 @@ backoff==2.2.1
# via litellm
# via posthog
# via unstructured
bcrypt==4.1.
2
bcrypt==4.1.
3
# via chromadb
# via open-webui
# via passlib
...
...
@@ -53,9 +53,9 @@ black==24.4.2
# via open-webui
blinker==1.8.2
# via flask
boto3==1.34.
95
boto3==1.34.
110
# via open-webui
botocore==1.34.10
3
botocore==1.34.1
1
0
# via boto3
# via s3transfer
build==1.2.1
...
...
@@ -66,7 +66,6 @@ certifi==2024.2.2
# via httpcore
# via httpx
# via kubernetes
# via pulsar-client
# via requests
# via unstructured-client
cffi==1.16.0
...
...
@@ -79,7 +78,7 @@ charset-normalizer==3.3.2
# via unstructured-client
chroma-hnswlib==0.7.3
# via chromadb
chromadb==0.
4.24
chromadb==0.
5.0
# via langchain-chroma
# via open-webui
click==8.1.7
...
...
@@ -119,6 +118,7 @@ docx2txt==0.8
ecdsa==0.19.0
# via python-jose
email-validator==2.1.1
# via fastapi
# via pydantic
emoji==2.11.1
# via unstructured
...
...
@@ -126,15 +126,17 @@ et-xmlfile==1.1.0
# via openpyxl
fake-useragent==1.5.1
# via open-webui
fastapi==0.1
09.2
fastapi==0.1
11.0
# via chromadb
# via fastapi-sso
# via langchain-chroma
# via litellm
# via open-webui
fastapi-cli==0.0.4
# via fastapi
fastapi-sso==0.10.0
# via litellm
faster-whisper==1.0.
1
faster-whisper==1.0.
2
# via open-webui
filelock==3.14.0
# via huggingface-hub
...
...
@@ -145,13 +147,13 @@ filetype==1.2.0
flask==3.0.3
# via flask-cors
# via open-webui
flask-cors==4.0.
0
flask-cors==4.0.
1
# via open-webui
flatbuffers==24.3.25
# via onnxruntime
fonttools==4.51.0
# via fpdf2
fpdf2==2.7.
8
fpdf2==2.7.
9
# via open-webui
frozenlist==1.4.1
# via aiohttp
...
...
@@ -159,7 +161,7 @@ frozenlist==1.4.1
fsspec==2024.3.1
# via huggingface-hub
# via torch
google-ai-generativelanguage==0.6.
2
google-ai-generativelanguage==0.6.
4
# via google-generativeai
google-api-core==2.19.0
# via google-ai-generativelanguage
...
...
@@ -176,7 +178,7 @@ google-auth==2.29.0
# via kubernetes
google-auth-httplib2==0.2.0
# via google-api-python-client
google-generativeai==0.5.
2
google-generativeai==0.5.
4
# via open-webui
googleapis-common-protos==1.63.0
# via google-api-core
...
...
@@ -189,7 +191,7 @@ grpcio==1.63.0
# via opentelemetry-exporter-otlp-proto-grpc
grpcio-status==1.62.2
# via google-api-core
gunicorn==2
1.
2.0
gunicorn==22.0
.0
# via litellm
h11==0.14.0
# via httpcore
...
...
@@ -203,6 +205,7 @@ httplib2==0.22.0
httptools==0.6.1
# via uvicorn
httpx==0.27.0
# via fastapi
# via fastapi-sso
# via langfuse
# via openai
...
...
@@ -229,6 +232,7 @@ importlib-resources==6.4.0
itsdangerous==2.2.0
# via flask
jinja2==3.1.4
# via fastapi
# via flask
# via litellm
# via torch
...
...
@@ -239,7 +243,6 @@ joblib==1.4.2
# via nltk
# via scikit-learn
jsonpatch==1.33
# via langchain
# via langchain-core
jsonpath-python==1.0.6
# via unstructured-client
...
...
@@ -247,29 +250,30 @@ jsonpointer==2.4
# via jsonpatch
kubernetes==29.0.0
# via chromadb
langchain==0.1.16
langchain==0.2.0
# via langchain-community
# via open-webui
langchain-chroma==0.1.
0
langchain-chroma==0.1.
1
# via open-webui
langchain-community==0.0.34
# via langchain
langchain-community==0.2.0
# via open-webui
langchain-core==0.
1.52
langchain-core==0.
2.1
# via langchain
# via langchain-chroma
# via langchain-community
# via langchain-text-splitters
langchain-text-splitters==0.
0.1
langchain-text-splitters==0.
2.0
# via langchain
langdetect==1.0.9
# via unstructured
langfuse==2.
27.3
langfuse==2.
33.0
# via open-webui
langsmith==0.1.57
# via langchain
# via langchain-community
# via langchain-core
litellm==1.35.28
litellm==1.37.20
# via litellm
# via open-webui
lxml==5.2.2
# via unstructured
...
...
@@ -372,6 +376,7 @@ ordered-set==4.1.0
# via deepdiff
orjson==3.10.3
# via chromadb
# via fastapi
# via langsmith
# via litellm
overrides==7.7.0
...
...
@@ -391,9 +396,10 @@ pandas==2.2.2
# via open-webui
passlib==1.7.4
# via open-webui
# via passlib
pathspec==0.12.1
# via black
peewee==3.17.
3
peewee==3.17.
5
# via open-webui
# via peewee-migrate
peewee-migrate==1.12.2
...
...
@@ -420,8 +426,6 @@ protobuf==4.25.3
# via proto-plus
psycopg2-binary==2.9.9
# via open-webui
pulsar-client==3.5.0
# via chromadb
pyasn1==0.6.0
# via pyasn1-modules
# via python-jose
...
...
@@ -450,6 +454,7 @@ pygments==2.18.0
pyjwt==2.8.0
# via litellm
# via open-webui
# via pyjwt
pymysql==1.1.0
# via open-webui
pypandoc==1.13
...
...
@@ -481,6 +486,7 @@ python-jose==3.3.0
python-magic==0.4.27
# via unstructured
python-multipart==0.0.9
# via fastapi
# via litellm
# via open-webui
python-socketio==5.11.2
...
...
@@ -508,7 +514,7 @@ rank-bm25==0.2.2
# via open-webui
rapidfuzz==3.9.0
# via unstructured
rapidocr-onnxruntime==1.
2.3
rapidocr-onnxruntime==1.
3.22
# via open-webui
redis==5.0.4
# via rq
...
...
@@ -516,7 +522,7 @@ regex==2024.5.10
# via nltk
# via tiktoken
# via transformers
requests==2.3
1.0
requests==2.3
2.2
# via chromadb
# via google-api-core
# via huggingface-hub
...
...
@@ -553,9 +559,6 @@ scipy==1.13.0
# via sentence-transformers
sentence-transformers==2.7.0
# via open-webui
setuptools==69.5.1
# via ctranslate2
# via opentelemetry-instrumentation
shapely==2.0.4
# via rapidocr-onnxruntime
shellingham==1.5.4
...
...
@@ -580,7 +583,7 @@ soupsieve==2.5
sqlalchemy==2.0.30
# via langchain
# via langchain-community
starlette==0.3
6.3
starlette==0.3
7.2
# via fastapi
sympy==1.12
# via onnxruntime
...
...
@@ -615,6 +618,7 @@ transformers==4.39.3
# via sentence-transformers
typer==0.12.3
# via chromadb
# via fastapi-cli
typing-extensions==4.11.0
# via chromadb
# via fastapi
...
...
@@ -637,7 +641,9 @@ tzdata==2024.1
# via pandas
tzlocal==5.2
# via apscheduler
unstructured==0.11.8
ujson==5.10.0
# via fastapi
unstructured==0.14.0
# via open-webui
unstructured-client==0.22.0
# via unstructured
...
...
@@ -650,8 +656,10 @@ urllib3==2.2.1
# via unstructured-client
uvicorn==0.22.0
# via chromadb
# via fastapi
# via litellm
# via open-webui
# via uvicorn
uvloop==0.19.0
# via uvicorn
validators==0.28.1
...
...
@@ -679,3 +687,6 @@ youtube-transcript-api==0.6.2
# via open-webui
zipp==3.18.1
# via importlib-metadata
setuptools==69.5.1
# via ctranslate2
# via opentelemetry-instrumentation
src/lib/apis/ollama/index.ts
View file @
1c2c2440
import
{
OLLAMA_API_BASE_URL
}
from
'
$lib/constants
'
;
import
{
promptTemplate
}
from
'
$lib/utils
'
;
export
const
getOllamaConfig
=
async
(
token
:
string
=
''
)
=>
{
let
error
=
null
;
const
res
=
await
fetch
(
`
${
OLLAMA_API_BASE_URL
}
/config`
,
{
method
:
'
GET
'
,
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
...(
token
&&
{
authorization
:
`Bearer
${
token
}
`
})
}
})
.
then
(
async
(
res
)
=>
{
if
(
!
res
.
ok
)
throw
await
res
.
json
();
return
res
.
json
();
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
if
(
'
detail
'
in
err
)
{
error
=
err
.
detail
;
}
else
{
error
=
'
Server connection failed
'
;
}
return
null
;
});
if
(
error
)
{
throw
error
;
}
return
res
;
};
export
const
updateOllamaConfig
=
async
(
token
:
string
=
''
,
enable_ollama_api
:
boolean
)
=>
{
let
error
=
null
;
const
res
=
await
fetch
(
`
${
OLLAMA_API_BASE_URL
}
/config/update`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
...(
token
&&
{
authorization
:
`Bearer
${
token
}
`
})
},
body
:
JSON
.
stringify
({
enable_ollama_api
:
enable_ollama_api
})
})
.
then
(
async
(
res
)
=>
{
if
(
!
res
.
ok
)
throw
await
res
.
json
();
return
res
.
json
();
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
if
(
'
detail
'
in
err
)
{
error
=
err
.
detail
;
}
else
{
error
=
'
Server connection failed
'
;
}
return
null
;
});
if
(
error
)
{
throw
error
;
}
return
res
;
};
export
const
getOllamaUrls
=
async
(
token
:
string
=
''
)
=>
{
let
error
=
null
;
...
...
src/lib/components/chat/Settings/Connections.svelte
View file @
1c2c2440
...
...
@@ -3,7 +3,13 @@
import { createEventDispatcher, onMount, getContext } from 'svelte';
const dispatch = createEventDispatcher();
import { getOllamaUrls, getOllamaVersion, updateOllamaUrls } from '$lib/apis/ollama';
import {
getOllamaConfig,
getOllamaUrls,
getOllamaVersion,
updateOllamaConfig,
updateOllamaUrls
} from '$lib/apis/ollama';
import {
getOpenAIConfig,
getOpenAIKeys,
...
...
@@ -26,6 +32,7 @@
let OPENAI_API_BASE_URLS = [''];
let ENABLE_OPENAI_API = false;
let ENABLE_OLLAMA_API = false;
const updateOpenAIHandler = async () => {
OPENAI_API_BASE_URLS = await updateOpenAIUrls(localStorage.token, OPENAI_API_BASE_URLS);
...
...
@@ -50,10 +57,13 @@
onMount(async () => {
if ($user.role === 'admin') {
OLLAMA_BASE_URLS = await getOllamaUrls(localStorage.token);
const ollamaConfig = await getOllamaConfig(localStorage.token);
const openaiConfig = await getOpenAIConfig(localStorage.token);
const config = await getOpenAIConfig(localStorage.token);
ENABLE_OPENAI_API = config.ENABLE_OPENAI_API;
ENABLE_OPENAI_API = openaiConfig.ENABLE_OPENAI_API;
ENABLE_OLLAMA_API = ollamaConfig.ENABLE_OLLAMA_API;
OLLAMA_BASE_URLS = await getOllamaUrls(localStorage.token);
OPENAI_API_BASE_URLS = await getOpenAIUrls(localStorage.token);
OPENAI_API_KEYS = await getOpenAIKeys(localStorage.token);
...
...
@@ -161,95 +171,108 @@
<hr class=" dark:border-gray-700" />
<div>
<div class=" mb-2.5 text-sm font-medium">{$i18n.t('Ollama Base URL')}</div>
<div class="flex w-full gap-1.5">
<div class="flex-1 flex flex-col gap-2">
{#each OLLAMA_BASE_URLS as url, idx}
<div class="flex gap-1.5">
<input
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
placeholder={$i18n.t('Enter URL (e.g. http://localhost:11434)')}
bind:value={url}
/>
<div class="pr-1.5 space-y-2">
<div class="flex justify-between items-center text-sm">
<div class=" font-medium">{$i18n.t('Ollama API')}</div>
<div class="mt-1">
<Switch
bind:state={ENABLE_OLLAMA_API}
on:change={async () => {
updateOllamaConfig(localStorage.token, ENABLE_OLLAMA_API);
}}
/>
</div>
</div>
{#if ENABLE_OLLAMA_API}
<div class="flex w-full gap-1.5">
<div class="flex-1 flex flex-col gap-2">
{#each OLLAMA_BASE_URLS as url, idx}
<div class="flex gap-1.5">
<input
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
placeholder={$i18n.t('Enter URL (e.g. http://localhost:11434)')}
bind:value={url}
/>
<div class="self-center flex items-center">
{#if idx === 0}
<button
class="px-1"
on:click={() => {
OLLAMA_BASE_URLS = [...OLLAMA_BASE_URLS, ''];
}}
type="button"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="w-4 h-4"
<div class="self-center flex items-center">
{#if idx === 0}
<button
class="px-1"
on:click={() => {
OLLAMA_BASE_URLS = [...OLLAMA_BASE_URLS, ''];
}}
type="button"
>
<
path
d="M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z
"
/>
</svg>
</button>
{:else}
<button
class="px-1
"
on:click={() => {
OLLAMA_BASE_URLS = OLLAMA_BASE_URLS.filter((url, urlIdx) => idx !== urlIdx);
}}
type="button"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="w-4 h-4
"
<
svg
xmlns="http://www.w3.org/2000/svg
"
viewBox="0 0 16 16"
fill="currentColor"
class="w-4 h-4"
>
<path
d="M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z
"
/>
</svg>
</button>
{:else}
<button
class="px-1"
on:click={() => {
OLLAMA_BASE_URLS = OLLAMA_BASE_URLS.filter((url, urlIdx) => idx !== urlIdx);
}}
type="button
"
>
<path d="M3.75 7.25a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5Z" />
</svg>
</button>
{/if}
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="w-4 h-4"
>
<path d="M3.75 7.25a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5Z" />
</svg>
</button>
{/if}
</div>
</div>
</div>
{/each}
</div>
{/each}
</div>
<div class="">
<button
class="p-2.5 bg-gray-200 hover:bg-gray-300 dark:bg-gray-850 dark:hover:bg-gray-800 rounded-lg transition"
on:click={() => {
updateOllamaUrlsHandler();
}}
type="button"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
class="w-4 h-4"
<div class="flex">
<button
class="self-center p-2 bg-gray-200 hover:bg-gray-300 dark:bg-gray-900 dark:hover:bg-gray-850 rounded-lg transition"
on:click={() => {
updateOllamaUrlsHandler();
}}
type="button"
>
<path
fill-rule="evenodd"
d="M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z"
clip-rule="evenodd"
/>
</svg>
</button>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
class="w-4 h-4"
>
<path
fill-rule="evenodd"
d="M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z"
clip-rule="evenodd"
/>
</svg>
</button>
</div>
</div>
</div>
<div class="mt-2 text-xs text-gray-400 dark:text-gray-500">
{$i18n.t('Trouble accessing Ollama?')}
<a
class=" text-gray-300 font-medium underline"
href="https://github.com/open-webui/open-webui#troubleshooting"
target="_blank"
>
{$i18n.t('Click here for help.')}
</a>
</div>
<div class="mt-2 text-xs text-gray-400 dark:text-gray-500">
{$i18n.t('Trouble accessing Ollama?')}
<a
class=" text-gray-300 font-medium underline"
href="https://github.com/open-webui/open-webui#troubleshooting"
target="_blank"
>
{$i18n.t('Click here for help.')}
</a>
</div>
{/if}
</div>
</div>
...
...
src/lib/i18n/locales/ar-BH/translation.json
View file @
1c2c2440
...
...
@@ -302,7 +302,7 @@
"Okay, Let's Go!"
:
"حسنا دعنا نذهب!"
,
"OLED Dark"
:
"OLED داكن"
,
"Ollama"
:
"Ollama"
,
"Ollama
Base URL"
:
"Ollama الرابط الافتراضي
"
,
"Ollama
API"
:
"
"
,
"Ollama Version"
:
"Ollama الاصدار"
,
"On"
:
"تشغيل"
,
"Only"
:
"فقط"
,
...
...
src/lib/i18n/locales/bg-BG/translation.json
View file @
1c2c2440
...
...
@@ -302,7 +302,7 @@
"Okay, Let's Go!"
:
"ОК, Нека започваме!"
,
"OLED Dark"
:
"OLED тъмно"
,
"Ollama"
:
"Ollama"
,
"Ollama
Base URL"
:
"Ollama Базов URL
"
,
"Ollama
API"
:
"
"
,
"Ollama Version"
:
"Ollama Версия"
,
"On"
:
"Вкл."
,
"Only"
:
"Само"
,
...
...
src/lib/i18n/locales/bn-BD/translation.json
View file @
1c2c2440
...
...
@@ -302,7 +302,7 @@
"Okay, Let's Go!"
:
"ঠিক আছে, চলুন যাই!"
,
"OLED Dark"
:
"OLED ডার্ক"
,
"Ollama"
:
"Ollama"
,
"Ollama
Base URL"
:
"Ollama বেজ ইউআরএল
"
,
"Ollama
API"
:
"
"
,
"Ollama Version"
:
"Ollama ভার্সন"
,
"On"
:
"চালু"
,
"Only"
:
"শুধুমাত্র"
,
...
...
src/lib/i18n/locales/ca-ES/translation.json
View file @
1c2c2440
...
...
@@ -302,7 +302,7 @@
"Okay, Let's Go!"
:
"D'acord, Anem!"
,
"OLED Dark"
:
"OLED Fosc"
,
"Ollama"
:
"Ollama"
,
"Ollama
Base URL"
:
"URL Base d'Ollama
"
,
"Ollama
API"
:
"
"
,
"Ollama Version"
:
"Versió d'Ollama"
,
"On"
:
"Activat"
,
"Only"
:
"Només"
,
...
...
src/lib/i18n/locales/ceb-PH/translation.json
0 → 100644
View file @
1c2c2440
This diff is collapsed.
Click to expand it.
src/lib/i18n/locales/de-DE/translation.json
View file @
1c2c2440
...
...
@@ -302,7 +302,7 @@
"Okay, Let's Go!"
:
"Okay, los geht's!"
,
"OLED Dark"
:
"OLED Dunkel"
,
"Ollama"
:
"Ollama"
,
"Ollama
Base URL"
:
"Ollama Basis URL
"
,
"Ollama
API"
:
"
"
,
"Ollama Version"
:
"Ollama-Version"
,
"On"
:
"Ein"
,
"Only"
:
"Nur"
,
...
...
src/lib/i18n/locales/dg-DG/translation.json
View file @
1c2c2440
...
...
@@ -302,7 +302,7 @@
"Okay, Let's Go!"
:
"Okay, Let's Go!"
,
"OLED Dark"
:
"OLED Dark"
,
"Ollama"
:
""
,
"Ollama
Base URL"
:
"Ollama Base Bark
"
,
"Ollama
API"
:
"
"
,
"Ollama Version"
:
"Ollama Version"
,
"On"
:
"On"
,
"Only"
:
"Only"
,
...
...
src/lib/i18n/locales/en-GB/translation.json
View file @
1c2c2440
...
...
@@ -302,7 +302,7 @@
"Okay, Let's Go!"
:
""
,
"OLED Dark"
:
""
,
"Ollama"
:
""
,
"Ollama
Base URL
"
:
""
,
"Ollama
API
"
:
""
,
"Ollama Version"
:
""
,
"On"
:
""
,
"Only"
:
""
,
...
...
Prev
1
2
3
Next
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