Home icon

Stream low-latency speech from AI agents using Kokoro TTS on Amazon SageMaker AI

Machine Learning Blog



This article demonstrates how to reduce latency in AI voice agents by streaming text to a Kokoro-82M text-to-speech model on Amazon SageMaker as sentences are generated, enabling audio playback to begin before the full response is complete.

  • Deploy Kokoro-82M on a SageMaker real-time endpoint using a custom container with bidirectional WebSocket streaming
  • Handle binary WebSocket frames correctly by accepting both text and bytes message types in Starlette handlers
  • Keep bidirectional sessions open across multiple messages to avoid reconnection overhead between sentences
  • Use an IncrementalSentenceChunker class to normalize streaming text and emit complete sentences immediately
  • Multiplex raw binary audio and JSON control frames over the same bidirectional session instead of base64-encoding
  • Achieved 52% reduction in time to first audio for TTS alone, and 2.4-3.5x improvement in end-to-end agent scenarios

Streaming synthesis alongside generation instead of waiting for complete responses significantly reduces perceived latency in voice agents while keeping inference costs low on mid-tier GPU instances.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Sep 25
2026
Deploying real-time personalized speech with Qwen3-TTS on Amazon SageMaker AI
Oct 22
2026
Stop guessing auto scaling targets for TTS on Amazon SageMaker AI
Sep 28
2026
Build real-time voice applications with vLLM-Omni on SageMaker AI – Part 1
Sep 30
2026
Voice-Activated AI Agent with Amazon Connect Customer and Amazon Bedrock

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.