Zero to real-time text-to-speech: The complete Orpheus + WebSockets tutorial
Aug 8, 2025

Summary
This post details the implementation of real-time text-to-speech using WebSockets with the Orpheus TTS model on Baseten. It explains the advantages of WebSockets over traditional HTTP for streaming applications due to reduced overhead and latency. The post provides a complete Python code example demonstrating how to deploy the Orpheus model, establish a WebSocket connection, send text chunks, and receive and play back audio streams in real-time. It also highlights the importance of autoscaling for production deployments of such real-time services.
More from the Real-time Text-to-Speech with WebSockets trail
- NVIDIA Nemotron 3 Diarization: real-time speaker labels at a cent per audio hour
- Introducing NVIDIA Nemotron 3.5 ASR Streaming
- Cost-efficient, high-performance TTS with Qwen3-TTS
- Zero to real-time transcription: The complete Whisper V3 streaming tutorial
- Canopy Labs selects Baseten as preferred inference provider for Orpheus TTS models