A real-time voice coaching pipeline built entirely on the Cloudflare Developer Platform. The browser streams microphone audio over a WebSocket to a HelperAgent Durable Object, which feeds it into Workers AI's Nova-3 model for streaming speech-to-text. Each finalized utterance triggers a Llama 3.1 8B coaching call, and a 20-second rolling-window timer asks the LLM for proactive insights based on recent exchanges — both surfaced to the browser as typed JSON messages alongside live transcript and STT/LLM latency metrics. Because it's hosted as an open, unauthenticated public demo, a native Workers Rate Limiting binding gates new WebSocket connections per IP before they reach the Durable Object, and the agent enforces a max session duration plus a max LLM-calls-per-session cap — all centrally configured in one shared config module so the UI's Detail tab can display the exact values in effect alongside live latency numbers.
Browser (mic capture + WebSocket)
▼
Cloudflare Worker
├── Rate Limiting binding ── per-IP connection gate (5 / 60s)
▼
HelperAgent DO (WebSocket Hibernation)
├── Nova-3 STT (Workers AI) ── streaming transcription
│ └── finalization-lag timing → metrics message
├── onTranscript() → Llama 3.1 8B (Workers AI) → suggestion
├── rollingAnalysis() every 20s → Llama 3.1 8B → insight
├── session-length + LLM-call-cap quotas → notice message
└── shared/config.ts ── single source of truth (server + Detail tab)