> For the complete documentation index, see [llms.txt](https://docs.cloud.deepset.ai/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`](https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/whisper/src/haystack_integrations/components/audio/whisper/whisper_local.py) in the [Haystack Core Integrations repository](https://github.com/deepset-ai/haystack-core-integrations).

## Usage Examples

### Basic Configuration

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

### Using the Component in a Pipeline

```yaml
# 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

| Parameter | Type | Description |
| --- | --- | --- |
| `sources` | List[Union[str, Path, ByteStream]] | A list of audio file paths, `Path` objects, or `ByteStream` objects to transcribe. |
| `whisper_params` | Optional[Dict[str, Any]] | Additional parameters for the Whisper transcription, overriding init-time values. |

### Outputs

| Parameter | Type | Description |
| --- | --- | --- |
| `documents` | List[Document] | The transcriptions as Haystack Documents. |

### Init Parameters

These are the parameters you can configure in Pipeline Builder:

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `model` | str | `large` | The 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. |
| `device` | Optional[ComponentDevice] | None | The device to run inference on. If not set, automatically detected. |
| `whisper_params` | Optional[Dict[str, Any]] | None | Additional 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](https://docs.cloud.deepset.ai/docs/set-runtime-parameters-to-override-pipeline-configuration.md).

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `sources` | List[Union[str, Path, ByteStream]] |  | A list of audio file paths or streams to transcribe. |
| `whisper_params` | Optional[Dict[str, Any]] | None | Additional parameters to override init-time values. |

## Related Information

-   [Pipeline Components](https://docs.cloud.deepset.ai/docs/pipeline-components.md)
