I am curious if LK open source software has any configuration that offers peer-to-peer communication when there is only one consumer of the publication, or if all streaming communication always goes through the SFU.
My understanding is that LiveKit today is fundamentally SFU-based. Clients establish PeerConnections to the LiveKit SFU for publishing and subscribing, and media is routed through the server even if there is only a single publisher and a single subscriber. The signaling path also goes through LiveKit over WebSocket. The signaling, participant discovery, room state, participant events, track metadata, and other LiveKit room APIs can still go through the LiveKit infrastructure, which is fine. My question is specifically whether the actual media path can become peer-to-peer when there is only one producer and one consumer.
There does not appear to be a built-in “hybrid P2P” mode where LiveKit automatically establishes direct peer-to-peer media between two participants when there is only one publisher and one consumer, then dynamically migrates the session back to SFU mode when a second consumer joins. In fact, there is a request from the community (P2P options for LiveKit agents · Issue #353 · livekit/agents · GitHub) specifically asking for a P2P option orchestrated by LiveKit for these one-to-one scenarios, which suggests that this is not currently supported.
So today, even in the simple 1:1 case, the producer uploads media to the SFU and the subscriber receives media from the SFU. The benefit is that if a second participant joins later, no topology change is needed because everyone is already connected through the SFU. The downside is that you still pay server egress and relay cost even for one-to-one sessions.
A hybrid architecture where 1:1 uses direct P2P and 3+ participants automatically switch to SFU is technically possible in WebRTC systems in general and is often discussed as a way to reduce infrastructure cost, but it would require custom orchestration outside of LiveKit’s current built-in behavior.