Sales training program, 2025
Voice AI sales training
A proof of concept for real-time voice conversation with AI to train salespeople, orchestrating speech-to-text, a language model and text-to-speech to reach sub-800 ms latency at about US$ 0.025 per minute.
Stack: NestJS, WebSockets, React, Deepgram, Groq, Llama 3
- voice response latency
- < 800 ms
- cost, vs ~US$ 0.20/min for an off-the-shelf API
- ~US$ 0.025/min
The problem
An AI sales training product needs students to talk by voice with a simulated prospect, in real time. Off-the-shelf voice APIs deliver the experience but cost around US$ 0.20 per minute. For a product with thousands of hours of usage, that breaks the business model.
What we built
A proof of concept that orchestrates specialized services instead of relying on a closed API:
- Streaming transcription of the student's audio;
- A fast language model generating the simulated prospect's reply token by token;
- Sentence detection in the gateway, sending complete sentences to speech synthesis as soon as they're ready;
- Speech synthesis queued back to the browser;
- Natural interruption (barge-in): the student can cut the AI off mid-sentence, like in a real conversation.
The engineering decisions that matter
- Bidirectional WebSockets with binary audio, avoiding REST bottlenecks.
- Manual orchestration of transcription, model and voice, each picked for the best cost and latency at its step.
- Sentence buffering: the voice starts playing before the model finishes the whole reply.
Outcome
| Metric | Off-the-shelf voice API | Custom orchestration |
|---|---|---|
| Cost | ~US$ 0.20/min | ~US$ 0.025/min |
| Latency | excellent | under 800 ms |
| Control | closed ecosystem | full control |
The proof of concept showed the product is economically viable. This is the kind of decision we describe in custom AI development.