Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

LocalWhisperTranscriber

Transcribe audio files using OpenAI's Whisper model running locally on your machine.

Key Features

  • Transcribes audio to text using a locally downloaded Whisper model.
  • Supports multiple model sizes from tiny to large-v3.
  • Accepts audio files as file paths, Path objects, or ByteStream objects.
  • Returns transcriptions as Haystack Document objects.
  • Configurable device support (CPU, GPU) for inference.
  • Supports additional Whisper parameters like language, task, and temperature.

Configuration

  1. Drag the LocalWhisperTranscriber component onto the canvas from the Component Library.
  2. Click on the component to open the configuration panel.
  3. On the General tab:
    1. Set the model to the Whisper model size you want to use. Larger models are more accurate but slower. Available sizes are: tiny, tiny.en, base, base.en, small, small.en, medium, medium.en, large, large-v1, large-v2, and large-v3.
  4. Go to the Advanced tab to configure device and whisper_params for options like language and task.

Connections

LocalWhisperTranscriber receives a list of audio file sources. It outputs a list of Document objects containing the transcription text. Connect its documents output to a splitter, embedder, or other pipeline components.

Source Code

To check this component's source code, open whisper_local.py in the Haystack Core Integrations repository.

Usage Examples

Basic Configuration

  LocalWhisperTranscriber:
type: haystack_integrations.components.audio.whisper.LocalWhisperTranscriber
init_parameters:
model: large
whisper_params:
language: en

Using the Component in a Pipeline

# haystack-pipeline
components:
LocalWhisperTranscriber:
type: haystack_integrations.components.audio.whisper.LocalWhisperTranscriber
init_parameters:
model: base
whisper_params:
language: en
task: transcribe

document_splitter:
type: haystack.components.preprocessors.document_splitter.DocumentSplitter
init_parameters:
split_by: word
split_length: 250
split_overlap: 30

connections:
- sender: LocalWhisperTranscriber.documents
receiver: document_splitter.documents

max_runs_per_component: 100

metadata: {}

Parameters

Inputs

ParameterTypeDescription
sourcesList[Union[str, Path, ByteStream]]A list of audio file paths, Path objects, or ByteStream objects to transcribe.
whisper_paramsOptional[Dict[str, Any]]Additional parameters for the Whisper transcription, overriding init-time values.

Outputs

ParameterTypeDescription
documentsList[Document]The transcriptions as Haystack Documents.

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
modelstrlargeThe Whisper model size to use. Options are tiny, tiny.en, base, base.en, small, small.en, medium, medium.en, large, large-v1, large-v2, and large-v3. The .en variants are English-only models.
deviceOptional[ComponentDevice]NoneThe device to run inference on. If not set, automatically detected.
whisper_paramsOptional[Dict[str, Any]]NoneAdditional parameters passed to whisper.transcribe(). Supports language (ISO 639-1 code), task ("transcribe" or "translate"), temperature, and other Whisper options.

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
sourcesList[Union[str, Path, ByteStream]]A list of audio file paths or streams to transcribe.
whisper_paramsOptional[Dict[str, Any]]NoneAdditional parameters to override init-time values.