Skip to main content

Krisp VIVA noise reduction plugin for LiveKit Agents

Project description

Krisp VIVA Plugin for LiveKit Agents

Real-time noise reduction for LiveKit voice agents using Krisp's VIVA SDK.

Features

  • KrispVivaFilterFrameProcessor: Real-time noise reduction FrameProcessor for audio processing

Installation

# Install the plugin
pip install livekit-plugins-krisp

# Install krisp-audio SDK separately (required for actual usage)

Note: The krisp-audio package is a proprietary SDK not available on public PyPI. It must be obtained and installed separately from Krisp (https://krisp.ai/developers/).

Prerequisites

Required for All Features

  1. Krisp Audio SDK: pip install krisp-audio
  2. License Key: Obtain a license key from Krisp and set it as an environment variable:
    export KRISP_VIVA_SDK_LICENSE_KEY=your-license-key-here
    

For Noise Reduction

  1. Noise Reduction Model: Obtain a noise reduction or voice isolation .kef model file from Krisp
  2. Set environment variable:
    export KRISP_VIVA_FILTER_MODEL_PATH=/path/to/noise_model.kef
    

Quick Start

Human-to-Bot Noise Cancellation / Voice Isolation (Recommended)

For cleaning up user audio before STT/VAD processing using the FrameProcessor approach:

from livekit.agents import AgentSession, Agent, JobContext, room_io
from livekit.plugins import krisp, silero, openai

@server.rtc_session()
async def entrypoint(ctx: JobContext):
    # Create Krisp FrameProcessor
    processor = krisp.KrispVivaFilterFrameProcessor(
        noise_suppression_level=100,  # 0-100
        frame_duration_ms=10,
        sample_rate=16000,
    )
    
    session = AgentSession(
        vad=silero.VAD.load(),
        stt=openai.STT(),
        llm=openai.LLM(model="gpt-4o-mini"),
        tts=openai.TTS(),
    )
    
    # Start session with RoomIO and pass FrameProcessor directly
    await session.start(
        agent=MyAgent(),
        room=ctx.room,
        room_options=room_io.RoomOptions(
            audio_input=room_io.AudioInputOptions(
                sample_rate=16000,
                frame_size_ms=10,  # Must match Krisp frame_duration_ms
                noise_cancellation=processor,  # Pass FrameProcessor directly
            ),
        ),
    )

Audio Pipeline: Room → RoomIO (with KrispVivaFilterFrameProcessor) → VAD → STT → LLM

Configuration

KrispVivaFilterFrameProcessor Parameters

Parameter Type Default Description
model_path str env var Path to noise reduction .kef model
noise_suppression_level int 100 Noise reduction intensity (0-100)
frame_duration_ms int 10 Frame size: 10, 15, 20, 30, or 32ms
sample_rate int None Optional: pre-initialize with sample rate

Supported Sample Rates

8000, 16000, 24000, 32000, 44100, 48000 Hz

Important Notes

Frame Size Requirements

⚠️ Frames must match the configured duration exactly

  • 10ms @ 16kHz = 160 samples
  • 20ms @ 16kHz = 320 samples
  • 20ms @ 32kHz = 640 samples

The filter validates frame sizes and raises ValueError if incorrect.

Resource Management

  • Session created once (on first use or if sample_rate provided)
  • Call close() when done to free resources

Shared SDK Management

The plugin uses KrispSDKManager to manage the Krisp SDK instance:

  • Singleton Pattern: SDK initialized only once, shared across all components and sessions
  • Reference Counting: Tracks active users (filters)
  • Automatic Cleanup: SDK destroyed when last component releases its reference

Troubleshooting

"Krisp SDK initialization failed" or Licensing Errors

Make sure the license key is set:

export KRISP_VIVA_SDK_LICENSE_KEY=your-license-key-here

"Model path must be provided"

export KRISP_VIVA_FILTER_MODEL_PATH=/path/to/model.kef

"Unsupported sample rate"

Supported: 8000, 16000, 24000, 32000, 44100, 48000 Hz

"Frame size mismatch"

Ensure your audio frames match the configured frame_duration_ms.

For 20ms @ 16kHz, each frame must have exactly 320 samples.

Silent output

  • Verify model file is valid
  • Test with known noisy audio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livekit_plugins_krisp-0.1.2.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

livekit_plugins_krisp-0.1.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_krisp-0.1.2.tar.gz.

File metadata

  • Download URL: livekit_plugins_krisp-0.1.2.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for livekit_plugins_krisp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6f288285fb9ed971e8435b915672b6305ea4db7c53f9dd75976f54def8572841
MD5 9ad1b173110831ac8c68530eb405f17b
BLAKE2b-256 b994df08b1212d1fe2f91c4a58ca3c46c0f443e2ad40785ee7ddcb1b8bb9b7a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_krisp-0.1.2.tar.gz:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file livekit_plugins_krisp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_krisp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8c5058404117716c5505e39f96ddfa85bfb6a59666dac4820be8d931b87372a4
MD5 24729f6093a4bb6ce11392e340e7df5c
BLAKE2b-256 578ecf72888a9797a83249ea2c2ce3c8a859fcc1fce03c1d4b1616e90d16a863

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_krisp-0.1.2-py3-none-any.whl:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page