85 lines
2.0 KiB
Markdown
85 lines
2.0 KiB
Markdown
# 大模型环境配置说明
|
||
|
||
## 需要修改的文件列表
|
||
|
||
切换大模型环境时,需要修改以下文件:
|
||
|
||
| 文件路径 | 说明 |
|
||
|----------|------|
|
||
| `ry-xinli-admin/src/main/resources/application.yml` | Java后端配置,ollama.enabled和openai.enabled |
|
||
| `xinli-ui/src/views/psychology/report/comprehensive.vue` | 综合评估页面,API_URL和MODEL |
|
||
| `xinli-ui/src/views/psychology/report/detail.vue` | 报告详情页面,API_URL和MODEL |
|
||
| `xinli-ui/src/views/psychology/report/index.vue` | 报告列表页面,API_URL和MODEL |
|
||
|
||
## 服务器环境
|
||
|
||
- **Python**: 3.8.6 (Windows)
|
||
- **Ollama 模型**:
|
||
- `nomic-embed-text:latest` (274 MB) - 向量嵌入
|
||
- `deepseek-r1:32b` (19 GB) - 文本生成
|
||
|
||
## 配置方案
|
||
|
||
### 本地开发环境
|
||
| 用途 | 模型 | 来源 |
|
||
|------|------|------|
|
||
| 向量嵌入 | `nomic-embed-text` | 本地 Ollama |
|
||
| 文本生成 | `moonshot-v1-32k` | Kimi API (远程) |
|
||
|
||
### 服务器部署环境
|
||
| 用途 | 模型 | 来源 |
|
||
|------|------|------|
|
||
| 向量嵌入 | `nomic-embed-text` | 本地 Ollama |
|
||
| 文本生成 | `deepseek-r1:32b` | 本地 Ollama |
|
||
|
||
## 配置文件
|
||
|
||
### Python RAG 服务 (rag-python/config.py)
|
||
本地和服务器配置相同:
|
||
```python
|
||
OLLAMA_URL = "http://localhost:11434"
|
||
OLLAMA_EMBED_MODEL = "nomic-embed-text"
|
||
```
|
||
|
||
### Java 后端 (application.yml)
|
||
|
||
**本地开发** - 使用 Kimi API:
|
||
```yaml
|
||
rag:
|
||
mode: disabled
|
||
python:
|
||
url: http://localhost:5000
|
||
enabled: true
|
||
openai:
|
||
base-url: https://api.moonshot.cn/v1
|
||
api-key: sk-xxx
|
||
generate-model: moonshot-v1-32k
|
||
```
|
||
|
||
**服务器部署** - 使用本地 Ollama:
|
||
```yaml
|
||
rag:
|
||
mode: disabled
|
||
python:
|
||
url: http://localhost:5000
|
||
enabled: true
|
||
ollama:
|
||
url: http://localhost:11434
|
||
generate-model: deepseek-r1:32b
|
||
enabled: true
|
||
```
|
||
|
||
## 启动顺序
|
||
|
||
1. `ollama serve` - 启动 Ollama 服务
|
||
2. `rag-python/start.bat` - 启动 Python RAG 服务
|
||
3. `java -jar xinli-admin.jar` - 启动 Java 后端
|
||
|
||
## 服务端口
|
||
|
||
| 服务 | 端口 |
|
||
|------|------|
|
||
| Ollama | 11434 |
|
||
| Python RAG | 5000 |
|
||
| Java 后端 | 30081 |
|