How to Install and Use Faster-Whisper on Ubuntu 26.04 and 24.04 (Offline Speech-to-Text)

Share

Install Faster-Whisper in a uv project on Ubuntu 26.04 or 24.04, download a Whisper model once, then run a Python script to create a transcript and SRT subtitles offline.

Faster-Whisper is a Python library for transcribing saved recordings. You need internet access to install the packages and fetch the model. After that, the audio and generated files can stay on your computer.

Before you begin
  1. Ubuntu and Python. Use a 64-bit Intel, AMD or ARM machine. Ubuntu 26.04 uses Python 3.14 and Ubuntu 24.04 uses Python 3.12.
  2. A regular user account. Create the uv project in your home directory. Only optional Ubuntu packages require sudo.
  3. A recording and free disk space. Start with a short WAV or MP3. Allow at least 1 GB for the CPU project and base model, plus room for recordings.

Step 1. Install Faster-Whisper with uv

Use the uv installation guide if uv --version fails. Create a new folder so uv can give the project its own .venv and lockfile.

Create the project
Ubuntu terminal
cd "$HOME"
uv init --bare --python /usr/bin/python3 faster-whisper-local
cd faster-whisper-local
uv venv --python /usr/bin/python3
uv add faster-whisper "av<19"
uv run --no-sync python -c 'import sys, av; print(sys.version.split()[0], av.__version__)'

Expect Python 3.14 on Ubuntu 26.04 or 3.12 on Ubuntu 24.04, followed by PyAV 18.x. Faster-Whisper 1.2.1 passes an argument that PyAV 19 removed. PyAV 18.1.1 publishes Linux wheels for both Python versions.

Copy a recording named meeting.wav into the project, or generate the sample below. PyAV ships the FFmpeg libraries it needs to decode audio. Ubuntu’s separate ffmpeg package is useful if you want the conversion command.

Optional test recording

Choose a different filename if you already have a meeting.wav you want to keep.

Ubuntu terminal
sudo apt update
sudo apt install -y espeak-ng
espeak-ng -w meeting.wav 'The meeting starts at nine. Please bring the project notes.'

Step 2. Download the model while online

Cache the base model
Ubuntu terminal
uv run --no-sync python -c 'from faster_whisper import download_model; print(download_model("base"))'

The command downloads Systran/faster-whisper-base and prints the local snapshot path. The default cache is ~/.cache/huggingface/hub/. Use the same user account for the offline run.

base is a lightweight multilingual starting point. Try small if you need better results on your recordings. On a stronger machine, turbo and large-v3-turbo both select mobiuslabsgmbh/faster-whisper-large-v3-turbo for fast transcription. For task="translate" into English, use multilingual small, medium or large-v3. distil-large-v3 is an English transcription option.

Step 3. Transcribe offline and write subtitles

Save this as transcribe.py
transcribe.py
from argparse import ArgumentParser
from pathlib import Path

from faster_whisper import WhisperModel
from faster_whisper.utils import format_timestamp


def main():
    parser = ArgumentParser(description="Transcribe a local recording offline.")
    parser.add_argument("audio", type=Path)
    parser.add_argument("--model", default="base", help="Cached model name or local model folder")
    parser.add_argument("--device", choices=("cpu", "cuda"), default="cpu")
    parser.add_argument("--compute-type", default=None)
    parser.add_argument("--beam-size", type=int, default=5)
    parser.add_argument("--output-dir", type=Path, default=Path("transcripts"))
    args = parser.parse_args()

    if not args.audio.is_file():
        parser.error(f"Local audio file not found: {args.audio}")
    if args.beam_size < 1:
        parser.error("--beam-size must be at least 1")

    text_path = args.output_dir / (args.audio.stem + ".txt")
    srt_path = args.output_dir / (args.audio.stem + ".srt")
    if text_path.exists() or srt_path.exists():
        parser.error("Output exists. Choose a new --output-dir.")

    compute_type = args.compute_type or ("int8" if args.device == "cpu" else "float16")
    model = WhisperModel(
        args.model, device=args.device, compute_type=compute_type, local_files_only=True
    )
    segments, _ = model.transcribe(str(args.audio), vad_filter=True, beam_size=args.beam_size)

    lines = []
    cues = []
    for segment in segments:
        text = segment.text.strip()
        if not text:
            continue
        start = format_timestamp(segment.start, always_include_hours=True, decimal_marker=",")
        end = format_timestamp(segment.end, always_include_hours=True, decimal_marker=",")
        lines.append(text)
        cues.append(f"{len(cues) + 1}\n{start} --> {end}\n{text}\n\n")

    args.output_dir.mkdir(parents=True, exist_ok=True)
    with text_path.open("x", encoding="utf-8") as transcript:
        transcript.writelines(line + "\n" for line in lines)
    with srt_path.open("x", encoding="utf-8") as subtitles:
        subtitles.writelines(cues)
    print(f"Wrote {len(cues)} subtitle cues to {srt_path} and text to {text_path}.")


if __name__ == "__main__":
    main()

The script defaults to CPU int8. Silero voice activity detection (vad_filter=True) helps suppress false text during silence. model.transcribe() returns a lazy segment generator, so transcription runs as the loop iterates over segments.

Run without network access
Ubuntu terminal
HF_HUB_OFFLINE=1 uv run --offline --no-sync python transcribe.py meeting.wav

Expect transcripts/meeting.txt and transcripts/meeting.srt. Disconnect from the network and repeat with --output-dir offline-transcripts to verify the offline workflow. The script refuses to overwrite an existing output file.

A SubRip cue uses hours, minutes, seconds and a comma before milliseconds. Here’s an example.

1
00:00:00,000 --> 00:00:02,100
The meeting starts at nine.

local_files_only=True loads the model from disk. HF_HUB_OFFLINE=1 disables Hub HTTP requests, and the uv flags use the environment you already installed. To use an explicit folder, pass --model /path/to/model with a complete CTranslate2 snapshot, including tokenizer.json. If you copy the snapshot from the Hub cache, copy the files its symlinks point to as well.

Step 4. Use NVIDIA CUDA or check AMD ROCm support

Use the NVIDIA steps on x86-64 with a working driver. Check that nvidia-smi sees your GPU first. The CUDA and ROCm guide covers driver and toolkit setup.

Load cuBLAS 12 and run on NVIDIA
Ubuntu terminal
uv add nvidia-cublas-cu12
export LD_LIBRARY_PATH="$(uv run --no-sync python -c 'import nvidia.cublas.lib; print(nvidia.cublas.lib.__path__[0])')${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
HF_HUB_OFFLINE=1 uv run --offline --no-sync python transcribe.py meeting.wav --device cuda --compute-type float16 --output-dir gpu-transcripts

The x86-64 PyPI CTranslate2 4.9.1 wheel looks for libcublas.so.12 and includes RTX 50-series Blackwell targets. Even with CUDA 13 installed, the wheel needs the CUDA 12 cuBLAS library. The export prepends the wheel’s library directory for this terminal session. It uses __path__[0] because a namespace package can have no usable __file__.

Try --compute-type int8_float16 if your GPU supports it and VRAM is tight. For batch throughput, Faster-Whisper also exposes BatchedInferencePipeline. Larger batches need more memory.

AMD GPU. Use CPU int8 with the standard PyPI wheel. For GPU inference, OpenNMT ships a separate rocm-python-wheels-Linux.zip archive. Match the Python wheel and ROCm requirements to your GPU and Ubuntu kernel. CTranslate2 uses device="cuda" for its ROCm build too. The regular PyPI ARM64 wheel is CPU-only.

Step 5. Summarize the transcript or use the optional CLI

If you have a local model in Ollama, use ollama list to find its name. Replace gemma4 with a downloaded model from that list.

Make a local meeting summary
Ubuntu terminal
{ printf 'Summarize this transcript. List explicit decisions and action items.\n\n'
  cat transcripts/meeting.txt
} | ollama run gemma4

Check names and decisions against the recording before sharing the summary. Use llama.cpp for another local setup, or add the plain-text transcripts to AnythingLLM to search across recordings.

Optional terminal command
Ubuntu terminal
sudo apt update
sudo apt install -y libportaudio2
uv tool install whisper-ctranslate2
whisper-ctranslate2 --help

Softcatalà’s tool uses sounddevice, which needs the PortAudio shared library. uv installs it in a separate environment. If the command is missing from your shell, run uv tool update-shell and open a new terminal.

Troubleshoot Faster-Whisper

TypeError: open() got an unexpected keyword argument 'metadata_errors'

Faster-Whisper 1.2.1 passes metadata_errors to PyAV, which removed that argument in version 19. Return to the project and add the compatibility constraint.

Ubuntu terminal
uv add "av<19"
Missing libcublas.so.12

Install nvidia-cublas-cu12 in the project and repeat the library-path export in your current terminal. The driver still has to see the GPU. nvidia-smi checks the driver, while a transcription checks that the runtime can load.

Missing libcudnn_ops.so.9 on an older or custom build

The standard CTranslate2 4.9.1 Linux x86-64 wheel is built with cuDNN disabled. If your installed build reports this error and expects cuDNN 9 for CUDA 12, add the matching runtime alongside cuBLAS and retry from this terminal.

Ubuntu terminal
uv add "nvidia-cudnn-cu12==9.*"
export LD_LIBRARY_PATH="$(uv run --no-sync python -c 'import nvidia.cublas.lib, nvidia.cudnn.lib; print(nvidia.cublas.lib.__path__[0] + ":" + nvidia.cudnn.lib.__path__[0])')${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
Offline model missing

Reconnect and cache the exact model you pass to --model. Use the same user and cache path during the offline run, or pass the path to a complete local model folder.

High memory use or slow transcription

Cache and switch to a smaller model first. On the CPU, use int8. Try --beam-size 1 to reduce decoding work and check the resulting transcript. On supported GPUs, int8_float16 can reduce VRAM use.

Words appear during silence

Keep vad_filter=True and listen to the flagged section. VAD helps skip silence, but background noise and long pauses can still produce incorrect text.

Update or remove the project

Update the locked project online
Ubuntu terminal
uv lock --upgrade
uv sync

Rerun the sample after updating. Keep av<19 while using Faster-Whisper 1.2.1. Remove the constraint after confirming that your Faster-Whisper release supports PyAV 19.

To remove the project, save any audio, script and transcripts you want to keep. Then remove ~/faster-whisper-local in your file manager. That removes its virtual environment. Model files live in the shared Hugging Face cache. The command below targets the base model and prompts before deletion. Run it from the project directory before removing it.

Remove the cached base model
uv run --no-sync hf cache rm model/Systran/faster-whisper-base

If you installed the optional CLI, remove it with uv tool uninstall whisper-ctranslate2.

Frequently asked questions

Do I need a GPU to run Faster-Whisper on Ubuntu?

A supported CPU can run the base model in int8 mode. A GPU can speed up larger models and longer recordings.

Does Faster-Whisper upload my recordings?

The workflow reads local audio and writes local output. Install the packages and cache the model online first, then run the transcription offline.

Can the script identify different speakers?

The script produces time-stamped subtitles and plain text. Speaker labels require a separate speaker diarization step.

Helpful Resources

r/LocalLLaMA ↗Community discussions about local speech-to-text.
SYSTRAN Faster-Whisper ↗Documentation and project support.