AISim › Chapter 5: Advanced
The walkie-talkie
Level 21. Talk. Wait seven seconds. Hear a reply.
Your new voice assistant answers well, but conversations feel like a walkie-talkie: you finish speaking, then silence for seven seconds, then the whole reply at once. People talk over it or hang up. A natural conversation needs the reply to start in about a second.
Goals
- time to first token at most 1.5s
- accuracy at least 85%
Concepts: Voice, Speech-to-text, Streaming.
Hint
Open the request inspector and look at where the seconds go. Every stage waits for the previous one to finish completely. Which of them can start early?
What you learn
Voice is a pipeline (speech-to-text, the model, text-to-speech) with a latency budget of about a second. If each stage waits for the previous one to finish, the delays stack up. Stream every stage: transcribe while the user speaks, stream tokens from the model, and start speaking the first sentence immediately. Images and audio as input work similarly: they become tokens the model has to read, and they cost time and money too.
More in this chapter
- One user, half your bill (Level 22)
- Same question, different answers (Level 23)
- The evals say it's fine (Level 24)
- The email that hijacked the agent (Level 25)
- The agent goes public (Chapter 5 boss)
This interactive level needs JavaScript. Built by Joshua Paul (cybernerdie).