Mechanism: Managed Voice Platform (ElevenLabs Agents WebRTC / Deepgram Voice Agent API think.provider.type = "custom" / Vapi) handles audio, AEC, VAD, and TTS, calling DurableAgent over POST /api/v1/chat/completions (text/event-stream). When the edge drops the HTTP request on user barge-in, res.on("close") triggers conv.abort(ctx).

pnpm exec tsx examples/30-voice-byo-llm-bridge/run.ts # :7492 + /shell/ with custom:voice-byo-edge
pnpm exec tsx examples/30-voice-byo-llm-bridge/run.ts --smoke # offline verification, exit 0
# With a real model behind the bridge
dotenvx run -- pnpm exec tsx examples/30-voice-byo-llm-bridge/run.ts \
--model google:gemini-4-hydrogen
Open http://127.0.0.1:7492/shell/ to inspect the Voice: BYO-LLM Edge component (voice-byo-edge.js) with copyable ElevenLabs / Deepgram / Vapi configs, live SSE wire telemetry, and simulated HTTP barge-in.
Checks
| Check | What it proves |
|---|---|
sse-streams-openai-chunks | POST /api/v1/chat/completions with stream: true emits incremental chat.completion.chunk events and data: [DONE]. |
durable-tool-runs-behind-byo-llm | A prompt invoking lookup_status runs the durable tool and streams the grounded answer while committing the tool entry to agent.sqlite. |
client-disconnect-triggers-durable-abort | Aborting the streaming HTTP fetch mid-response fires conv.abort(ctx) and increments VoiceSessionDoc.bargeIns. |
non-streaming-completion-works | stream: false returns a valid OpenAI chat.completion JSON response. |
substrate-component-served | /shell/manifest.json includes custom:voice-byo-edge and /shell/custom/voice-byo-edge.js returns 200. |
Break it
In examples/30-voice-byo-llm-bridge/run.ts, remove the conv.abort(ctx) call inside res.on("close", ...). The client-disconnect-triggers-durable-abort check times out waiting for VoiceSessionDoc.bargeIns to increment and --smoke exits 1.
Files
run.ts:serveAgent+/api/v1/chat/completionsSSE bridge,/api/voice-edge/{events,configs}, and--smoke.components/voice-byo-edge.js: Zero-dependency Substrate Shell simulator + vendor config inspector.PROMPT.md: Prompt to rebuild this lab.