AICFilter) into your Pipecat applications.
Prerequisites
Before you start, make sure you have a valid SDK key from the developer platform.Installation
To useAICFilter, you need to install the aic extra for pipecat-ai (not needed when using uv):
Usage
TheAICFilter can be easily integrated into a Pipecat pipeline between an audio input transport (e.g., microphone) and an audio output transport (e.g., speaker). Here’s a complete example of a simple Pipecat application that uses the AICFilter.
Running the Example
Set Environment Variables
Set the necessary environment variable in your terminal:Replace the placeholder value with your actual SDK key.
Run the Application
Execute the script from your terminal:Or use You can now navigate to http://localhost:7860 and click the green ‘Connect’ button in the top right corner.
uv:Architecture Overview
In Pipecat, audio filters run inside the input transport. They process raw input audio before it reaches any downstream processors. TheAICFilter plugs into this mechanism via the audio_in_filter parameter on the transport.
Key Points
- AICFilter runs first. It processes the raw input audio, before anything else in the pipeline sees it.
- VAD is a separate, standalone component. The standalone Quail VAD analyzer performs its own noise robust voice activity detection and is wired into the pipeline independently of the filter.
AICFilter Integration
TheAICFilter class inherits from Pipecat’s BaseAudioFilter. When the transport starts, it calls AICFilter.start(sample_rate), which:
- Loads the model: Either from a local file (
model_path) or by downloading it from the CDN (model_id). Models are cached and shared across filter instances via a singletonAICModelManager. - Creates the processor: An async processor (
ProcessorAsync) is initialized with the model, license key, and optimal configuration for the given sample rate. - Initializes VAD and enhancement contexts: The processor exposes a
ProcessorContextfor controlling parameters (bypass, enhancement level) and aVadContextfor Voice Activity Detection parameters.
Standalone Quail VAD
For voice activity detection, ai-coustics provides a standalone, noise robust Quail VAD analyzer. TheAICQuailVADAnalyzer is an independent component that performs its own audio analysis, so it works whether or not the AICFilter is present in the pipeline.
The analyzer ships with the same aic extra as the filter:
LLMUserAggregatorParams.vad_analyzer. By default it uses the quail-vad-2.0-xxs-16khz model.
sensitivity (speech probability threshold, 0.0–1.0), speech_hold_duration, and minimum_speech_duration.
The standalone Quail VAD is a separate component from the
AICFilter. The audio filter attaches to the transport via audio_in_filter, while the VAD analyzer attaches to the user aggregator via LLMUserAggregatorParams.vad_analyzer (TransportParams.vad_analyzer was removed in Pipecat 1.0).Further Reading
AICFilter
Pipecat’s documentation on
AICFilter.Quail VAD Analyzer
Pipecat’s documentation on
AICQuailVADAnalyzer.