Unit Cost Models // DialStack Metrics
Caller Barge-In Interruption: Preventing Wasted TTS Synthesis
Generating 400 characters of ahead-of-playback TTS causes 30% credit waste whenever a caller interrupts mid-sentence.
Measured Unit Economics & Telemetry
Because ElevenLabs Flash v2.5 synthesizes faster than real-time, sending a full 3-sentence LLM paragraph at once renders 15 seconds of audio before the caller hears second 2. Flushing the WebSocket per clause saves 15-25% of TTS spend.
| Cost / Latency Line | Audited Value | FinOps Impact |
|---|---|---|
| Unbuffered Whole-Turn Send | 28% - 38% wasted chars | Synthesized audio discarded on barge-in |
| Clause-Level Chunked Flush | 8% - 12% wasted chars | Stream sentence-by-sentence only |
| Abort Latency on Barge-In | < 40 ms local flush | Clear LiveKit audio track immediately |
| Net Monthly TTS Savings | ~18% at 50k min/mo | Pairs with shorter LLM prompts |
Implementation & Configuration Checklist
- Stream Sentence Boundaries: Buffer LLM tokens only to the first period or question mark before calling ElevenLabs flush.
- Cancel Downstream Task on VAD: When Silero VAD detects user speech > 180ms, cancel the pending TTS HTTP/WS future immediately.
- Keep Turn Responses Under 2 Sentences: Concise prompts dramatically reduce caller interruption frequency.
TTS_CHUNK_MODE=sentence_boundary
BARGE_IN_MIN_SPEECH_MS=180
LLM_MAX_SENTENCES=2
FinOps Engineering FAQ
Does canceling an ElevenLabs WebSocket mid-stream refund unused characters?
Characters already sent and synthesized are billed, which is why pacing sends by sentence boundary prevents wasted over-generation.
How fast does LiveKit stop playing audio on barge-in?
Clearing the local Pipecat audio output queue stops playback in 20-40ms.