feat: filter meaningful conversations with local model
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# 本地聊天总结模型
|
||||
|
||||
本地开发环境使用 Ollama 提供 OpenAI 兼容接口,默认验证模型为 `qwen2.5:7b`。模型只监听本机 `11434` 端口,应用容器通过 `http://ollama:11434/v1` 访问。
|
||||
|
||||
## 启动与下载模型
|
||||
|
||||
```powershell
|
||||
docker compose --profile local-model up -d ollama
|
||||
docker compose --profile local-model exec ollama ollama pull qwen2.5:7b
|
||||
```
|
||||
|
||||
随后在客户门户的“大模型管理”中创建并激活配置:
|
||||
|
||||
- 服务类型:`OpenAI 兼容接口`
|
||||
- 接口基础地址:`http://ollama:11434/v1`
|
||||
- 模型 ID:`qwen2.5:7b`
|
||||
- API Key:本地 Ollama 不校验密钥,可填写长度至少 8 位的本地占位值
|
||||
- 建议温度:`0.1`
|
||||
- 建议最大输出:`1200`
|
||||
|
||||
必须先执行“测试连接”,通过后才能“设为当前模型”。配置激活后,worker 会在每个总结任务开始时读取当前模型,不需要重启。
|
||||
|
||||
## 真实模型回归测试
|
||||
|
||||
```powershell
|
||||
$env:LOCAL_MODEL_BASE_URL='http://localhost:11434/v1'
|
||||
$env:LOCAL_MODEL_ID='qwen2.5:7b'
|
||||
go test ./internal/extraction -run TestLocalModelContentValueDecisions -count=1 -v
|
||||
```
|
||||
|
||||
测试覆盖三类输入:纯寒暄应舍弃、有用近况只生成摘要、完整个人回忆生成摘要和故事候选。
|
||||
Reference in New Issue
Block a user