Skip to main content
This guide provides a quickstart for integrating the ai-coustics filter (AICFilter) into your Pipecat applications.

Prerequisites

Before you start, make sure you have a valid SDK key from the developer platform.

Installation

To use AICFilter, you need to install the aic extra for pipecat-ai (not needed when using uv):

Usage

The AICFilter 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

1

Save the code

Save the code above as bot.py.
2

Set Environment Variables

Set the necessary environment variable in your terminal:
Replace the placeholder value with your actual SDK key.
3

Run the Application

Execute the script from your terminal:
Or use uv:
You can now navigate to http://localhost:7860 and click the green ‘Connect’ button in the top right corner.
The Quail models are designed to enhance the performance of Voice AI Agents and STT systems, and may not always produce the most natural-sounding audio for human listeners.It is expected that some noise and reverberation may remain in the output, as these can actually help improve STT accuracy by providing additional acoustic context.

Architecture Overview

In Pipecat, audio filters run inside the input transport. They process raw input audio before it reaches any downstream processors. The AICFilter 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

The AICFilter class inherits from Pipecat’s BaseAudioFilter. When the transport starts, it calls AICFilter.start(sample_rate), which:
  1. 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 singleton AICModelManager.
  2. Creates the processor: An async processor (ProcessorAsync) is initialized with the model, license key, and optimal configuration for the given sample rate.
  3. Initializes VAD and enhancement contexts: The processor exposes a ProcessorContext for controlling parameters (bypass, enhancement level) and a VadContext for Voice Activity Detection parameters.

Standalone Quail VAD

For voice activity detection, ai-coustics provides a standalone, noise robust Quail VAD analyzer. The AICQuailVADAnalyzer 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:
Construct it with your license key and attach it through the user aggregator with LLMUserAggregatorParams.vad_analyzer. By default it uses the quail-vad-2.0-xxs-16khz model.
The analyzer also accepts optional tuning parameters such as sensitivity (speech probability threshold, 0.01.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.