[任务5] 最终方案: LobeChat + LiteLLM(简化网关,保留稳定前端)

技术栈:
- 前端:LobeChat(已稳定运行,模型列表仅显示 auto-vision/auto-text)
- 网关:LiteLLM Proxy(纯 YAML 配置驱动,5 个渠道定义 + 自动优先级 + Failover)
- 存储:无(LiteLLM 无状态,配置即代码)

简化点:
- 删除 MySQL(LiteLLM 无需持久化配置数据库)
- 删除 One-API 后台登录(LiteLLM 通过 litellm-config.yaml 配置)
- 保留 LobeChat(功能完整、已验证稳定、用户体验好)

用户体验: 打开 https://129.146.203.203:3210 → 输入 Access Code → 问答(后台自动选最好的模型)

已部署并验证端到端可访问(HTTP 307 重定向正常)
This commit is contained in:
ericwyuan
2026-08-23 09:57:54 +08:00
parent eeccf36ab3
commit a301e97059
3 changed files with 17 additions and 8 deletions

View File

@@ -13,14 +13,19 @@ services:
- ai-network
command: python -m litellm.proxy.proxy --config /home/litellm/config.yaml --port 4000
openwebui:
image: ghcr.io/open-webui/open-webui:latest
container_name: openwebui
lobe-chat:
image: lobehub/lobe-chat:latest
container_name: lobe-chat
restart: always
environment:
- OPENAI_API_KEY=${LITELLM_MASTER_KEY:-sk-1234}
- OPENAI_API_BASE=http://litellm:4000/v1
- WEBUI_AUTH=False
- OPENAI_PROXY_URL=http://litellm:4000/v1
- ACCESS_CODE=${LOBE_ACCESS_CODE:-change_me}
- DEFAULT_LANG=zh-CN
# 只暴露聚合模型名
- OPENAI_MODEL_LIST=-all,+auto-vision=Auto Vision<vision>,+auto-text=Auto Text
depends_on:
- litellm
networks:
- ai-network
@@ -36,7 +41,7 @@ services:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs:/etc/nginx/certs:ro
depends_on:
- openwebui
- lobe-chat
networks:
- ai-network