Optimizing RTC bandwidth estimation with machine learning
Meta replaced parts of its hand-tuned, GCC-based bandwidth estimation for real-time calls with ML models that classify network conditions and predict congestion, then apply configs tuned offline in simulation and delivered from the server at call setup. A combined model feeds time-series network signals through an LSTM and derived metrics through a dense layer, concatenates the two, and classifies random versus congestion packet loss. When loss is random, BWE holds bitrate, ramps up faster and adds FEC. A congestion predictor trained on production logs, labeled with RTT-spike criteria over 4-second past and future windows, fires before delay and loss spikes. A/B tests showed lower connection drops and video freezes and higher video quality, and the team plans to merge the models into one multi-task model.
Related posts
- FastRTC: The Real-Time Communication Library for Python
Hugging Face mediumAdeptFastRTC is a Python library for building real-time audio and video AI applications over WebRTC or WebSockets without needing WebRTC expertise. A `Stream` wrapped around a `ReplyOnPause` handler provides built-in voice activity detection and turn taking, auto-generates a Gradio test UI, and can be mounted onto any FastAPI app for production. Bundled speech-to-text (Moonshine) and text-to-speech (Kokoro) models, optimized for CPU inference, let a few lines of code chain STT, an LLM and TTS into a voice chat. `fastphone()` exposes the stream through a free phone number with a Hugging Face token.
- One-second voice-to-voice latency with Modal, Pipecat, and open models
Modal mediumAdept
A conversational voice bot on Modal reaches roughly one-second voice-to-voice latency. It uses Pipecat to orchestrate an STT → RAG → LLM → TTS pipeline with Parakeet-tdt-v3, Qwen3-4B-Instruct on vLLM, Kokoro TTS, and ChromaDB with all-MiniLM-L6-v2 retrieval. The main latency levers are running the stateful Pipecat bot on CPU while GPU services autoscale independently, using Pipecat's local VAD and SmartTurn to segment audio instead of streaming STT, and tuning vLLM for time-to-first-token. On the network side, the bot talks to services over WebSockets through Modal Tunnels that bypass the input plane, with a spawned FunctionCall session restoring autoscaling, and services are pinned to clustered regions near the user. Latency was measured by recording real conversations and diarizing them with Pyannote across region and tunnel configurations.
- How we built a realtime system for responsive voice AI in six months
OpenAI mediumAdept
GPT-Live replaces turn-detector-based voice AI with a full-duplex voice model that listens and speaks simultaneously, delegating deeper reasoning and tool use to frontier models like GPT-5.5 over an asynchronous RPC path that never blocks media. The system separates a Go-based media fast path (replacing Python asyncio, with new p95 matching old p50) from application logic. It uses warm model-instance handoffs to perform context compaction without KV-cache rebuild pauses, prefills frontier-model sessions at call start, and derives discrete turns from overlapping speech via speculative and authoritative transcript views. Startup is cut to a single UDP packet through WARP, a set of backward-compatible WebRTC changes that reduces handshakes from six round trips to one, plus Instant Connect for pre-negotiated SDP. Shadow testing on production traffic showed that capacity depends on concurrent sessions and CPU-side stream handling, not just GPU throughput.
- Reinforcement learning is an infrastructure problem
Modal mediumAdept
RL post-training of LLMs is bottlenecked by infrastructure rather than algorithms: training engines, rollout inference and isolated environments must all scale together, and once training goes multi-node, trainer-to-rollout weight sync dominates. Measured estimates show RDMA cutting weight transfer roughly 60x versus TCP (e.g. GLM 4.7 from 115 s to 1.8 s per step), and delta compression shrinking WAN transfers for disaggregated setups by about 98%. Teams commonly struggle with glue code, cluster queueing and GPUs starved by environments; the guidance is to keep at least one sandbox per rollout plus headroom for failures. Modal recommends building on open-source frameworks like slime and verl, upstreams improvements such as delta compression, and introduces Modal Dojo, an experimental library for defining RL jobs in under 100 lines.
- How OpenAI delivers low-latency voice AI at scale
OpenAI hardMaster
OpenAI rearchitected its WebRTC stack for ChatGPT voice and the Realtime API by splitting a stateless UDP relay from a stateful Go/Pion transceiver that owns ICE, DTLS and SRTP state. The design avoids one-public-port-per-session media termination, which fits poorly with Kubernetes and cloud load balancers. Server-generated ICE ufrags encode routing hints, so the relay can steer the first STUN packet to the owning transceiver without an external lookup. Relay flows are kept in memory with Redis as a backup, and Cloudflare geo-steered signaling plus a globally distributed relay fleet shorten the first hop and cut setup latency.