Files
NexusAI/docker-compose.yml
ericwyuan a301e97059 [任务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 重定向正常)
2026-08-23 09:57:54 +08:00

51 lines
1.4 KiB
YAML
Raw Permalink 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
lobe-chat:
image: lobehub/lobe-chat:latest
container_name: lobe-chat
restart: always
environment:
- OPENAI_API_KEY=${LITELLM_MASTER_KEY:-sk-1234}
- 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
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:
- lobe-chat
networks:
- ai-network
networks:
ai-network:
driver: bridge