WhoBuilt

Optimizing inference for voice models in production

Jul 1, 2025· 15 min· 3.5K views·Watch on YouTube

Speaker

Philip Kiely of Baseten explains how to optimize text-to-speech inference for production, using Orpheus TTS as an example at an AI Engineer event.

Treat TTS like an LLM

Kiely says many TTS models use autoregressive transformer architectures similar to LLMs, so LLM optimization tools can apply. Orpheus TTS, his example, uses a Llama 3.2 3B backbone with a larger speech-token vocabulary and extended context length.

Optimize for voice workloads

For voice, Kiely prioritizes time to first byte and concurrent streams alongside throughput. Orpheus needs about 83 tokens per second for real-time output; beyond that, he says, reducing latency and serving more connections efficiently matter more than maximizing token speed.

Tune the runtime and measure results

Kiely describes using TensorRT-LLM, FP8 quantization on Hopper GPUs, and torch.compile with inference mode for the SNAC audio decoder. Dynamic batching collects work for up to 15 milliseconds, trading some latency for throughput, and profiling showed the pipeline can become CPU-bound. On half an H100, the implementation handled 16 simultaneous streams under variable traffic and 24 under constant traffic; real-world time to first byte reached 150 milliseconds.

Keep the rest of the pipeline fast

Runtime gains can be erased by network distance, repeated session setup, or sequential client requests. Kiely recommends reusing sessions and benchmarking with concurrent requests, and notes that voice systems may use HTTP streaming, WebSockets, or gRPC. Keeping pipeline components in the same data center and avoiding DNS hairpins can save about 10 milliseconds per step.

Think across listening, thinking, and talking

Kiely frames voice agents as three connected parts: listening, thinking, and talking. TTS runtime is only one part of the work; infrastructure between models, client implementation, fine-tuning, voice cloning, and audio quality all affect the overall system.

Takeaways

  • For streaming TTS, target the token rate needed for real time, then optimize first-byte latency and concurrency.
  • Benchmark with enough concurrent requests to saturate the service, and reuse sessions between requests.
  • Profile the full audio pipeline: GPU work can still leave CPU processing as the concurrency bottleneck.
  • Measure end-to-end latency, since network routing and session setup can erase runtime improvements.
  • Place pipeline components close together and avoid unnecessary network hops to protect latency budgets.

Mentioned in this talk

Search inside this talk

What was claimed 12

Show all 12 facts

Related talks