Sogni Voice 生产化配置清单(鉴权+预热+守护)
在自建语音服务从“能跑”升级到“稳定可用”时,重点是环境变量最小开启、API 鉴权、以及 PM2 守护与开机自启。
GITHUBDiscovered 2026-02-13Author Sogni-AI
Prerequisites
- Sogni Voice repository is installed and baseline dev run succeeds.
- You can edit `.env` and manage PM2 on host.
Steps
- Copy `.env.example` to `.env`, then enable only required engines (`*_ENABLED=1`) to control memory footprint.
- Enable API auth (`AUTH_ENABLED=1` + strong `AUTH_API_KEY`) before exposing endpoint beyond localhost.
- Turn on prewarm flags for selected engines to reduce first-request cold start.
- Use PM2 for process supervision and persist startup (`pm2 startup && pm2 save`).
Commands
cp .env.example .envnpm run pm2:startnpm run pm2:statuspm2 startup && pm2 saveVerify
After reboot, voice service auto-recovers and authenticated TTS/STT requests still succeed.
Caveats
- Higher-end models (e.g., larger Qwen3 variants) may exceed memory on entry-level devices(需验证)。
- When binding to `0.0.0.0`, combine firewall/ACL with API-key auth.
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗