█

AI/TLDR

Buy me a coffee
Buy me a coffee

SpeechBrain

A PyTorch toolkit that covers the whole conversational-AI speech stack

Audio, Music & VoiceOpen source
Language
Python
License
Apache-2.0
$pip install speechbrain
IN SHORT

What is SpeechBrain?

SpeechBrain is an open-source PyTorch toolkit for conversational AI — the speech and text technologies behind assistants, chatbots and voice interfaces. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed Apache-2.0. To get started: install from PyPI.

Overview

SpeechBrain is an open-source PyTorch toolkit for conversational AI — the speech and text technologies behind assistants, chatbots and voice interfaces. Rather than specialising in one task, it is deliberately holistic: speech recognition, speaker recognition, speech enhancement, speech separation, language modelling and dialogue all live in the same codebase with a consistent structure, so pipelines that combine several of them are built from one set of parts.

The toolkit's centre of gravity is its recipes. The repository ships over 200 competitive training recipes across more than 40 datasets and 20 speech and text tasks, each one a Python training script plus a YAML file holding the hyperparameters. Training from scratch and fine-tuning are both first-class: pretrained backbones such as Whisper, wav2vec 2.0, WavLM and HuBERT can be plugged in and fine-tuned, and training logs and checkpoints for the official recipes are published for replication.

For inference you do not have to train anything. Over 100 pretrained models are hosted on Hugging Face under the SpeechBrain organisation, each with a small interface class — transcribing a file with a pretrained ASR model is three lines of Python. That combination of ready models and open recipes is why the project is widely used as both a research baseline and a teaching tool, and its scope has since widened beyond audio to include EEG through the companion benchmarks repository.

It is documentation-heavy by design: more than 30 tutorials sit alongside an API reference, and classes and functions carry runnable examples. The project is Apache-2.0 licensed and developed in the open, with the default branch being `develop`.

What it does

  • One toolkit across speech recognition, speaker recognition, enhancement, separation, language modelling and dialogue
  • 200+ training recipes over 40+ datasets and 20 speech and text tasks, each a train.py plus a YAML hyperparameter file
  • Fine-tuning support for pretrained backbones including Whisper, wav2vec 2.0, WavLM, HuBERT, GPT-2 and Llama-family models
  • 100+ pretrained models on Hugging Face with simple inference interfaces — transcription in three lines of Python
  • A consistent code structure across tasks, so components can be recombined into multi-stage pipelines
  • 30+ tutorials plus API documentation with runnable examples, and published logs/checkpoints for replicability

Getting started

Install from PyPI for inference and ordinary use, or from a clone in editable mode if you intend to modify the toolkit or run its recipes.

Install from PyPI

Then import the package in your code.

bashbash
pip install speechbrain

Or install from a clone (for experiments)

Recommended if you want to change the toolkit; the --editable flag means your edits take effect immediately.

bashbash
git clone https://github.com/speechbrain/speechbrain.git
cd speechbrain
pip install -r requirements.txt
pip install --editable .

Transcribe a file with a pretrained model

Pretrained models are pulled from the SpeechBrain organisation on Hugging Face and cached locally.

pythonpython
from speechbrain.inference import EncoderDecoderASR

asr_model = EncoderDecoderASR.from_hparams(
    source="speechbrain/asr-conformer-transformerlm-librispeech",
    savedir="pretrained_models/asr-transformer-transformerlm-librispeech",
)
asr_model.transcribe_file("speechbrain/asr-conformer-transformerlm-librispeech/example.wav")

Train with a recipe

Pick the dataset and task under recipes/, then run its script against the YAML hyperparameters. Results land in the output_folder set in the YAML.

bashbash
cd recipes/<dataset>/<task>/
python experiment.py params.yaml

Verify the installation

The test suite and doctests confirm the environment is sound.

bashbash
pytest tests
pytest --doctest-modules speechbrain

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Reach for it when you need a research baseline you can reproduce — a published recipe, logs and checkpoints for the task you are comparing against
  • Fine-tune a pretrained backbone such as Whisper or WavLM on your own audio without writing the training loop
  • Build a multi-stage speech pipeline (enhancement, separation, then recognition) out of components that share one structure
  • Use it as a teaching toolkit: the tutorials and runnable examples are aimed at people learning speech processing

How SpeechBrain compares

SpeechBrain alongside other open-source audio, music & voice tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
VoiceStudio★ 121kA local-first desktop voice studio that clones and designs voices, dubs video, and handles dictation, running 16 text-to-speech and 11 speech-recognition engines on your own hardware.
Whisper★ 114kOpenAI's speech recognition model that transcribes and translates audio across many languages.
GPT-SoVITS★ 64.3kAn open-source WebUI that clones a voice from a short audio sample and turns text into speech, with zero-shot and few-shot fine-tuning.
Voicebox★ 61.6kLocal-first voice studio that clones a voice from a short sample, generates speech across seven TTS engines and 23 languages, handles system-wide dictation, and speaks for agents over MCP.
VibeVoice★ 57.6kMicrosoft's text-to-speech model for generating long, expressive multi-speaker audio like podcasts.
whisper.cpp★ 55.7kA dependency-free C/C++ port of Whisper built on ggml, running speech recognition on CPU, Metal, CUDA, Vulkan and NPUs from phones to servers.
Coqui TTS★ 46.3kA library of text-to-speech models including the multilingual XTTS voice-cloning model.
SpeechBrain★ 12kA PyTorch toolkit that covers the whole conversational-AI speech stack