Text-to-speech
Measured on Lokutor’s production path (the first row) and on its synthesis servers (the others):
What you can do:
- Stream. Use the WebSocket (
/ws/tts, orTTSClient) and start playback on the first chunk.POST /tts/synthesizereturns only when the whole clip is done. - Reuse the connection. A new WebSocket costs a TLS and WebSocket handshake. Over the raw API you can send several requests on one
/ws/ttssocket. (TTSClientopens a new socket per call.) - Measure it.
TTSClient.synthesize({ …, onTTFB: (ms) => … })reports the time from sending the request to the first audio.
steps has no effect on the current model (Parameters).
Voice agents
A reply’s latency is the sum of detecting that the caller has finished, transcription, the language model’s first sentence, and synthesis of that sentence. The language model is usually the largest part.- Speculative replies (Faster replies in the agent,
speculative_llm, on by default) start the reply while the caller pauses. Turns where it lands are answered in about 306 ms instead of about 660 ms. Turning it off saves the tokens of unused speculative replies and makes replies about 255 ms slower on average (Voice Chat). - Keep prompts short. A longer system prompt makes the model slower to start.
- The model. Each language model has its own time to the first word, from 0.4 to 3.4 seconds. The default is about 0.5.
- Tools add time. Each tool call is another round trip to your code or to a built-in service; web search adds a few seconds.
- Clear your queue on
interruptedand when a new reply starts (status: thinkingwith a newergeneration), so a new reply is not stuck behind old audio (WebSocket Protocol).