← Back to library

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
  1. Copy `.env.example` to `.env`, then enable only required engines (`*_ENABLED=1`) to control memory footprint.
  2. Enable API auth (`AUTH_ENABLED=1` + strong `AUTH_API_KEY`) before exposing endpoint beyond localhost.
  3. Turn on prewarm flags for selected engines to reduce first-request cold start.
  4. Use PM2 for process supervision and persist startup (`pm2 startup && pm2 save`).
Commands
cp .env.example .env
npm run pm2:start
npm run pm2:status
pm2 startup && pm2 save
Verify

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 ↗
Visit original post