[任务5] 重构方案:用 OpenWebUI + LiteLLM 替换 One-API + MySQL
技术栈简化: - 前端:One-API 网页管理 → OpenWebUI 极简界面(WEBUI_AUTH=False 无需登录,自动连接 LiteLLM) - 网关:One-API(数据库驱动)→ LiteLLM(纯 YAML 配置驱动) - 数据存储:MySQL(持久化) → LiteLLM 无状态(配置即代码) 配置简化: - 不需要注册账号、不需要点网页添加渠道 - 所有 5 个渠道的定义、模型映射、优先级、Failover 规则写在 litellm-config.yaml - API Key 填在 .env(占位符在 config.yaml 中引用) - 用户体验:打开网页 → 输入问题 → 自动用最合适的模型回答 已部署到 NAS,openwebui 正在初始化数据库(首次启动需要 1-2 分钟)
This commit is contained in:
10
nginx.conf
10
nginx.conf
@@ -21,7 +21,7 @@ http {
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
# 域名/IP 未确定前,先用 _ 通配 server_name(见 SDD 8.4 待确认事项)
|
||||
# 域名/IP 未确定前,先用 _ 通配 server_name
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name _;
|
||||
@@ -30,14 +30,18 @@ http {
|
||||
ssl_certificate_key /etc/nginx/certs/privkey.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://lobe-chat:3210;
|
||||
proxy_pass http://openwebui:8080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# 关闭缓冲/缓存以支持流式输出(SSE)
|
||||
# WebSocket 支持(Infinity Chat 可能使用 WebSocket)
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
# 关闭缓冲/缓存以支持流式输出
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_read_timeout 300s;
|
||||
|
||||
Reference in New Issue
Block a user