Files
wecom_it_smart_desk/docs/09-部署运维/本地AI服务部署指南.md
T

101 lines
2.2 KiB
Markdown
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.
# 本地 AI 服务部署指南(Dify + RAGFlow
> 更新日期:2026-07-06
## 系统要求
| 服务 | 最低内存 | 推荐内存 |
|------|----------|----------|
| Dify (CPU) | 8GB | 16GB |
| RAGFlow (CPU) | 8GB | 16GB |
| 两者同时 | 16GB | 32GB |
**当前可用内存:约 7.4GB**
---
## 方案一:仅部署 Dify(推荐)
### 步骤1:停止本地不需要的容器
```powershell
# 停止开发环境(如果不需要)
docker stop dev_wecom_backend dev_wecom_postgres dev_wecom_redis
```
### 步骤2:部署 Dify (CPU版)
```powershell
cd D:\资料\03-项目开发\wecom_it_smart_desk
mkdir dify && cd dify
# 下载 Docker Compose
curl -o docker-compose.yml https://github.com/langgenius/dify/raw/main/docker/docker-compose.middleware.yaml
# 启动
docker compose up -d
```
### 步骤3:访问
- Web UI: http://localhost:8080
- API: http://localhost:8081
- 默认管理员: admin@dify.local / admin
---
## 方案二:仅部署 RAGFlowCPU版)
### 步骤1:停止本地不需要的容器
```powershell
docker stop dev_wecom_backend dev_wecom_postgres dev_wecom_redis
```
### 步骤2:部署 RAGFlow
```powershell
cd D:\资料\03-项目开发\wecom_it_smart_desk
mkdir ragflow && cd ragflow
# 下载配置
curl -o docker-compose.yml https://raw.githubusercontent.com/infiniflow/ragflow/main/docker/docker-compose.yml
curl -o .env https://raw.githubusercontent.com/infiniflow/ragflow/main/docker/.env
# 启动(使用 CPU profile
docker compose --profile cpu up -d
```
### 步骤3:访问
- Web UI: http://localhost:9380
- API: http://localhost:9380/api
- 默认管理员: root / infiniflow
---
## 方案三:同时部署(需要16GB+内存)
1. 先停止开发容器
2. 部署 Dify(会占用约 4-6GB
3. 等待稳定后部署 RAGFlow(会占用约 4-6GB
---
## 生产环境已配置
| 服务 | 地址 | 用途 |
|------|------|------|
| Dify 生产 | http://yw-dify.dc.servyou-it.com/ | AI 对话、工作流 |
| RAGFlow 生产 | http://10.80.0.85:8080/ | 知识库管理 |
---
## 本地配置后端连接
修改 `backend/.env.dev`
```bash
# Dify
DIFY_BASE_URL=http://localhost:8081
DIFY_API_KEY=your-api-key
# RAGFlow
RAGFLOW_BASE_URL=http://localhost:9380
RAGFLOW_API_KEY=your-api-key
```