# LiveKit Voice AI 部署检查清单

## ✅ 已完成

### 1. LiveKit Server (Docker)
- [x] 镜像已拉取: `livekit/livekit-server:latest`
- [x] 容器运行中: Port 7880/7881
- [x] API Key 配置: `devkey:secret`

### 2. FunASR STT 服务 (本地 Python)
- [x] 模型下载: SenseVoiceSmall (~893MB)
- [x] 服务运行: http://localhost:8080
- [x] API 端点: `/stream`, `/recognize`, `/health`
- [x] TEN VAD 已集成

### 3. Speaker Labeler
- [x] Web UI: http://localhost:8000
- [x] API: `/api/speakers`, `/api/record`

## ⚠️ 需要配置

### 1. LLM 服务 (必须)
**选项 A: 使用 OpenAI/DeepSeek API**
```bash
# 编辑 .env.dev
OPENAI_API_KEY=your-actual-key
OPENAI_BASE_URL=https://api.deepseek.com  # 推荐，更便宜
# 或
OPENAI_BASE_URL=https://api.openai.com
```

**选项 B: 使用 Hermes Agent**
```bash
# 启动 Hermes 作为 LLM 服务
cd ~/.hermes
hermes serve --config config/hermes.yaml
# 端口: 8642
```

### 2. Agent Worker 代码完善
当前 `agent.py` 是框架，需要完善：
- [ ] 集成 LiveKit Agents SDK 真实 pipeline
- [ ] 实现 VAD → STT → LLM → TTS 完整链路
- [ ] 添加打断逻辑
- [ ] 连接实际的 LLM API

### 3. TTS 服务 (可选)
- [ ] edge-tts (免费，云端)
- [ ] IndexTTS (本地，需 GPU)

## 📋 快速测试

### 测试 STT 服务
```bash
curl -X POST http://localhost:8080/stream \
  -H "Content-Type: audio/wav" \
  --data-binary @test.wav
```

### 测试 LiveKit
```bash
open http://localhost:7880
# 访问 LiveKit Studio
```

### 测试 Speaker Labeler
```bash
open http://localhost:8000
```

## 🚀 下一步行动

1. **配置 LLM API Key**
   ```bash
   cp .env.dev .env
   # 编辑 .env，填入真实 API Key
   ```

2. **完善 Agent Worker**
   - 参考: https://docs.livekit.io/agents/
   - 集成 sense-voice STT
   - 添加 LLM 调用

3. **测试端到端流程**
   - WebRTC 音频输入
   - STT 转录
   - LLM 回复
   - TTS 播放

## 📁 关键文件位置

```
~/.hermes/workspace/livekit-agents/
├── agent.py              # Agent Worker 入口
├── docker-compose.yml    # Docker 编排
├── .env.dev              # 开发环境配置
├── services/
│   ├── funasr_stt_server.py  # FunASR STT 服务
│   └── requirements.funasr.txt
├── scripts/
│   ├── start_all.sh      # 一键启动
│   └── start_funasr.sh   # 启动 STT 服务
└── config/
    ├── livekit.yaml      # LiveKit 配置
    └── hermes.yaml       # Hermes LLM 配置

~/.cache/modelscope/models/
├── iic--SenseVoiceSmall/          # STT 模型
└── iic--speech_fsmn_vad_zh-cn-16k-common-pytorch/  # VAD 模型
```
