Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
Humans notice conversational lag with brutal precision — psycholinguistics research on turn-taking in human conversation puts the average gap between one person stopping and the other starting at only about 200 milliseconds, and anything much past that starts to feel like a laggy phone call instead of a conversation. That number is the entire reason this course exists: it's the target your pipeline is competing against, and it forces you to treat every stage as a budget line item instead of 'however long the API takes.' A builder who understands the budget writes different code from day one — they stream instead of buffer, they pick the smaller model when it clears the bar, and they know which 100ms are worth spending money to shave off and which aren't. A builder who doesn't understand the budget ships something that works great in a demo and feels sluggish the moment a real network is involved.
This budget calculator lets you allocate a fixed total latency target across the stages of the loop and see what's left over — and what breaks the budget — before you've written a line of a real pipeline.
TARGET_MS = 500 # the "feels like a conversation" ceiling
budget = {
"network_up": 40, # mic audio to your ASR provider
"asr_partial": 150, # streaming ASR settle + endpointing decision
"llm_first_token": 200, # time-to-first-token from the LLM
"tts_first_byte": 150, # TTS time-to-first-byte once text starts arriving
"network_down": 40, # audio back to the user's speaker
}
def evaluate_budget(budget: dict, target_ms: int) -> None:
total = sum(budget.values())
print(f"stages sum to {total}ms against a {target_ms}ms target")
for stage, ms in budget.items():
bar = "#" * (ms // 10)
print(f" {stage:<16} {ms:>4}ms {bar}")
if total > target_ms:
over = total - target_ms
print(f"OVER BUDGET by {over}ms — pick a stage to cut before you write code")
else:
print(f"UNDER BUDGET with {target_ms - total}ms of slack")
evaluate_budget(budget, TARGET_MS)python3 main.py