Use the official LiveKit plugin for speech enhancement. Start with LiveKit’s voice agent quickstart and noise cancellation documentation.The ai-coustics LiveKit extras plugin provides standalone VAD and Tyto analysis, billed through ai-coustics. The official LiveKit plugin does not include these capabilities.
Packages
Both SDK packages wrap core SDK 0.26.0.
Prerequisites
- Prepare a LiveKit Cloud project. The complete examples use LiveKit Inference for speech-to-text (STT), a large language model (LLM) and text-to-speech (TTS). Get
LIVEKIT_URL,LIVEKIT_API_KEYandLIVEKIT_API_SECRETfrom your project. The LiveKit quickstart covers account setup and the agent playground. - Get an ai-coustics SDK key. Create it on the developer platform. The ai-coustics LiveKit extras plugin uses this key separately from LiveKit credentials.
- Install your runtime. Use Python 3.11 and
uv, or Node.js 24 and npm. Use a microphone and headphones for the room test. - Allow model downloads and authentication. The examples provision one dedicated VAD model before starting the worker. See authentication and SDK telemetry for network requirements.
Setup guide
1
Create the project
Run one setup from an empty working directory:Run the remaining commands from this project directory. On Windows, activate Python with
.venv\Scripts\Activate.ps1 in PowerShell.2
Configure credentials
Create Replace each placeholder. Both agents explicitly load this file. Keep it out of source control:
.env.local in the project directory:.env.local
.gitignore
3
Provision the VAD model
Download the dedicated model to The command uses the returned download path and copies the file to
models/:models/vad.aicmodel, the stable path used below. Keep the project working directory unchanged so the agent can load it. These plugins do not register models with LiveKit’s download-files command.4
Save the complete agent
Save the file for your runtime. Both agents load the model in a prewarm function, once for each job process. Each room creates its own stateful VAD.Install
vad.processor in RoomIO as shown. It runs inference and attaches the results to the original audio frame. The VAD stream of the session reads the results from that frame. If you only give vad to the session, the VAD does not receive microphone audio.5
Run and join a room
aic-vad-demo and connect with microphone access. Use a room connection for this check. Python’s console mode does not send audio through the RoomIO input path of this example. Speak, pause and speak again.Check the result
- Worker connection: the worker registers with your LiveKit project and the playground dispatches
aic-vad-demointo a room. - Python VAD activation: the log shows repeated positive
AIC VAD inference count:values while microphone audio arrives. The log shows no inference errors. - Node.js VAD activation: the log shows no VAD initialization or inference errors. The pinned
@livekit/agents1.9.0 counts speech-start events in its VAD metrics counter. Thus itsmetrics_collectedevent cannot reliably show inference during a short conversation. - Conversation: the selected STT/LLM/TTS pipeline responds. Examine provider errors separately from VAD initialization and inference errors.
- Cleanup: disconnect and start a new playground session. The new room must initialize again without VAD errors. In Python, the positive inference counts must start again. Do not use the closed frame processor from the previous room again.
Recover from a failure
Model provisioning
Model.download returns a file path. Model.from_file / Model.fromFile loads that file into memory. In production, provision models during deployment and replace the relative paths with your deployed model paths. Load models in the prewarm function (setup_fnc in Python, prewarm in Node.js). Read them in the room entrypoint from ctx.proc.userdata / ctx.proc.userData. Use separate VAD and Analyzer instances for every concurrent room.
Choose models
These are different model types. Do not load an enhancement model as a VAD or Analyzer. See the model reference for alternatives and ai-coustics VAD for parameters.
Audio-quality analysis
To add Tyto to this agent, first provision its model:prewarm function:
Analyzer and FrameProcessorChain to the existing ai_coustics.livekit import in Python or @ai-coustics/livekit-extras import in Node. Inside the room entrypoint, add this code after you construct vad and before you call session.start:
noise_cancellation=vad.processor with noise_cancellation=frame_processor in Python, or noiseCancellation: vad.processor with noiseCancellation: frameProcessor in Node. Restart the worker and join a new room. When enough audio accumulates, Tyto risk score: should appear. If RoomIO does not contain the collector of the Analyzer, the Analyzer does not receive audio.
Keep the default 5 s analysis interval. The API accepts all positive finite intervals. Before you use a shorter interval, such as 1 s, measure CPU at your expected room concurrency. If analysis falling behind its interval appears, increase the interval or decrease the load. See Tyto real-time analysis for buffering and result interpretation.
Authentication
The LiveKit extras plugin components readAIC_SDK_LICENSE by default. You can also give license_key / licenseKey explicitly, as the VAD example shows. The components do not use LiveKit Cloud authentication or metering for ai-coustics SDK usage. Keep the SDK key in the agent backend. Plugin scope describes the authentication of the official plugin.
Lifecycle
The examples ask RoomIO for mono audio at 16 kHz. The VAD processor converts incoming PCM to model blocks. It keeps the original frame unchanged for downstream processing. Models contain read-only weights. Each VAD or Analyzer instance keeps its own stream history. When you reconnect, create new stateful components. RoomIO closes its directly configured frame processor or chain when the input stream closes. The chain closes its components. Do not manually close a component while RoomIO still uses it. After an error, the original audio can continue to flow. Thus, monitor VAD inference and Analyzer result events separately from room connectivity.With
livekit-agents==1.8.2 and ai-coustics-livekit-extras==0.26.0, Python can log VAD: no inference metadata found after input stream detached during disconnect. The agents framework sends shutdown silence directly to the VAD. This silence does not go through the RoomIO frame processor. After a disconnect with error: null, check that a new room shows positive inference counts again. If metadata is missing during live audio, follow the RoomIO recovery instructions above.Adapt this example
- Tune VAD after you measure a baseline. Pass
VADParametersin Python orvadParametersin Node. SDK timing values use seconds. NodeprefixPaddingDurationandmaxBufferedSpeechuse milliseconds. - Keep existing providers. First check the framework version and package namespace of your own entrypoint. Then copy the per-session VAD and RoomIO wiring into it. Your STT/LLM/TTS providers keep their own authentication requirements.
- Add analysis without VAD. Install
analyzer.collectordirectly as the RoomIO frame processor and use your existing compatible VAD. - Evaluate and operate. Measure VAD errors, end-of-turn latency and CPU at your expected room concurrency. Follow the latency guide and stream lifecycle guide.
Existing speech enhancement users
Existing speech enhancement users
The LiveKit extras plugin does not export
Processor. If you use Processor from plugin 0.2.0, follow the migration guide. Use the official LiveKit plugin for speech enhancement. Keep any existing dedicated VAD processor before enhancement so it sees original audio. See which LiveKit plugin to use before you change packages or authentication.Next steps
After you check a conversation, evaluate audio and agent behavior, then prepare your deployment. Use troubleshooting to diagnose setup and runtime failures.Plugin scope
Choose the official plugin or the ai-coustics LiveKit extras plugin for your task.
ai-coustics VAD
Configure dedicated voice activity detection.
Tyto
Interpret audio-quality results.
LiveKit extras plugin source
Inspect the released Python and Node.js implementations.