Skip to main content

Overview

WhisperSTTService provides offline speech recognition using OpenAI’s Whisper models running locally. Supports multiple model sizes and hardware acceleration options including CPU, CUDA, and Apple Silicon (MLX) for privacy-focused transcription without external API calls.

Whisper STT API Reference

Pipecat’s API methods for Whisper STT integration

Standard Whisper Example

Complete example with standard Whisper

Whisper Documentation

OpenAI’s Whisper research paper and model details

MLX Whisper Example

Apple Silicon optimized example

Installation

Choose your installation based on your hardware:

Standard Whisper (CPU/CUDA)

MLX Whisper (Apple Silicon)

MLX Whisper requires macOS on Apple Silicon (arm64). It will not work on other platforms, including Intel Macs.

Prerequisites

Local Model Setup

Before using Whisper STT services, you need:
  1. Model Selection: Choose appropriate Whisper model size (tiny, base, small, medium, large)
  2. Hardware Configuration: Set up CPU, CUDA, or Apple Silicon acceleration
  3. Storage Space: Ensure sufficient disk space for model downloads

Configuration Options

  • Model Size: Balance between accuracy and performance based on your hardware
  • Hardware Acceleration: Configure CUDA for NVIDIA GPUs or MLX for Apple Silicon
  • Language Support: Whisper supports 99+ languages out of the box
No API keys required - Whisper runs entirely locally for complete privacy.

Configuration

WhisperSTTService

Uses Faster Whisper for efficient local transcription on CPU or CUDA devices.
str | Model
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=WhisperSTTService.Settings(...) instead.
str
default:"auto"
Device for inference. Options: "cpu", "cuda", or "auto" (auto-detect).
str
default:"default"
Compute type for inference. Options include "default", "int8", "int8_float16", "float16", etc.
float
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=WhisperSTTService.Settings(...) instead.
Language
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=WhisperSTTService.Settings(...) instead.
WhisperSTTService.Settings
default:"None"
Runtime-configurable settings for the STT service. See WhisperSTTService Settings below.

WhisperSTTServiceMLX

Optimized for Apple Silicon using MLX Whisper. Models are loaded on demand.
str | MLXModel
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=WhisperSTTServiceMLX.Settings(...) instead.
float
default:"None"
deprecated
Probability threshold for filtering out non-speech segments. Deprecated in v0.0.105. Use settings=WhisperSTTServiceMLX.Settings(...) instead.
Language
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=WhisperSTTServiceMLX.Settings(...) instead.
float
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=WhisperSTTServiceMLX.Settings(...) instead.
WhisperSTTServiceMLX.Settings
default:"None"
Runtime-configurable settings for the MLX STT service. See WhisperSTTServiceMLX Settings below.

WhisperSTTService Settings

Runtime-configurable settings passed via the settings constructor argument using WhisperSTTService.Settings(...). These can be updated mid-conversation with STTUpdateSettingsFrame, except model, which isn’t applied at runtime: the service keeps the model it loaded at construction. See Service Settings for details.

WhisperSTTServiceMLX Settings

Runtime-configurable settings passed via the settings constructor argument using WhisperSTTServiceMLX.Settings(...). These can be updated mid-conversation with STTUpdateSettingsFrame. See Service Settings for details.

Usage

Basic Faster Whisper Setup

With CUDA Acceleration

With Custom Language

MLX Whisper on Apple Silicon

Notes

  • First run downloads: If the selected model hasn’t been downloaded previously, the first run will download it from the Hugging Face model hub. This may take significant time depending on model size.
  • Segmented transcription: Both WhisperSTTService and WhisperSTTServiceMLX extend SegmentedSTTService, meaning they process complete audio segments after VAD detects the user has stopped speaking.
  • Audio sample rate: Whisper models expect 16 kHz audio and the services don’t resample, so keep the pipeline’s input sample rate (PipelineParams.audio_in_sample_rate) at its default of 16000.
  • No-speech filtering: The no_speech_prob threshold helps filter out hallucinations. Increase it to be more permissive, decrease it to filter more aggressively.
  • MLX platform requirement: WhisperSTTServiceMLX requires macOS on Apple Silicon (arm64). On other platforms (including Intel Macs), use WhisperSTTService instead.
  • MLX quantization: The LARGE_V3_TURBO_Q4 model provides reduced memory usage with minimal quality loss on Apple Silicon.
  • Model enums: Model and MLXModel are StrEnum types, meaning enum members can be compared directly to strings (e.g., Model.TINY == "tiny"). Both enum members and plain strings work when setting the model.
  • Language support: Whisper supports 99+ languages. Use the Language enum for type-safe language selection. The default is Language.EN (English). Set language=None in settings to enable automatic language detection, which will transcribe whatever language the user speaks.
  • English-only model validation: Models with .en in their name (including the default DISTIL_MEDIUM_EN) only support English. Constructing WhisperSTTService with a language its loaded model doesn’t support raises a ValueError naming the model and its supported languages, and a later switch to such a language pushes an ErrorFrame. WhisperSTTServiceMLX doesn’t run this check, and accepts runtime language changes. Use a multilingual model (e.g., LARGE_V3_TURBO) for non-English transcription.