Files
NexusAI/docker-compose.yml
ericwyuan eeccf36ab3 [任务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 分钟)
2026-08-23 09:30:42 +08:00

46 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
litellm:
image: ghcr.io/berriai/litellm:latest
container_name: litellm-proxy
restart: always
environment:
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY:-sk-1234}
volumes:
- ./litellm-config.yaml:/home/litellm/config.yaml:ro
networks:
- 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
restart: always
environment:
- OPENAI_API_KEY=${LITELLM_MASTER_KEY:-sk-1234}
- OPENAI_API_BASE=http://litellm:4000/v1
- WEBUI_AUTH=False
networks:
- ai-network
nginx:
image: nginx:alpine
container_name: nginx-proxy
restart: always
ports:
# NAS 本机 80/443 已被其他服务占用,改用 8443
# 甲骨文 frp 隧道frpc.toml [[proxies]] name=nexusai将公网专属端口 3210 转发到 NAS 的 8443
- "8443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs:/etc/nginx/certs:ro
depends_on:
- openwebui
networks:
- ai-network
networks:
ai-network:
driver: bridge