does noise suppression works with realtime model?
# ask-ai
b
does noise suppression works with realtime model?
✅ 1
t
Thanks for reaching out, Utkarsh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking whether noise suppression works when using a realtime model. Yes — noise suppression works with the realtime model. Noise cancellation (for example Krisp/BVC options) runs in the audio input pipeline and can be enabled via
room_options.audio_input.noise_cancellation
, so it applies before audio reaches a realtime model (Google/OpenAI/etc.). If you want, tell me which SDK/language and which realtime model you’re using and I’ll show the exact config snippet. Sources: Google AI and LiveKit | LiveKit Documentation | Agents telephony integration | LiveKit Documentation | examples/voice_agents | livekit/livekit_composite | DeepWiki | SIP Telephony and Encryption, with interactive elements
b
but is it available for self hosted mode?
t
You're asking if noise suppression is available when running LiveKit in self‑hosted mode. It is not provided natively in self‑hosted deployments. LiveKit Cloud includes built‑in/enhanced noise cancellation (Krisp/BVC), but when self‑hosting you must add audio processing yourself. Options you can use in self‑hosted mode: • Integrate a third‑party noise‑suppression service or library (e.g., Krisp if you license it separately). • Apply client/SDK audio preprocessing such as WebRTC's built‑in AEC/ANS on the client. • Add custom audio input processing in your agent or server pipeline (e.g., insert a noise_cancellation module before sending audio to the model). If you tell me which SDK/language and your deployment details (Kubernetes/docker, agent vs. client-side, and which realtime model), I can suggest exact integration steps or config snippets. Sources: Understand and Improve Agent Latency | LiveKit | Agents telephony integration | LiveKit Documentation | SIP Telephony and Encryption | Why You Shouldn’t Build Real-Time Voice Agents Directly on Model APIs | Liv... | Why You Shouldn’t Build Real-Time Voice Agents Directly on Model APIs | Liv..., with interactive elements
b
i am using python sdk, i am testing it locally so using docker, i am using livekit agent and openai realtime model
t
Thanks — you're using the Python SDK, running locally in Docker with the LiveKit Agent and the OpenAI realtime model. Good context. Short answer: self‑hosted noise suppression is not enabled automatically, but you can enable it in your agent's audio input pipeline using the Python SDK by configuring
room_options.audio_input.noise_cancellation
. That runs before audio reaches the realtime model. Suggested next step (Python snippet to try): 1. In your agent code when creating/joining the room, set room options like:
Copy code
from room_io import RoomOptions, AudioInputOptions
from noise_cancellation import BVC, BVCTelephony
import rtc

room_options = RoomOptions(
    audio_input=AudioInputOptions(
        noise_cancellation=lambda params: BVCTelephony()
            if params.participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP
            else BVC()
    )
)
# pass room_options into your Room/agent start call
Notes and alternatives: • That snippet shows using built-in BVC/BVCTelephony modules if you have them available locally. If those modules are Cloud-only or unavailable in your self-hosted runtime, you must integrate a third‑party library or client-side preprocessing. • Client-side options: enable WebRTC AEC/ANS in the browser/client or run a local noise-suppression library (e.g., RNNoise, WebRTC audio processing) before sending audio to the agent. • If you want, tell me whether
noise_cancellation
modules exist in your local packages (or share the error/output you get when using the snippet) and I’ll give exact Docker/requirements changes or an alternative integration path., with interactive elements
b
i am using:
Copy code
await session.start(
        agent=agent,
        room=ctx.room,
        room_options=room_io.RoomOptions(
            audio_input=room_io.AudioInputOptions(
                noise_cancellation=dtln.noise_suppression(
                    strength=0.6,
                    debug_logging=True,
                ),
            ),
        ),
    )
t
Thanks — you’re using the Python SDK locally in Docker with LiveKit Agent + OpenAI realtime and you showed the
dtln.noise_suppression
config. Short answer: that setup is supported.
dtln.noise_suppression(...)
runs in the agent’s audio input pipeline and works with realtime models in self‑hosted/local Docker as long as the noise‑cancellation plugin is installed. What to check next: • Ensure the noise cancellation plugin is installed in your environment:
Copy code
uv add "livekit-agents[silero,turn-detector]" "livekit-plugins-noise-cancellation" python-dotenv
• Make sure your Docker image/container includes those packages (install them in your Dockerfile or requirements). • Confirm your agent logs show DTLN initializing (debug_logging=True will help). If you see errors or no effect, tell me: • the container logs around agent startup, • any traceback or plugin import error, and I’ll help you debug the exact cause. Sources: Agent session | LiveKit Documentation | Build a multilingual voice agent that automatically switches languages | Li... | Realtime models overview | LiveKit Documentation | Voice AI quickstart | LiveKit Documentation, with interactive elements
b
i am not seeing any logs related to DTLN
t
Thanks — you’re not seeing DTLN logs. Let’s troubleshoot quickly. Please check these in order and tell me any errors or log snippets you find: 1. Confirm plugin is installed inside the container: ◦ In your container shell run:
python -c "import livekit.plugins.dtln as dtln; print(dtln)"
◦ If that raises ImportError, the plugin isn’t installed in the image. 1. Ensure your Docker image installs the noise plugin (example additions): ◦ Install
livekit-plugins-noise-cancellation
(or use the uv command you ran) in your Dockerfile or requirements so the container has DTLN. 1. Enable debug logging for the agent process and Python logging: ◦ Set environment vars or logging config so DEBUG logs are emitted (you already set
debug_logging=True
in DTLN; also ensure root logger level is DEBUG). 1. Check agent startup logs for plugin init lines or import errors: ◦ Share the container logs around agent start (first 50–200 lines) if nothing obvious appears. ◦ Look for ImportError, ModuleNotFoundError, or warnings about missing dependencies. 1. Verify your code path is actually used: ◦ Add a quick runtime assert/print right before session.start:
Copy code
print("DTLN config:", dtln.noise_suppression)
• Or temporarily replace
noise_cancellation=
with a small lambda that logs to confirm the room_options branch runs. If you paste the agent startup log or the ImportError / traceback you see, I’ll pinpoint the fix (Dockerfile change, missing package, or logging config). , with interactive elements
b
i am using livekit playground for testing the changes locally but no logs for DTLN is available
t
Thanks — you’re testing in LiveKit Playground and not seeing DTLN logs. The Playground container does not include the DTLN/noise plugin by default, so you need to add it to the image and enable debug logging. Here are short, actionable steps. 1) Add the noise plugin to your Docker image • Install the noise plugin and dependencies (torch may be required). Example Dockerfile additions:
Copy code
RUN pip install livekit-agents[silero,turn-detector] livekit-plugins-noise-cancellation python-dotenv
Add any extra system packages your base image needs for torch. 2) Rebuild & run the Playground image • Rebuild your Docker image and start the container you use for local testing. 3) Enable debug logging • Ensure Python logging and the agent emit DEBUG logs. For quick testing set:
Copy code
export LOGLEVEL=DEBUG
# or configure Python logging.basicConfig(level=logging.DEBUG)
You already set
debug_logging=True
in DTLN; the container must also allow DEBUG-level output. 4) Verify import and initialization inside the container • Exec into the running container and run:
Copy code
python -c "import livekit.plugins.dtln as dtln; print('DTLN ok', dtln.noise_suppression)"
• Check agent startup logs for lines about initializing DTLN or for ImportError/ModuleNotFoundError. 5) Quick runtime check in your code • Add a warmup print before start to confirm the configured callable is present:
Copy code
print("DTLN callable:", dtln.noise_suppression)
If after this you still see no DTLN logs, please paste: • the container startup logs (first ~200 lines), and • output of the import check command above. I’ll use those to pinpoint the missing package, dependency, or logging configuration. , with interactive elements