# Source: https://docs.pipecat.ai/guides/features/krisp-viva.md

# Source: https://docs.pipecat.ai/deployment/pipecat-cloud/guides/krisp-viva.md

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Krisp VIVA Noise Cancellation

> Eliminate background noise and voices for more reliable agent interactions using Krisp's VIVA noise cancellation model

## Overview

Voice agents are vulnerable to background noise, especially other voices that trigger false interruptions. When this happens, your bot stops mid-sentence unnecessarily, creating a poor user experience. Pipecat Cloud's Krisp integration processes incoming audio to remove ambient noise and background voices before they reach your agent, resulting in cleaner audio input with fewer false interruptions and better transcription.

<Info>
  Krisp processes the audio before it reaches your agent's speech recognition
  and VAD systems, helping to ensure that only the intended user's voice
  triggers interruptions.
</Info>

## Enabling Krisp VIVA

Enabling Krisp VIVA with Pipecat Cloud involves the following steps:

### 1. Use the Pipecat Base Image

Krisp VIVA dependencies are pre-installed in the official Pipecat base image. You don't need to add any Krisp VIVA-related packages to your `requirements.txt` file or `pyproject.toml` file.

<Note>
  Krisp VIVA support is available in the `dailyco/pipecat-base` image starting
  with version `0.1.8`.
</Note>

### 2. Add the KrispVivaFilter() to Your Transport

In your bot code, import and add the `KrispVivaFilter()` to your transport:

```python  theme={null}
from pipecat.audio.filters.krisp_viva_filter import KrispVivaFilter
from pipecat.transports.daily.transport import DailyParams, DailyTransport

transport = DailyTransport(
    room_url,
    token,
    "Voice AI Bot",
    DailyParams(
        audio_in_enabled=True,
        audio_in_filter=KrispVivaFilter(),  # Add Krisp VIVA filter here
        audio_out_enabled=True,
    ),
)
```

### 3. Enable Krisp VIVA in Your Deployment

You can enable Krisp VIVA when deploying your agent through:

<Tabs>
  <Tab title="Config File">
    In your `pcc-deploy.toml`:

    ```toml  theme={null}
    agent_name = "voice-starter"
    image = "your-repo/voice-starter:0.1"
    image_credentials = "my-dockerhub-secret"
    secret_set = "voice-starter-secrets"

    [krisp_viva]
    audio_filter = "tel"

    [scaling]
    min_agents = 0
    ```
  </Tab>

  <Tab title="CLI">
    ```bash  theme={null}
    pipecat cloud deploy --krisp-viva-audio-filter tel
    ```
  </Tab>

  <Tab title="REST API">
    When creating or updating an agent via the REST API, include the `krispViva` parameter:

    ```bash  theme={null}
    curl -X POST https://api.pipecat.daily.co/v1/agents \
      -H "Authorization: Bearer YOUR_PRIVATE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "serviceName": "voice-starter",
        "image": "your-repo/voice-starter:0.1",
        "secretSet": "voice-starter-secrets",
        "krispViva": {
          "audioFilter": "tel"
        },
        "autoScaling": {
          "minAgents": 1,
          "maxAgents": 10
        }
      }'
    ```

    To update an existing agent:

    ```bash  theme={null}
    curl -X POST https://api.pipecat.daily.co/v1/agents/voice-starter \
      -H "Authorization: Bearer YOUR_PRIVATE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "krispViva": {
          "audioFilter": "tel"
        }
      }'
    ```

    See the [REST API reference](/deployment/pipecat-cloud/rest-reference/endpoint/agent-create) for more details.
  </Tab>

  <Tab title="Dashboard">
    In the Pipecat Cloud dashboard:

    1. Navigate to your agent
    2. Go to Settings > Agent Configuration
    3. Select your desired model from the dropdown
    4. Save your changes which will automatically deploy your agent with the selected model
  </Tab>
</Tabs>

Supported values are:

* `tel`: Supports up to 16kHz audio
* `pro`: Supports up to 32kHz audio

<Tip>
  By default, Pipecat processes input audio at 16kHz, making the `tel` value
  appropriate for most use cases.
</Tip>

## Testing Your Integration

To verify Krisp is working:

1. Deploy your agent with Krisp enabled
2. Connect to your agent in an environment with background noise; try turning on a TV or podcast
3. Observe whether background noises and voices affect your agent's behavior

## Pricing

Krisp processing is billed based on active session minutes:

| Usage Tier                     | Price               |
| ------------------------------ | ------------------- |
| First 10,000 minutes per month | Free                |
| Additional minutes             | \$0.0015 per minute |

<Note>
  For agents deployed with Krisp enabled, active session minutes count as Krisp
  usage, accruing towards your monthly bill.
</Note>

## Local Development

Krisp cannot be used in local development environments, as it requires a proprietary SDK and model which can only be distributed on Pipecat Cloud. When running locally be sure to not import the KrispFilter module and don't apply it to your transport.

## Troubleshooting

If you're experiencing issues with Krisp noise cancellation:

* Verify Krisp VIVA is enabled in your deployment configuration
* Confirm you've added the `KrispVivaFilter()` to your transport configuration
* Check your logs for any Krisp-related error messages
* Confirm that you have **not** added any Krisp-related dependencies to your `requirements.txt` or `pyproject.toml` files, as they are not needed and may cause conflicts.