techlist.io

Voice Ai

4 posts

Cloudflare2026-08-032 min readCurated summary

Cloudflare Workers and Containers now support inbound TCP connections and gRPC

Cloudflare is expanding Workers to support low-latency, TCP-based applications such as real-time voice AI and gRPC services. New inbound socket handling lets Workers route connections through Durable Objects and Containers, while Cloudflare also enables full-duplex gRPC servers running in containers. Together, these capabilities allow developers to deploy language-agnostic TCP and gRPC services closer to users across Cloudflare’s global network. ## Inbound TCP with `connect(socket)` - Workers can now accept inbound TCP sockets through a new `connect()` handler. - The socket exposes readable and writable streams, allowing Workers to send, receive, and proxy raw bytes. - Connections can be routed: - Between Workers - From Workers to Durable Objects - From Durable Objects to Cloudflare Containers - Developers can pipe data in both directions to preserve full-duplex communication. - Containers can run arbitrary TCP servers written in any language, such as Python services listening on port `8080`. - Cloudflare Spectrum provides the TCP ingress layer and routes incoming connections to the selected Worker. ## Full-Duplex gRPC in Containers - Developers can deploy gRPC servers written in languages such as Go inside Cloudflare Containers. - Bidirectional streaming allows clients and servers to exchange messages over one persistent connection. - This is particularly useful for: - Real-time voice AI - Low-latency inference - Mobile and distributed applications - Streaming RPC workflows - A sample Go server sends an initial connection message, echoes incoming messages, and sends a closing message when the client disconnects. - Cloudflare’s network of more than 330 locations can bring gRPC workloads closer to users, reducing latency. ## gRPC APIs from Workers - Workers can serve unary and server-streaming gRPC APIs. - Workers can also call external gRPC servers. - Developers write the application using gRPC-Web, while Cloudflare automatically converts incoming and outgoing requests to standard gRPC. - This provides a simpler integration path for applications that need gRPC without managing raw protocol translation themselves. ## Availability - The features are being introduced through a private beta. - Interested developers must sign up to gain access. Cloudflare recommends these capabilities for applications requiring persistent, low-latency, bidirectional communication. The combination of Spectrum, Workers, Durable Objects, and Containers provides a flexible path for running raw TCP protocols and gRPC services close to end users.

OpenAI2026-08-025 min readCurated summary

How we built a realtime system for responsive voice AI in six months

# How OpenAI Built GPT‑Live: A Realtime Voice System Engineered Around Continuous Audio OpenAI's GPT‑Live replaces the turn-based design of earlier voice assistants with a full-duplex voice model that listens and speaks at the same time, with no separate turn detector in the audio path. Frontier models such as GPT‑5.5 are consulted asynchronously for deeper reasoning and tool use, so the conversation never pauses for them. Delivering this required rethinking inference, context management, delegation, transport, and session startup so that every layer keeps audio flowing on schedule. ## Why Turn-Based Voice Fell Short - Earlier systems used small turn detectors to decide when the user had finished speaking. Guessing too early cut users off, and guessing too late made responses feel sluggish. - Cascaded pipelines ran speech-to-text, the LLM, and text-to-speech in series, adding latency and discarding cues like tone and pacing. - Speech-to-speech models improved fidelity, but they still waited on a turn detector, so the interaction remained turn-based. ## Streaming Inference and Continuous Media - Audio streams into the voice model and speech streams back out, rather than being handled as discrete request-response blobs. - A dedicated fast path carries media, while delegation, tool calls, and persistence run behind an asynchronous RPC boundary. A slow tool can delay its own result but cannot stall audio. - The media frontend and inference logic were rewritten from Python asyncio to Go, bringing the p95 frame delivery time in line with the previous system's p50. - WebRTC handles transport. Under late packets it stretches audio to avoid gaps, then briefly speeds playback to catch up to real time. ## Stateful Handoffs and Context Compaction - Long sessions outgrow context limits, and model instances scale up and down with demand. To handle this, a replacement instance is warmed and prefilled with current session context, runs in parallel with the original, and takes over once ready. - Compaction is treated as another managed transition. Shrinking context invalidates the KV cache, which would normally force a costly re-prefill. Instead, the system prepares a compacted replacement in the background and switches over without interrupting media. ## Delegation Without Blocking the Conversation - The frontier model's session is created and prefilled with initial context when the voice session starts, so the prompt is already processed when the first delegated request arrives. - Session affinity and prompt caching keep latency low, and worker failures remain recoverable. - Reasoning effort, output limits, tool schemas, and model-tool round trips were tuned to shorten the time until a useful result returns. - Because the rest of ChatGPT expects discrete messages, the application server converts continuous speech into turns. It uses partial transcripts and timing signals to infer the speaker, keeps the newest message provisional, and finalizes it once attribution is reliable. - Two views are maintained: a speculative view for the live UI and an authoritative transcript for analytics and safety logging. Brief acknowledgments like "mm hmm" are generally not promoted to their own messages, while substantive interjections often are. ## Faster Session Startup with WARP and Instant Connect - A vanilla WebRTC session needs several handshakes and round trips before media flows. WARP (WebRTC Abridged Roundtrip Protocol) cuts media and data startup from six round trips to one. It does this by piggybacking DTLS on ICE (SPED), using DTLS 1.3, pre-negotiating SCTP (SNAP), and pre-negotiating data channels instead of using DCEP. - These are open specifications, being advanced through the IETF TSVWG working group. WARP support has been added to libwebrtc and Pion. - Instant Connect negotiates SDP parameters ahead of time without reserving server capacity. The server materializes the session on the first media packet if the parameters are valid, and falls back to the standard signaling flow with no added latency if they are stale. - Together, these let a client start a session with a single UDP packet. ## Testing in Production Before Launch - A silent shadow test routed a growing share of real ChatGPT Voice sessions to GPT‑Live, which ran read-only while Advanced Voice Mode continued serving users. This exposed the system to real networks, session lengths, and geographies without changing what users heard. - Capacity could not be measured by GPU throughput alone. CPU-side stream handlers, queues, and network paths saturated earlier than load tests predicted. The capacity question became how many concurrent sessions could keep every frame on schedule. - Geography mattered. Routing sessions to distant capacity added delay at several points, so rollouts were validated alongside regional capacity and traffic-steering configuration. - Long sessions, reconnects, and client disconnects surfaced memory pressure, state-restoration issues, and shutdown races that short load tests missed. - The team added finer-grained telemetry, validated configurations against known-good baselines, ramped traffic in stages, and built the ability to isolate or disable individual paths quickly. ## Conclusion The central lesson is that voice responsiveness depends on every component in the path, not just the model. Streaming inference, a dedicated media path, asynchronous delegation, and optimized transport work together to keep conversation feeling live. The same architecture is expected to underpin the forthcoming GPT‑Live API and broader agentic voice experiences.

OpenAI2026-05-035 min readCurated summary

How OpenAI delivers low-latency voice AI at scale

# How OpenAI Delivers Low-Latency Voice AI at Scale OpenAI rearchitected the WebRTC stack behind ChatGPT voice and the Realtime API to handle three problems that collided at scale: one-port-per-session media termination doesn't fit Kubernetes, ICE and DTLS sessions require stable ownership, and global routing must keep first-hop latency low. The solution is a split design in which a stateless UDP relay forwards packets to a stateful transceiver that owns the WebRTC session, which keeps standard client behavior intact while changing how traffic is routed internally. ## Why Voice AI Needs WebRTC - WebRTC standardizes the hard parts of real-time media: ICE and NAT traversal, DTLS and SRTP encryption, codec negotiation, RTCP quality control, echo cancellation, and jitter buffering. - Building on existing browser and mobile implementations lets the team focus on connecting real-time media to models. - Audio arrives as a continuous stream, so transcription, reasoning, tool calls, and speech generation can begin while the user is still talking. ## Choosing a Media Architecture - An SFU (selective forwarding unit) suits multiparty products such as group calls, but most OpenAI sessions are 1:1, with the user talking to one model. - The team chose a transceiver model: a WebRTC edge service terminates the client connection and converts media into simpler internal protocols for inference, transcription, speech generation, and orchestration. - The transceiver is the only service that owns WebRTC state (ICE checks, DTLS handshake, SRTP keys, session lifecycle), so backend services scale like ordinary services rather than acting as WebRTC peers. ## The Deployment Problem: WebRTC Meets Kubernetes The first implementation was a single Go service built on Pion that handled both signaling (SDP, codecs, ICE credentials) and media termination. Running it on Kubernetes exposed two problems: - **Port exhaustion:** One-port-per-session requires large public UDP port ranges. Cloud load balancers aren't built for tens of thousands of UDP ports per service, large ranges widen the attack surface, and pods that must reserve stable port ranges make autoscaling brittle. - **State stickiness:** ICE and DTLS are stateful, so every packet for a session must reach the process that created it. Otherwise setup fails or media breaks. The goal was a small, fixed public UDP surface that still routes each packet to the correct owning transceiver. ## Evaluated Approaches - **Unique IP:port per session (native direct UDP):** Direct media path, but requires one public port per session and fits Kubernetes and cloud load balancers poorly. - **Unique IP:port per server:** Small public footprint with one shared socket demultiplexing sessions, but across a load-balanced fleet the first packet can land on the wrong instance, so a deterministic steering mechanism is still needed. - **TURN relay (protocol-terminating):** Centralized edge policy, but allocations add setup round trips and are hard to move or recover. - **Stateless forwarder plus stateful terminator (chosen):** Small public UDP footprint and full session ownership in the transceiver, at the cost of one extra forwarding hop and custom coordination between relay and transceiver. ## Relay and Transceiver Architecture - The relay is a lightweight UDP forwarder. It does not decrypt media, run ICE, or take part in codec negotiation. It reads just enough packet metadata to pick a destination. - Signaling still goes to the transceiver. The SDP answer returns a shared relay VIP and port (for example, `203.0.113.10:3478`), giving the client one stable destination. - **First-packet routing on ICE ufrag:** The server-generated ICE username fragment (ufrag) is already exchanged during setup and echoed in STUN binding requests. OpenAI encodes routing hints (destination cluster and owning transceiver) into it, so the relay can route the first packet without an external lookup. - After the first packet, the relay caches a client-to-transceiver flow mapping in memory, and subsequent DTLS, RTP, and RTCP packets are forwarded without re-decoding the ufrag. - If a relay restarts, the next STUN packet rebuilds the session from the ufrag. A Redis cache of the client-to-transceiver mapping allows faster recovery before that packet arrives. - Each transceiver listens on a shared UDP socket rather than one socket per session. ## Global Relay and Geo-Steered Signaling - Once the public UDP surface was reduced to a few stable addresses, the same relay pattern could be deployed globally as "Global Relay" ingress points. - Cloudflare geo and proximity steering routes the initial HTTP or WebSocket signaling request to a nearby transceiver cluster, and the SDP answer advertises a nearby Global Relay address. - Packets enter the network close to the user, which lowers latency and jitter and avoids loss bursts before traffic reaches the backbone. - Together, these shorten signaling round trips and the first ICE connectivity check, reducing how long users wait before speech can start. ## Relay Implementation and Performance - The relay is written in Go and runs in userspace, reading packet headers from sockets and forwarding without terminating WebRTC. - **SO_REUSEPORT** lets multiple relay workers bind the same UDP port, with the kernel distributing packets across them to avoid a single read-loop bottleneck. - **runtime.LockOSThread** pins each UDP-reading goroutine to an OS thread. Combined with SO_REUSEPORT, this tends to keep each flow on one CPU core, improving cache locality and reducing context switches. - **Pre-allocated buffers and minimal copying** keep allocation and garbage-collection overhead low. - Kernel-bypass frameworks were considered but rejected as unnecessary, since this design handled global real-time traffic with a relatively small relay footprint. ## Results and Takeaways - WebRTC media now runs in Kubernetes without exposing thousands of UDP ports, which is easier to secure, load balance, and scale. - Clients still speak standard WebRTC, preserving browser and mobile interoperability. - The team's main lessons: - Preserve protocol semantics at the edge. - Keep hard session state in one place (the transceiver). - Route on information already present in setup, such as the ICE ufrag, rather than adding a hot-path lookup. - Optimize the common case before reaching for kernel bypass. The broader lesson is that complexity belongs in a thin routing layer, not in every backend service or in custom client behavior.