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 -7
View File
@@ -284,18 +284,22 @@ echo "Tinfoil proxy is up on 127.0.0.1:3301"
# could not be proven to reach 127.0.0.1:4000 and /app/data, and two warm
# paths billed twice for the same ping. The warm path is owned HERE — the
# app container, where the network namespace, the master key and the
# sidecar are all proven. Every 15 minutes ping tinfoil/voxtral-tts
# sidecar are all proven. Every 30 minutes ping tinfoil/voxtral-tts
# ($0.002/request) so voice mode skips the ~24s Tinfoil cold-start after
# idle. The script uses the keepalive team's key (/app/data/.keepalive_key)
# so the spend bills to agent:audio-keepalive instead of landing in
# SpendLogs with no team. audio_keepalive.py is silent on success and prints
# on failure, so /app/data/keepalive.log only ever grows on failure.
# idle. 30 min (not 15) because a measured idle sweep on 2026-11-28 found
# warm latency through 45 minutes idle — no cold-start cliff — so the
# 15-minute cadence was buying nothing and cost ~$5.76/mo; 30 min halves
# it to ~$2.88/mo while staying inside the proven-warm window. The script
# uses the keepalive team's key (/app/data/.keepalive_key) so the spend
# bills to agent:audio-keepalive instead of landing in SpendLogs with no
# team. audio_keepalive.py is silent on success and prints on failure, so
# /app/data/keepalive.log only ever grows on failure.
(
while true; do
python3 /app/code/audio_keepalive.py >> /app/data/keepalive.log 2>&1 || true
sleep 900
sleep 1800
done
) &
echo "Audio keep-alive loop started (every 900s)"
echo "Audio keep-alive loop started (every 1800s)"
exec litellm --config "$CONFIG_FILE" --port 4000 --host 0.0.0.0