Skip to content
Merged

Dev #276

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
83fad5e
refac
tjbck Mar 9, 2026
8970923
refac
tjbck Mar 10, 2026
86cce2c
Update fi-FI translation.json (#22542)
Kylapaallikko Mar 11, 2026
418bd05
refac: refined shimmer effect (#22516)
jannikstdl Mar 11, 2026
a407a7f
Updated pt-PT Translation (#22587)
RiCatarino Mar 11, 2026
06657b8
fix: handle non-dict history/messages in chat_message migration (#22588)
Classic298 Mar 11, 2026
f1c1004
fix: ddgs
tjbck Mar 11, 2026
a87f015
i18n: Update Catalan translation.json (#22570)
aleixdorca Mar 11, 2026
0a87c1e
refac
tjbck Mar 11, 2026
b312318
refac: rm mariadb dep
tjbck Mar 11, 2026
f2217da
enh: verify terminal connection
tjbck Mar 11, 2026
8da2956
refac: safer tool server handling
tjbck Mar 11, 2026
035b981
feat(otel): introduce an environment variable to control the export i…
lorenzophys Mar 11, 2026
cee6450
i18n(tr-TR): improve Turkish translations - increase coverage and fix…
alifurkanstahl Mar 11, 2026
3a6b5eb
refac: modernize type hints and imports in access_control module (#22…
ashm-dev Mar 11, 2026
865880a
refac: allow emoji unselect from folder
tjbck Mar 11, 2026
e34ed72
refac
tjbck Mar 11, 2026
7ea1e9c
fix: Prefer model-provided web search result count over admin default…
Steve-Li-1998 Mar 11, 2026
4a8f995
refac
tjbck Mar 11, 2026
1b1abdd
avoid silent failure of pip/uv install in Dockerfile (#22598)
Ithanil Mar 11, 2026
afa0609
feat: support whitelist filtering in AuditLoggingMiddleware (#22515)
tjbck Mar 11, 2026
dbd0d7d
refac
tjbck Mar 11, 2026
f3402d3
refac
tjbck Mar 11, 2026
ee0d9b7
feat: knowledge - clickable file icon opens content (#22629)
athoik Mar 12, 2026
05f314b
fix: prevent user groups overflow in profile preview (#22547)
jqqin Mar 12, 2026
d85b52b
refac
tjbck Mar 13, 2026
157ff57
refac
tjbck Mar 13, 2026
6862d61
refac
tjbck Mar 14, 2026
39100ec
Create generate-sbom.sh
tjbck Mar 14, 2026
47ab4c7
refac
tjbck Mar 14, 2026
f9d38a0
refac
tjbck Mar 15, 2026
47e47e4
refac
tjbck Mar 15, 2026
566e255
refac
tjbck Mar 15, 2026
a43d989
i18n: Update Japanese translation (#22696)
zolgear Mar 15, 2026
1eef5b4
refac
tjbck Mar 15, 2026
7611762
doc: sec
tjbck Mar 15, 2026
bc5b3ec
refac
tjbck Mar 15, 2026
b73010b
feat: add ruff linter & formatter (#22576)
ashm-dev Mar 15, 2026
f9756de
refac
tjbck Mar 15, 2026
b535275
fix(ui): add icon fallback for missing model icons on Models pages (#…
silentoplayz Mar 15, 2026
bc9ee7b
feat(ui): add bulk actions hamburger menu to workspace Models page (#…
silentoplayz Mar 15, 2026
bdb7d48
chore: svelte bump
tjbck Mar 15, 2026
02d9d07
i18n: improve Chinese translation (#22480)
ShirasawaSama Mar 15, 2026
bcd313c
refac
tjbck Mar 15, 2026
a229f9e
fix: replace bare except with except Exception (#22473)
gambletan Mar 15, 2026
5787c96
refac
tjbck Mar 15, 2026
14d876c
Added Readiness probe (#22507)
jmleksan Mar 15, 2026
486c004
refac
tjbck Mar 15, 2026
9465e29
i18n(fr-FR): complete French translation (#22714)
EliotGodard Mar 16, 2026
bef5ec2
fix: add profile image fallback handlers for model and user avatars i…
silentoplayz Mar 16, 2026
3dea69f
refac
tjbck Mar 16, 2026
753589e
refac
tjbck Mar 16, 2026
07e650c
refac
tjbck Mar 16, 2026
e531521
refac
tjbck Mar 16, 2026
38cc6e4
refac
tjbck Mar 16, 2026
be6bf76
refac
tjbck Mar 16, 2026
b99f8da
refac
tjbck Mar 16, 2026
a361df8
refac
tjbck Mar 16, 2026
68973f9
refac
tjbck Mar 16, 2026
54f7861
refac
tjbck Mar 16, 2026
e3f3929
refac
tjbck Mar 16, 2026
30068af
i18n(et-EE): update Estonian translations (#22731)
IllimarR Mar 16, 2026
c0385f6
refac
tjbck Mar 17, 2026
3107a53
refac
tjbck Mar 17, 2026
b062235
fix(channel): allow sending image-only messages without text (#22752)
silentoplayz Mar 17, 2026
b171b02
refac
tjbck Mar 17, 2026
fcf7208
refac
tjbck Mar 17, 2026
de3317e
refac
tjbck Mar 17, 2026
b8ea267
refac
tjbck Mar 17, 2026
58e78e8
refac
tjbck Mar 17, 2026
6b66cb5
refac
tjbck Mar 18, 2026
adcc50d
refac
tjbck Mar 19, 2026
694fb37
refac
tjbck Mar 19, 2026
9793315
i18n: correct Spanish (es-ES) translation errors (#22870)
viti95 Mar 19, 2026
c53cd78
refac
tjbck Mar 19, 2026
de5e0fb
refac
tjbck Mar 20, 2026
c81b3ef
sec (#22897)
Classic298 Mar 20, 2026
6089a55
fix(ui): chat input triggers correctly re-trigger on backspace (#22899)
silentoplayz Mar 20, 2026
8f3144a
fix(ui): close thread sidebar on parent message deletion (#22890)
silentoplayz Mar 20, 2026
10f06a6
refac
tjbck Mar 20, 2026
f23296b
refac
tjbck Mar 20, 2026
ecba370
refac
tjbck Mar 20, 2026
fe772d9
refac
tjbck Mar 20, 2026
068e52f
refac
tjbck Mar 20, 2026
00cb7f5
refac
tjbck Mar 20, 2026
af0b7d4
fix: Prevent task list checkboxes from shrinking for consistent align…
ShirasawaSama Mar 20, 2026
f593f92
FIX: serper.dev API - Change snippet key from 'description' to 'snipp…
biebiep Mar 20, 2026
157ae91
fix: replace legacy surrogate-pair emoji regex with Unicode property …
yoloni-9527 Mar 21, 2026
0afb8f6
fix(ui): reset page to 1 when searching prompts (#22912)
silentoplayz Mar 21, 2026
7674e4f
i18n: add Azerbaijani (az-AZ) translation (#22792)
alasgarshabanov Mar 21, 2026
124e1ea
fix(ui): refine message data lazy loading to prevent 404s (#22894)
silentoplayz Mar 21, 2026
2c80d95
fix: wrong icon shown after removing a toggled filter (#22862)
Algorithm5838 Mar 21, 2026
6769b19
fix(ui): show model avatars in chat search preview modal (#22782)
silentoplayz Mar 21, 2026
5df4277
refac
tjbck Mar 21, 2026
9a2c60d
refac
tjbck Mar 21, 2026
53b8a1f
enh: colon fence md
tjbck Mar 21, 2026
4f0e574
refac
tjbck Mar 21, 2026
b44eacb
refac
tjbck Mar 21, 2026
8b4ea5b
fix: guard chat:tasks:cancel handler with message_id check (#22743)
Algorithm5838 Mar 21, 2026
4d67c81
refac
tjbck Mar 21, 2026
85411e4
chore: align black with Ruff backend formatting (#22766)
ashm-dev Mar 21, 2026
4c8615f
refac
tjbck Mar 21, 2026
17c819a
feat: add confirmation dialog for single memory entry deletion (#22888)
silentoplayz Mar 21, 2026
bb3526f
refac
tjbck Mar 21, 2026
5b026b2
refac
tjbck Mar 21, 2026
78dbad5
refac
tjbck Mar 21, 2026
93407ba
refac
tjbck Mar 21, 2026
0ad448b
enh: allow iframe postMessage prompts without same-origin (with HITL …
Classic298 Mar 21, 2026
877bc23
refac
tjbck Mar 21, 2026
aa59b32
refac
tjbck Mar 21, 2026
d8fa0f4
refac
tjbck Mar 21, 2026
cc8b505
refac
tjbck Mar 22, 2026
ea515fa
refac
tjbck Mar 22, 2026
52e227f
fix: add from_attributes to FunctionResponse (#22924)
Algorithm5838 Mar 22, 2026
a1aceb5
refac
tjbck Mar 22, 2026
464462b
enh: WEBUI_AUTH_TRUSTED_ROLE_HEADER
tjbck Mar 22, 2026
218bd7a
refac
tjbck Mar 22, 2026
adcbba3
refac
tjbck Mar 22, 2026
2ae47cf
refac
tjbck Mar 22, 2026
f8b3a32
refac
tjbck Mar 22, 2026
93415a4
refac
tjbck Mar 22, 2026
0dcd6ac
refac
tjbck Mar 22, 2026
7ffcd39
refac
tjbck Mar 22, 2026
ee901fc
refac
tjbck Mar 22, 2026
ee9099c
refac
tjbck Mar 22, 2026
6a00420
enh: inline html result context
tjbck Mar 22, 2026
d784eb1
refac
tjbck Mar 22, 2026
dfc2dc2
refac
tjbck Mar 22, 2026
2e16592
refac
tjbck Mar 22, 2026
945275f
refac
tjbck Mar 22, 2026
59171da
refac
tjbck Mar 22, 2026
9a6bf78
refac
tjbck Mar 23, 2026
ebb7ce2
refac
tjbck Mar 23, 2026
6a9d67b
refac
tjbck Mar 23, 2026
d577ff1
reafc
tjbck Mar 23, 2026
eca5126
refac
tjbck Mar 23, 2026
5d7766e
refac
tjbck Mar 23, 2026
0f0ba7d
refac
tjbck Mar 23, 2026
36c3fc5
refac
tjbck Mar 24, 2026
1c25b06
refac
tjbck Mar 24, 2026
108a019
refac
tjbck Mar 24, 2026
a3238aa
refac
tjbck Mar 24, 2026
6890618
refac
tjbck Mar 24, 2026
1dc647f
refac
tjbck Mar 24, 2026
637cd13
refac
tjbck Mar 24, 2026
3a4b862
refac
tjbck Mar 24, 2026
139e764
refac
tjbck Mar 24, 2026
f0d48a4
perf: use asyncio.to_thread for heartbeat DB write (#22980)
Algorithm5838 Mar 24, 2026
ade617e
refac
tjbck Mar 24, 2026
70285fb
refac
tjbck Mar 24, 2026
16ee4ac
refac
tjbck Mar 24, 2026
fe7e002
refac
tjbck Mar 24, 2026
bd8aa3b
fix: new password validation
tjbck Mar 24, 2026
69171a4
refac
tjbck Mar 24, 2026
24370d5
refac
tjbck Mar 24, 2026
3841e85
refac
tjbck Mar 24, 2026
c479c22
refac
tjbck Mar 24, 2026
cf60b18
refac
tjbck Mar 24, 2026
12f0ad2
refac
tjbck Mar 24, 2026
4a70aaa
refac
tjbck Mar 24, 2026
7bcfafa
refac
tjbck Mar 24, 2026
9f946de
refac
tjbck Mar 24, 2026
f7e07f3
chore: format
tjbck Mar 24, 2026
a9c5c78
refac
tjbck Mar 24, 2026
7ce1e94
perf: batch history reactive triggers to rAF in chatEventHandler (#22…
Algorithm5838 Mar 24, 2026
6f06b3d
Update translation.json (#22985)
Classic298 Mar 24, 2026
6d7744c
refac
tjbck Mar 24, 2026
f949d17
refac
tjbck Mar 24, 2026
c24a4da
refac
tjbck Mar 24, 2026
e4de5c5
refac (#22987)
ashm-dev Mar 24, 2026
cb7154c
i18n: add pt-BR translations for newly added UI items and consistency…
joaoback Mar 24, 2026
5c4062c
refac
tjbck Mar 24, 2026
2376258
refac
tjbck Mar 24, 2026
7eae377
perf: lookup
tjbck Mar 24, 2026
94145c9
enh: GOOGLE_OAUTH_AUTHORIZE_PARAMS
tjbck Mar 24, 2026
e1cdd7e
fix: use full_output() in reasoning content delta emit (#23001)
Algorithm5838 Mar 24, 2026
d738044
refac
tjbck Mar 24, 2026
cffbc35
refac
tjbck Mar 24, 2026
8507e5e
refac: include black
tjbck Mar 24, 2026
be21db7
refac
tjbck Mar 24, 2026
c0fcbc5
refac
tjbck Mar 24, 2026
631bd20
refac
tjbck Mar 24, 2026
601bb78
feat: oauth 2.1 static mcp
tjbck Mar 24, 2026
9684626
refac
tjbck Mar 24, 2026
61cfaab
refac
tjbck Mar 24, 2026
261aec8
enh: consecutive details rendering
tjbck Mar 25, 2026
0aebdd5
refac
tjbck Mar 25, 2026
440b640
perf: remove redundant getChatList call from sendMessage (#22982)
Algorithm5838 Mar 25, 2026
d933991
refac
tjbck Mar 25, 2026
adf7af3
refac
tjbck Mar 25, 2026
cb83831
chore: pin deps
tjbck Mar 25, 2026
58dcc1b
refac
tjbck Mar 25, 2026
8b6fa1f
refac
tjbck Mar 25, 2026
1cf1b2c
refac
tjbck Mar 25, 2026
76ece40
refac
tjbck Mar 25, 2026
90ca2e9
refac
tjbck Mar 25, 2026
cdc2b3b
refac
tjbck Mar 25, 2026
aa2f7fb
refac
tjbck Mar 25, 2026
94f877f
refac
tjbck Mar 25, 2026
7b78c64
refac
tjbck Mar 25, 2026
debcc3a
refac
tjbck Mar 25, 2026
08ff3bd
refac
tjbck Mar 25, 2026
857d7e6
refac
tjbck Mar 25, 2026
4d50001
refac
tjbck Mar 25, 2026
98c7ed9
perf: remove getChatList from saveChatHandler (#22983)
Algorithm5838 Mar 25, 2026
75932be
refac
tjbck Mar 25, 2026
15ae3f5
refac
tjbck Mar 25, 2026
f2f4baa
refac
tjbck Mar 25, 2026
abe42ea
perf: fix double-RAF streaming display lag (#23016)
Algorithm5838 Mar 25, 2026
05252e1
refactor: streamline logging and permission checks in auths.py (#22960)
jmleksan Mar 25, 2026
350d52f
chore: format
tjbck Mar 25, 2026
9364e2f
refac
tjbck Mar 25, 2026
7a21933
chore: changelog (#22569)
Classic298 Mar 25, 2026
bfc606a
fix: align file context injection by user-role messages for native FC…
Classic298 Mar 25, 2026
8cb47ae
refac
tjbck Mar 25, 2026
0fa246a
refac
tjbck Mar 25, 2026
0ded0b7
chore: ci
tjbck Mar 25, 2026
0663589
refac
tjbck Mar 25, 2026
f5f1286
chore: ci
tjbck Mar 25, 2026
f122525
chore: bump
tjbck Mar 25, 2026
4d058a1
Merge pull request #23035 from open-webui/dev
tjbck Mar 25, 2026
835bd54
Merge branch 'oui_main' into new_dev
OrenZhang Mar 26, 2026
97b6f27
chore(repo): merge from remote
OrenZhang Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 3 additions & 6 deletions .github/workflows/format-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
pip install "ruff>=0.15.5"

- name: Format backend
run: npm run format:backend

- name: Check for changes after format
run: git diff --exit-code
- name: Ruff format check
run: ruff format --check . --exclude .venv --exclude venv
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
hooks:
- id: ruff
args: [--fix, backend]
- id: ruff-format
args: [backend]
147 changes: 146 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions CHANGELOG_EXTRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.11.1] - 2026.03.26

### Changed

- 合并官方 0.8.11 改动

## [0.8.10.2] - 2026.03.18

### Added
Expand Down
21 changes: 11 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -136,29 +136,30 @@ RUN apt-get update && \
# install python dependencies
COPY --chown=$UID:$GID ./backend/requirements.txt ./requirements.txt

RUN pip3 install --no-cache-dir uv && \
RUN set -e; \
pip3 install --no-cache-dir uv; \
if [ "$USE_CUDA" = "true" ]; then \
# If you use CUDA the whisper and embedding model will be downloaded on first use
# fix: pin torch<=2.9.1 - torch 2.10.0 aarch64 wheels cause SIGILL on ARM devices (RPi 4 Cortex-A72) #21349
pip3 install 'torch<=2.9.1' torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER --no-cache-dir && \
uv pip install --system -r requirements.txt --no-cache-dir && \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ.get('AUXILIARY_EMBEDDING_MODEL', 'TaylorAI/bge-micro-v2'), device='cpu')" && \
pip3 install 'torch<=2.9.1' torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER --no-cache-dir; \
uv pip install --system -r requirements.txt --no-cache-dir; \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')"; \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ.get('AUXILIARY_EMBEDDING_MODEL', 'TaylorAI/bge-micro-v2'), device='cpu')"; \
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])"; \
python -c "import os; import tiktoken; tiktoken.get_encoding(os.environ['TIKTOKEN_ENCODING_NAME'])"; \
python -c "import nltk; nltk.download('punkt_tab')"; \
else \
pip3 install 'torch<=2.9.1' torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir && \
uv pip install --system -r requirements.txt --no-cache-dir && \
pip3 install 'torch<=2.9.1' torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir; \
uv pip install --system -r requirements.txt --no-cache-dir; \
if [ "$USE_SLIM" != "true" ]; then \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" && \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ.get('AUXILIARY_EMBEDDING_MODEL', 'TaylorAI/bge-micro-v2'), device='cpu')" && \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')"; \
python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ.get('AUXILIARY_EMBEDDING_MODEL', 'TaylorAI/bge-micro-v2'), device='cpu')"; \
python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])"; \
python -c "import os; import tiktoken; tiktoken.get_encoding(os.environ['TIKTOKEN_ENCODING_NAME'])"; \
python -c "import nltk; nltk.download('punkt_tab')"; \
fi; \
fi; \
mkdir -p /app/backend/data && chown -R $UID:$GID /app/backend/data/ && \
mkdir -p /app/backend/data; chown -R $UID:$GID /app/backend/data/; \
rm -rf /var/lib/apt/lists/*;

# Install Ollama if requested
Expand Down
2 changes: 1 addition & 1 deletion backend/dev.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export CORS_ALLOW_ORIGIN="http://localhost:5173;http://localhost:8080"
PORT="${PORT:-8080}"
uvicorn open_webui.main:app --port $PORT --host 0.0.0.0 --forwarded-allow-ips '*' --reload
uvicorn open_webui.main:app --port $PORT --host 0.0.0.0 --forwarded-allow-ips "${FORWARDED_ALLOW_IPS:-*}" --reload
71 changes: 32 additions & 39 deletions backend/open_webui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,102 +2,95 @@
import os
import random
from pathlib import Path
from typing import Annotated

import typer
import uvicorn
from typing import Optional
from typing_extensions import Annotated

app = typer.Typer()

KEY_FILE = Path.cwd() / ".webui_secret_key"
KEY_FILE = Path.cwd() / '.webui_secret_key'


def version_callback(value: bool):
def version_callback(value: bool) -> None:
if value:
from open_webui.env import VERSION

typer.echo(f"Open WebUI version: {VERSION}")
typer.echo(f'Open WebUI version: {VERSION}')
raise typer.Exit()


@app.command()
def main(
version: Annotated[
Optional[bool], typer.Option("--version", callback=version_callback)
] = None,
version: Annotated[bool | None, typer.Option('--version', callback=version_callback)] = None,
):
pass


@app.command()
def serve(
host: str = "0.0.0.0",
host: str = '0.0.0.0',
port: int = 8080,
):
os.environ["FROM_INIT_PY"] = "true"
if os.getenv("WEBUI_SECRET_KEY") is None:
typer.echo(
"Loading WEBUI_SECRET_KEY from file, not provided as an environment variable."
)
os.environ['FROM_INIT_PY'] = 'true'
if os.getenv('WEBUI_SECRET_KEY') is None:
typer.echo('Loading WEBUI_SECRET_KEY from file, not provided as an environment variable.')
if not KEY_FILE.exists():
typer.echo(f"Generating a new secret key and saving it to {KEY_FILE}")
typer.echo(f'Generating a new secret key and saving it to {KEY_FILE}')
KEY_FILE.write_bytes(base64.b64encode(random.randbytes(12)))
typer.echo(f"Loading WEBUI_SECRET_KEY from {KEY_FILE}")
os.environ["WEBUI_SECRET_KEY"] = KEY_FILE.read_text()
typer.echo(f'Loading WEBUI_SECRET_KEY from {KEY_FILE}')
os.environ['WEBUI_SECRET_KEY'] = KEY_FILE.read_text()

if os.getenv("USE_CUDA_DOCKER", "false") == "true":
typer.echo(
"CUDA is enabled, appending LD_LIBRARY_PATH to include torch/cudnn & cublas libraries."
)
LD_LIBRARY_PATH = os.getenv("LD_LIBRARY_PATH", "").split(":")
os.environ["LD_LIBRARY_PATH"] = ":".join(
if os.getenv('USE_CUDA_DOCKER', 'false') == 'true':
typer.echo('CUDA is enabled, appending LD_LIBRARY_PATH to include torch/cudnn & cublas libraries.')
LD_LIBRARY_PATH = os.getenv('LD_LIBRARY_PATH', '').split(':')
os.environ['LD_LIBRARY_PATH'] = ':'.join(
LD_LIBRARY_PATH
+ [
"/usr/local/lib/python3.11/site-packages/torch/lib",
"/usr/local/lib/python3.11/site-packages/nvidia/cudnn/lib",
'/usr/local/lib/python3.11/site-packages/torch/lib',
'/usr/local/lib/python3.11/site-packages/nvidia/cudnn/lib',
]
)
try:
import torch

assert torch.cuda.is_available(), "CUDA not available"
typer.echo("CUDA seems to be working")
assert torch.cuda.is_available(), 'CUDA not available'
typer.echo('CUDA seems to be working')
except Exception as e:
typer.echo(
"Error when testing CUDA but USE_CUDA_DOCKER is true. "
"Resetting USE_CUDA_DOCKER to false and removing "
f"LD_LIBRARY_PATH modifications: {e}"
'Error when testing CUDA but USE_CUDA_DOCKER is true. '
'Resetting USE_CUDA_DOCKER to false and removing '
f'LD_LIBRARY_PATH modifications: {e}'
)
os.environ["USE_CUDA_DOCKER"] = "false"
os.environ["LD_LIBRARY_PATH"] = ":".join(LD_LIBRARY_PATH)
os.environ['USE_CUDA_DOCKER'] = 'false'
os.environ['LD_LIBRARY_PATH'] = ':'.join(LD_LIBRARY_PATH)

import open_webui.main # we need set environment variables before importing main
import open_webui.main # noqa: F401
from open_webui.env import UVICORN_WORKERS # Import the workers setting

uvicorn.run(
"open_webui.main:app",
'open_webui.main:app',
host=host,
port=port,
forwarded_allow_ips="*",
forwarded_allow_ips='*',
workers=UVICORN_WORKERS,
)


@app.command()
def dev(
host: str = "0.0.0.0",
host: str = '0.0.0.0',
port: int = 8080,
reload: bool = True,
):
uvicorn.run(
"open_webui.main:app",
'open_webui.main:app',
host=host,
port=port,
reload=reload,
forwarded_allow_ips="*",
forwarded_allow_ips='*',
)


if __name__ == "__main__":
if __name__ == '__main__':
app()
Loading
Loading