# systran/faster-whisper architecture

> Architecture diagram of the GitHub repository systran/faster-whisper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/systran/faster-whisper
- Repository: https://github.com/systran/faster-whisper

## Overview

faster-whisper is a Python Whisper transcription runtime backed by CTranslate2. An application supplies audio and configures WhisperModel, which loads a converted model, decodes and optionally filters audio, extracts log-Mel features, runs Whisper inference, and yields timestamped transcription segments. Tokenization supports multilingual transcription/translation, while optional batching and word-level alignment enrich results. The graph emphasizes runtime control flow; several internal calls are inferred from documented behavior and sampled excerpts, while unsampled implementation details are intentionally omitted.

Main entry points: [`faster_whisper/transcribe.py`](https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py) (Whisper Model), [`faster_whisper/utils.py`](https://github.com/systran/faster-whisper/blob/master/faster_whisper/utils.py) (Model Loader), [`faster_whisper/audio.py`](https://github.com/systran/faster-whisper/blob/master/faster_whisper/audio.py) (Audio Decoder), [`faster_whisper/vad.py`](https://github.com/systran/faster-whisper/blob/master/faster_whisper/vad.py) (Speech Detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_whisper_api["Whisper Model<br/>[transcribe.py]"]
  node_batch_pipeline["Batch Pipeline<br/>[transcribe.py]"]
  node_model_loader["Model Loader<br/>[utils.py]"]
end

subgraph group_audio["Audio Preparation"]
  node_audio_decoder["Audio Decoder<br/>[audio.py]"]
  node_vad["Speech Detector<br/>[vad.py]"]
  node_chunk_builder["Chunk Builder<br/>[vad.py]"]
  node_feature_extractor["Feature Extractor"]
end

subgraph group_runtime["Model Runtime"]
  node_segment_generator["Segment Generator<br/>[transcribe.py]"]
  node_tokenizer["Tokenizer<br/>[tokenizer.py]"]
end

subgraph group_results["Result Processing"]
  node_word_alignment["Word Alignment<br/>[transcribe.py]"]
  node_transcription_results["Transcription Results<br/>[transcribe.py]"]
end

node_application(("Application"))
node_audio_input["Audio Input"]
node_model_hub["Model Hub"]
node_pyav["PyAV Decoder"]
node_silero["Silero Runtime"]
node_ctranslate2["CTranslate2 Runtime"]

node_application -->|"calls"| node_whisper_api
node_audio_input -->|"supplies audio"| node_whisper_api
node_application -.->|"chooses batching"| node_batch_pipeline
node_whisper_api -->|"loads model"| node_model_loader
node_model_loader -.->|"downloads from"| node_model_hub
node_whisper_api -->|"decodes audio"| node_audio_decoder
node_audio_decoder -->|"uses"| node_pyav
node_whisper_api -->|"detects speech"| node_vad
node_vad -->|"runs model"| node_silero
node_whisper_api -->|"collects chunks"| node_chunk_builder
node_whisper_api -->|"extracts features"| node_feature_extractor
node_whisper_api -->|"generates segments"| node_segment_generator
node_segment_generator -->|"decodes tokens"| node_tokenizer
node_segment_generator -->|"runs inference"| node_ctranslate2
node_batch_pipeline -->|"runs batches"| node_ctranslate2
node_batch_pipeline -->|"adds timestamps"| node_word_alignment
node_segment_generator -->|"aligns words"| node_word_alignment
node_segment_generator -->|"yields segments"| node_transcription_results
node_word_alignment -->|"enriches segments"| node_transcription_results
node_transcription_results -->|"returns results"| node_application

click node_whisper_api "https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py"
click node_batch_pipeline "https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py"
click node_model_loader "https://github.com/systran/faster-whisper/blob/master/faster_whisper/utils.py"
click node_audio_decoder "https://github.com/systran/faster-whisper/blob/master/faster_whisper/audio.py"
click node_vad "https://github.com/systran/faster-whisper/blob/master/faster_whisper/vad.py"
click node_chunk_builder "https://github.com/systran/faster-whisper/blob/master/faster_whisper/vad.py"
click node_feature_extractor "https://github.com/systran/faster-whisper/blob/master/faster_whisper/feature_extractor.py"
click node_segment_generator "https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py"
click node_tokenizer "https://github.com/systran/faster-whisper/blob/master/faster_whisper/tokenizer.py"
click node_word_alignment "https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py"
click node_transcription_results "https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_whisper_api,node_batch_pipeline,node_model_loader toneBlue
class node_audio_decoder,node_vad,node_chunk_builder,node_feature_extractor toneAmber
class node_segment_generator,node_tokenizer toneMint
class node_word_alignment,node_transcription_results toneRose
class node_application,node_audio_input,node_model_hub,node_pyav,node_silero,node_ctranslate2 toneIndigo
```

## Components

### Public API

- [Whisper Model](https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py): `faster_whisper/transcribe.py`
- [Batch Pipeline](https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py): `faster_whisper/transcribe.py`
- [Model Loader](https://github.com/systran/faster-whisper/blob/master/faster_whisper/utils.py): `faster_whisper/utils.py`

### Audio Preparation

- [Audio Decoder](https://github.com/systran/faster-whisper/blob/master/faster_whisper/audio.py): `faster_whisper/audio.py`
- [Speech Detector](https://github.com/systran/faster-whisper/blob/master/faster_whisper/vad.py): `faster_whisper/vad.py`
- [Chunk Builder](https://github.com/systran/faster-whisper/blob/master/faster_whisper/vad.py): `faster_whisper/vad.py`
- [Feature Extractor](https://github.com/systran/faster-whisper/blob/master/faster_whisper/feature_extractor.py): `faster_whisper/feature_extractor.py`

### Model Runtime

- [Segment Generator](https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py): `faster_whisper/transcribe.py`
- [Tokenizer](https://github.com/systran/faster-whisper/blob/master/faster_whisper/tokenizer.py): `faster_whisper/tokenizer.py`

### Result Processing

- [Word Alignment](https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py): `faster_whisper/transcribe.py`
- [Transcription Results](https://github.com/systran/faster-whisper/blob/master/faster_whisper/transcribe.py): `faster_whisper/transcribe.py`

### Other components

- **Application**
- **Audio Input**
- **Model Hub**
- **PyAV Decoder**
- **Silero Runtime**
- **CTranslate2 Runtime**

## Connections

- Application → Whisper Model: calls
- Audio Input → Whisper Model: supplies audio
- Application → Batch Pipeline: chooses batching
- Whisper Model → Model Loader: loads model
- Model Loader → Model Hub: downloads from
- Whisper Model → Audio Decoder: decodes audio
- Audio Decoder → PyAV Decoder: uses
- Whisper Model → Speech Detector: detects speech
- Speech Detector → Silero Runtime: runs model
- Whisper Model → Chunk Builder: collects chunks
- Whisper Model → Feature Extractor: extracts features
- Whisper Model → Segment Generator: generates segments
- Segment Generator → Tokenizer: decodes tokens
- Segment Generator → CTranslate2 Runtime: runs inference
- Batch Pipeline → CTranslate2 Runtime: runs batches
- Batch Pipeline → Word Alignment: adds timestamps
- Segment Generator → Word Alignment: aligns words
- Segment Generator → Transcription Results: yields segments
- Word Alignment → Transcription Results: enriches segments
- Transcription Results → Application: returns results
