Skip to main content
ai-coustics provides dedicated voice activity detection (VAD) and Tyto audio-quality analysis for LiveKit Agents.
Use the official LiveKit plugin for speech enhancement. Start with LiveKit’s voice agent quickstart and noise cancellation documentation.The ai-coustics-maintained plugins provide standalone VAD and Tyto analysis, billed through ai-coustics. These capabilities are unavailable in the compared official-plugin release.
Create this VAD agent in a separate project from any existing official-plugin enhancement agent. See which LiveKit plugin to use for package scope and coexistence limits.

Packages

Both SDK packages wrap core SDK 0.24.0.
Python plugin 0.2.0 and the official livekit-plugins-ai-coustics package write to the same livekit.plugins.ai_coustics namespace. Install them in separate environments. The Node packages have distinct import paths, but their VAD metadata and component APIs are not interchangeable. Do not mix implementations in the audio chain shown here.

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). Obtain LIVEKIT_URL, LIVEKIT_API_KEY and LIVEKIT_API_SECRET from 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-maintained 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.
Self-hosted LiveKit users can use these plugins with their own LiveKit connection and separately configured STT, LLM and TTS providers. The LiveKit Inference provider configuration below is the Cloud path.

Setup guide

1

Create a separate 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 .env.local in the project directory:
.env.local
Replace each placeholder. Both agents explicitly load this file. Keep it out of source control:
.gitignore
3

Provision the VAD model

Download the dedicated model to models/:
The command uses the returned download path and copies the file to 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. Models load once per worker process; each room creates its own stateful VAD.
Install vad.processor in RoomIO as shown. It runs inference and attaches results to the original audio frame for the session’s VAD stream to read. Passing vad to the session alone does not connect it to microphone audio.
5

Run and join a room

Open your LiveKit project’s agent playground, select aic-vad-demo and connect with microphone access. Use a room connection for this check: Python’s console mode does not exercise the RoomIO input path used here. Speak, pause and speak again.

Check the result

  • Worker connection: the worker registers with your LiveKit project and the playground dispatches aic-vad-demo into a room.
  • Python VAD activation: confirm repeated positive AIC VAD inference count: values while microphone audio arrives, with no inference errors.
  • Node.js VAD activation: run the local diagnostic below to verify SDK inference through the plugin. The pinned @livekit/agents 1.9.0 counts speech-start events in its VAD metrics counter, so its metrics_collected event cannot reliably confirm inference during a short conversation. The local diagnostic does not verify microphone routing in your room.
  • Conversation: the selected STT/LLM/TTS pipeline responds. Inspect 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; Python must resume positive inference counts. Do not reuse the closed frame processor from the previous room.
This example runs dedicated VAD on unchanged audio, without enhancement. Evaluate speech boundaries and response timing on speech, silence and noise before tuning VAD.

Check Node.js VAD locally

After provisioning models/vad.aicmodel, run this Node.js diagnostic with your ai-coustics credential. It sends 1.5 s of silence through the frame processor and reads VAD events through a separate local stream. No LiveKit room is needed; the check verifies inference execution, not detection quality or room routing.
check-vad.ts
Expected output: AIC VAD diagnostic passed: 100 inference events. If construction fails, check the credential and model first. If inference fails or the deadline expires, preserve the error and check the pinned package versions. Then retry this diagnostic before debugging room dispatch or microphone permissions.

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. Reuse read-only Model objects within a worker; 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:
Add the model to the existing Python setup function or Node prewarm callback:
In Node, also add Analyzer and FrameProcessorChain to the existing @ai-coustics/livekit-plugin import. Inside the room entrypoint, after constructing vad and before session.start, add:
Replace 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. After enough audio has accumulated, Tyto risk score: should appear. An Analyzer without its collector in RoomIO receives no audio. Keep the default 5 s analysis interval. The API accepts positive finite intervals, but shorter intervals, such as 1 s, need CPU measurements at your expected room concurrency. If analysis falling behind its interval appears, increase the interval or reduce load. See Tyto real-time analysis for buffering and result interpretation.

Authentication

The ai-coustics-maintained components accept AIC_SDK_LICENSE by default, or license_key / licenseKey explicitly as shown for VAD. They do not use LiveKit Cloud authentication or metering for ai-coustics SDK usage. Keep the SDK key in the agent backend. Official-plugin authentication is described in plugin scope.

Lifecycle

The examples ask RoomIO for mono audio at 16 kHz. The VAD processor converts incoming PCM to model blocks while preserving the original frame for downstream processing. Models are read-only weights; stream history belongs to each VAD or Analyzer instance. Reconnect with 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 terminate a component while RoomIO is still using it. Errors can leave original audio flowing, so monitor VAD inference and Analyzer result events separately from room connectivity.
With livekit-agents==1.8.2 and ai-coustics-livekit-plugin==0.2.0, Python can log VAD: no inference metadata found after input stream detached during disconnect. The agents framework sends shutdown silence directly to VAD, bypassing the RoomIO frame processor. After a disconnect with error: null, verify that a new room resumes positive inference counts. If metadata is missing during live audio, follow the RoomIO recovery instructions above.

Adapt this example

  • Tune VAD after a baseline. Pass VADParameters in Python or vadParameters in Node. SDK timing values use seconds; Node prefixPaddingDuration and maxBufferedSpeech use milliseconds.
  • Keep existing providers. Copy the per-session VAD and RoomIO wiring into your own entrypoint after checking its framework version and package namespace. Your STT/LLM/TTS providers keep their own authentication requirements.
  • Add analysis without VAD. Install analyzer.collector directly 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.
Plugin 0.2.0 also exports Processor. Existing applications can continue using the API in that release. New enhancement integrations should use the official LiveKit plugin. Keep any existing dedicated VAD processor before enhancement so it sees original audio. See which LiveKit plugin to use before changing packages or authentication.

Next steps

After checking a conversation, evaluate audio and agent behavior, then prepare your deployment. Use troubleshooting to diagnose setup and runtime failures.

Plugin scope

Choose the official or ai-coustics-maintained plugin for your task.

ai-coustics VAD

Configure dedicated voice activity detection.

Tyto

Interpret audio-quality results.

Plugin source

Inspect the released Python and Node.js implementations.