free4chat, an open-source free group voice-chat app (1.1k stars on GitHub), was rewritten three times: Go + Pion, Elixir + Membrane, and finally an all-Cloudflare stack. The first version proved SFU media forwarding is I/O-bound, not CPU-bound, sustaining nearly a thousand users on a single 1-core, 1-GB AWS instance. The Elixir rewrite leveraged Erlang/OTP's native clustering — nodes auto-discovered via epmd and cross-node messaging transparent to code — enabling a two-node cluster where room users span nodes without Redis or etcd. The third version moved to Cloudflare RealtimeKit (built on Dyte, acquired by Cloudflare in April 2025), Turnstile, Workers KV, Durable Objects for per-room AI conversation state, AI Gateway, and Workers AI, achieving near-zero ops and being built in a single weekend via vibe coding with Claude. A key technical insight: server-side AI voice injection (STT → LLM → TTS) requires participating in DTLS handshakes as a WebRTC peer; RTK's managed SFU does not expose WHIP endpoints, a real control trade-off — though Cloudflare Realtime Agents (released August 2025) now solve audio injection at the SDK layer. The takeaway: no stack is best in absolute terms, only best-matched to the boundaries you accept.
free4chat: Three Rewrites from 1-Core/1-GB Go to Zero-Ops Cloudflare — Where WebRTC + AI Hits Its Limits
Summary
free4chat, an open-source free group voice-chat app (1.1k stars on GitHub), was rewritten three times: Go + Pion, Elixir + Membrane, and finally an all-Cloudflare stack. The first version proved SFU media forwarding is I/O-bound, not CPU-bound, sustaining nearly a thousand users on a single 1-core, 1-GB AWS instance. The Elixir rewrite leveraged Erlang/OTP's native clustering — nodes auto-discovered via epmd and cross-node messaging transparent to code — enabling a two-node cluster where room users span nodes without Redis or etcd. The third version moved to Cloudflare RealtimeKit (built on Dyte, acquired by Cloudflare in April 2025), Turnstile, Workers KV, Durable Objects for per-room AI conversation state, AI Gateway, and Workers AI, achieving near-zero ops and being built in a single weekend via vibe coding with Claude. A key technical insight: server-side AI voice injection (STT → LLM → TTS) requires participating in DTLS handshakes as a WebRTC peer; RTK's managed SFU does not expose WHIP endpoints, a real control trade-off — though Cloudflare Realtime Agents (released August 2025) now solve audio injection at the SDK layer. The takeaway: no stack is best in absolute terms, only best-matched to the boundaries you accept.
This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177620443