keepalive: TTS warm ping every 30 min (measured, halves warm cost)

Idle sweep 2026-11-28 (5/10/15/20/30/45/60 min gaps through the live gateway): warm latency 0.38-0.99s through 45 minutes, no cold-start cliff, so the 15-minute ping was paying $5.76/mo for warmth already present. 30 min halves it to ~$2.88/mo and stays inside the proven-warm window; the 60-min trial was contaminated by member voice traffic at 34 min true idle, so 30 is the conservative bound. Comments in start.sh and README record why, so the interval is not 'tidied' back to 15.
This commit is contained in:
inference-admin committed 2026-11-28 16:56:33 +00:00
1 parent 61964cd217
commit 24dbd313cf
3 files changed
+24 -12

No files matched your search

+11 -3
View File
@@ -235,10 +235,18 @@ LibreChat (chat) does **not** talk to this gateway directly — it routes throug
## Audio keep-alive
The gateway pings the Tinfoil TTS model every 15 minutes (`audio_keepalive.py`,
The gateway pings the Tinfoil TTS model every 30 minutes (`audio_keepalive.py`,
started by the loop in `start.sh`) to keep the TEE audio enclave warm — voice
mode then skips the ~24s cold-start after idle. TTS-only: an STT ping would cost
$0.01/request (~$52/mo at 6/hr) versus $0.002 for TTS — about **$0.19/day**.
$0.01/request (~$52/mo at 6/hr) versus $0.002 for TTS — about **$0.096/day
(~$2.88/mo)**.
The 30-minute interval is measured, not assumed: an idle sweep on 2026-11-28
(gaps 5–60 min through this gateway) found warm latency (0.38–0.99s) through
45 minutes idle and no cold-start cliff. The earlier 15-minute cadence cost
~$5.76/mo for warmth that was already there; 30 min halves it and stays inside
the proven-warm window. Re-run that sweep if the provider's behaviour changes —
the script and probe notes live in this repo's history.
**Billing is the point of the key split.** The ping authenticates with the
keepalive team's own key, read from `/app/data/.keepalive_key`: team
@@ -257,4 +265,4 @@ the returned key to `/app/data/.keepalive_key`.
Verify after deploys: `cloudron exec --app <id> -- python3 /app/code/audio_keepalive.py`
exits 0 silently, and a fresh `$0.002` SpendLogs row appears under
`agent:audio-keepalive` within 15 minutes.
`agent:audio-keepalive` within 30 minutes.