Noice cancellation for self-hosted server
# ask-ai
l
Noice cancellation for self-hosted server
t
Thanks for reaching out, Rajadurai. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m glad you asked about noise cancellation for a self‑hosted LiveKit server. I’ll walk through what you can and can’t do, recommended models, and the key configuration points. If you want, tell me whether you’re using WebRTC clients, SIP/telephony, or both so I can give exact code for your setup. Summary — what works on self‑hosted • You can run enhanced noise cancellation locally on the agent (agent CPU) using LiveKit’s agent-side models. • Use
BVC()
for WebRTC participants and
BVCTelephony()
for SIP/telephony participants for best results. • These models run locally and add minimal latency (<10 ms) but will increase CPU usage on the agent server. What to avoid on self‑hosted • Remove any enhanced noise cancellation plugin that depends on LiveKit Cloud (for example Krisp-based/cloud-only features). Some noise cancellation capabilities are Cloud-only and are not available when self-hosting. • Also disable any other noise suppression (e.g.,
krisp_enabled
) to avoid double-processing audio. How to enable noise cancellation (high level) 1. Use the agent-side noise cancellation plugins from
livekit-plugins-noise-cancellation
. 2. Configure noise cancellation in
room_options
when starting your
AgentSession
. Example pattern:
Copy code
await session.start(
    room=ctx.room,
    agent=Assistant(),
    room_options=room_io.RoomOptions(
        audio_input=room_io.AudioInputOptions(
            noise_cancellation=lambda params: noise_cancellation.BVCTelephony()
            if params.participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP
            else noise_cancellation.BVC(),
        ),
    ),
)
Notes and tradeoffs • CPU: Expect higher CPU usage on the agent host when noise cancellation is enabled. • Latency: Noise cancellation adds minimal latency (<10ms). • Avoid enabling other suppression layers on clients or the agent to prevent degraded audio from double processing. Next steps / Helpful questions • Do you need a concrete code example for your language (Python, Node, Go)? • Are you handling SIP trunks or only WebRTC participants? • Do you want guidance on sizing agent servers for CPU load with noise cancellation enabled? Tell me which of the above you'd like next and I’ll provide a tailored configuration or code snippet. Sources: Choosing the right noise cancellation for your agent | LiveKit | Voice AI quickstart | LiveKit Documentation