This commit is contained in:
45
README.md
45
README.md
@@ -134,8 +134,8 @@ docker compose -f docker/docker-compose.yml up -d --build
|
||||
# 3. 访问应用
|
||||
# 如果配置了 Nginx 反向代理:http://your-domain.com 或 http://your-server-ip
|
||||
# 如果未配置 Nginx(直接访问):
|
||||
# - 前端: http://localhost:8501
|
||||
# - 后端 API: http://localhost:8001
|
||||
# - 前端: http://127.0.0.1:8501
|
||||
# - 后端 API: http://127.0.0.1:8001
|
||||
```
|
||||
|
||||
### 方式二:本地开发模式
|
||||
@@ -255,21 +255,26 @@ model_configs = {
|
||||
|
||||
**使用方法:**
|
||||
|
||||
- **本地开发**:`cp .env.example .env`,修改为 localhost 相关地址
|
||||
- **本地开发**:`cp .env.example .env`,修改为 127.0.0.1 相关地址
|
||||
- **Docker 部署**:`cp .env.docker .env`,使用远程服务器地址
|
||||
|
||||
### 必需的环境变量
|
||||
|
||||
| 变量名 | 说明 | 本地开发示例 | Docker 部署示例 |
|
||||
|--------|------|------------|----------------|
|
||||
| `ZHIPUAI_API_KEY` | 智谱 AI API 密钥 | `your_key_here` | `your_key_here` |
|
||||
| `DEEPSEEK_API_KEY` | DeepSeek API 密钥 | `your_key_here` | `your_key_here` |
|
||||
| `LLAMACPP_API_KEY` | llama.cpp 认证 Token | `token-abc123` | `token-abc123` |
|
||||
| `VLLM_BASE_URL` | LLM 服务地址 | `http://localhost:8081/v1` | `http://localhost:8081/v1` |
|
||||
| `VLLM_EMBEDDING_URL` | Embedding 服务地址 | `http://localhost:8082/v1` | `http://localhost:8082/v1` |
|
||||
| `QDRANT_URL` | Qdrant 地址 | `http://115.190.121.151:6333` | `http://115.190.121.151:6333` |
|
||||
| `DB_URI` | PostgreSQL 连接字符串 | `postgresql://...@115.190.121.151:5432/...` | `postgresql://...@115.190.121.151:5432/...` |
|
||||
| `API_URL` | 后端 API 地址 | `http://localhost:8083/chat` | (由 docker-compose.yml 注入) |
|
||||
| `QDRANT_URL` | Qdrant 向量数据库地址 | `http://127.0.0.1:6333` | `http://your-server:6333` |
|
||||
| `QDRANT_COLLECTION_NAME` | Qdrant 集合名称 | `mem0_user_memories` | `your_collection_name` |
|
||||
| `VLLM_BASE_URL` | LLM 服务地址(本地) | `http://127.0.0.1:8081/v1` | `http://your-server:8081/v1` |
|
||||
| `LLAMACPP_EMBEDDING_URL` | Embedding 服务地址(本地) | `http://127.0.0.1:8082/v1` | `http://your-server:8082/v1` |
|
||||
| `VLLM_BASE_URL` | LLM 服务地址(Docker) | `http://host.docker.internal:18000/v1` | `http://your-server:18000/v1` |
|
||||
| `LLAMACPP_EMBEDDING_URL` | Embedding 服务地址(Docker) | `http://host.docker.internal:18001/v1` | `http://your-server:18001/v1` |
|
||||
| `LLAMACPP_API_KEY` | llama.cpp API 密钥 | `your-llamacpp-api-key` | `your-real-api-key` |
|
||||
| `ZHIPUAI_API_KEY` | 智谱AI API密钥 | `your-zhipuai-api-key` | `your-real-api-key` |
|
||||
| `DEEPSEEK_API_KEY` | DeepSeek API密钥 | `your-deepseek-api-key` | `your-real-api-key` |
|
||||
| `VLLM_BASE_URL` | vLLM 服务地址 | `http://127.0.0.1:8081/v1` | `http://your-server:8081/v1` |
|
||||
| `LOG_LEVEL` | 日志级别 | `INFO` | `DEBUG`/`INFO`/`WARNING`/`ERROR` |
|
||||
| `ENABLE_GRAPH_TRACE` | 是否启用图流转追踪 | `true` | `true`/`false` |
|
||||
| `MEMORY_SUMMARIZE_INTERVAL` | 对话摘要生成间隔 | `10` | `5`/`10`/`15` |
|
||||
|
||||
### 配置示例
|
||||
|
||||
@@ -278,11 +283,13 @@ model_configs = {
|
||||
ZHIPUAI_API_KEY=your_api_key_here
|
||||
DEEPSEEK_API_KEY=your_deepseek_api_key_here
|
||||
LLAMACPP_API_KEY=token-abc123
|
||||
VLLM_BASE_URL=http://localhost:8081/v1
|
||||
VLLM_EMBEDDING_URL=http://localhost:8082/v1
|
||||
VLLM_BASE_URL=http://127.0.0.1:8081/v1
|
||||
LLAMACPP_EMBEDDING_URL=http://127.0.0.1:8082/v1 # 本地开发
|
||||
# 或
|
||||
LLAMACPP_EMBEDDING_URL=http://host.docker.internal:18001/v1 # Docker容器访问宿主机
|
||||
QDRANT_URL=http://115.190.121.151:6333
|
||||
DB_URI=postgresql://postgres:mysecretpassword@115.190.121.151:5432/langgraph_db?sslmode=disable
|
||||
API_URL=http://localhost:8083/chat
|
||||
DB_URI=postgresql://postgres:huang1998@115.190.121.151:5432/langgraph_db?sslmode=disable
|
||||
API_URL=http://127.0.0.1:8083/chat
|
||||
```
|
||||
|
||||
#### Docker 部署 (.env.docker)
|
||||
@@ -290,10 +297,12 @@ API_URL=http://localhost:8083/chat
|
||||
ZHIPUAI_API_KEY=your_api_key_here
|
||||
DEEPSEEK_API_KEY=your_deepseek_api_key_here
|
||||
LLAMACPP_API_KEY=token-abc123
|
||||
VLLM_BASE_URL=http://localhost:8081/v1
|
||||
VLLM_EMBEDDING_URL=http://localhost:8082/v1
|
||||
VLLM_BASE_URL=http://127.0.0.1:8081/v1
|
||||
LLAMACPP_EMBEDDING_URL=http://127.0.0.1:8082/v1 # 本地开发
|
||||
# 或
|
||||
LLAMACPP_EMBEDDING_URL=http://host.docker.internal:18001/v1 # Docker容器访问宿主机
|
||||
QDRANT_URL=http://115.190.121.151:6333
|
||||
DB_URI=postgresql://postgres:mysecretpassword@115.190.121.151:5432/langgraph_db?sslmode=disable
|
||||
DB_URI=postgresql://postgres:huang1998@115.190.121.151:5432/langgraph_db?sslmode=disable
|
||||
# API_URL 在 docker-compose.yml 中配置为 http://backend:8083/chat
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user