---
title: "Offline speech recognition in Python"
description: "Transcribe audio in Python without a cloud API: fermion (Phonon), openai-whisper, faster-whisper, Vosk and Moonshine compared, with install and run commands."
canonical: "https://www.fermionresearch.com/speech/offline-speech-recognition-python/"
source: "Fermion Research"
---

Speech recognition/facts checked 13 November 2026

# Offline speech recognition in Python

Every library here downloads a model once and then transcribes on your own machine. They differ in model accuracy, languages, size and what they need installed besides pip.

[Speech quickstart](https://www.fermionresearch.com/docs/quickstart/)

## The short answer

To transcribe audio offline in Python, pip-install a library that runs an open model locally: fermion for the Phonon models (pip install fermion-research), openai-whisper or faster-whisper for Whisper, Vosk for small per-language models, or Moonshine for streaming on small devices. Each downloads its model on first use and then runs without a cloud service.

For English, Phonon-2.5 English averages 4.82 % word error on the seven Open ASR Leaderboard English sets from a 158 MB model; for 25 European languages, Phonon-2.5 is 156 MB. Whisper covers 99 languages from 75 MiB (tiny) to about 3 GB (large).

## Python libraries compared

Install commands and requirements from each project's own documentation, read 2026-11-13.

| Library | Install | Models | Languages | Also needs |
| --- | --- | --- | --- | --- |
| fermion | pip install fermion-research | Phonon-2.5, Phonon-2.5 English, Phonon-2 (156 to 164 MB) | 25 European, or English | Python 3.10 to 3.14; MLX stack on Apple silicon, torch (CPU) on Linux and Windows |
| openai-whisper | pip install -U openai-whisper | Whisper tiny to large, turbo | 99 | ffmpeg |
| faster-whisper | pip install faster-whisper | Whisper on CTranslate2 | 99 | Python 3.9+; no ffmpeg (PyAV); cuBLAS and cuDNN for GPU |
| Vosk | pip3 install vosk | about 50 MB per language | 20+ | a downloaded language model |
| Moonshine | pip install moonshine-voice | streaming models from about 1 MB | 10 for speech-to-text | nothing listed |
| mlx-whisper | pip install mlx-whisper | Whisper on MLX | 99 | Apple silicon, ffmpeg |

## Transcribe a file with fermion

The command line prints the transcript to standard output; --json adds word timestamps. transcribe reads wav, flac, ogg and aiff; for mp3 and m4a it prints the ffmpeg command to convert first.

```text
pip install fermion-research
fermion transcribe phonon-2.5 meeting.wav
fermion transcribe phonon-2.5-en call.wav
fermion transcribe phonon-2.5 clip.flac --json

# On Linux, install the CPU build of torch first to skip the larger GPU build
pip install --no-deps torch --index-url https://download.pytorch.org/whl/cpu
pip install fermion-research
```

## From Python code

The Python API loads a speech model once and transcribes files or arrays; this example is from the documentation and uses Phonon-2 with hotwords:

```text
import fermion

speech = fermion.load_speech("phonon-2")
text, decode_s, audio_s = speech.transcribe("call.wav", hotwords=["Ada", "Quillon", "Okonkwo"])
print(text)
```

## Running on a machine with no internet

The model downloads once into the Hugging Face cache (move it with HF_HOME or FERMION_CACHE_DIR). For a machine with no network at all, fetch the model on a connected machine with the transcribe command's --download-only flag, which fetches and verifies the model, prints its directory and stops; copy that directory across and pass it as the model argument, since every speech command accepts a local model directory.

To serve other programs on the same machine, fermion serve exposes POST /v1/audio/transcriptions on localhost.

```text
fermion transcribe /path/to/model-directory meeting.wav
fermion serve phonon-2.5
```

## Questions

## Related

- [Speech recognition docs](https://www.fermionresearch.com/docs/speech/)
- [CLI reference](https://www.fermionresearch.com/docs/cli-reference/)
- [Self-host a speech-to-text server](https://www.fermionresearch.com/models/phonon-2-5/self-host/)
- [Best speech-to-text for Apple silicon](https://www.fermionresearch.com/speech/best-speech-to-text-for-apple-silicon/)
- [Whisper alternatives](https://www.fermionresearch.com/speech/whisper-alternatives/)

## Sources and method

- fermion commands, requirements, cache and local-directory behaviour: /docs/quickstart/, /docs/speech/ and /docs/cli-reference/ (fermion-research package documentation), read 2026-11-13.
- openai-whisper: github.com/openai/whisper; faster-whisper: github.com/SYSTRAN/faster-whisper; mlx-whisper: github.com/ml-explore/mlx-examples; Vosk: alphacephei.com/vosk; Moonshine: github.com/moonshine-ai/moonshine; read 2026-11-13.
- Phonon English averages: Fermion Research measurement with the Open ASR Leaderboard's scoring code on the full seven test sets (Phonon-2.5 release post, 2026-10-22).
- Rival English averages: Open ASR Leaderboard, seven English sets (LibriSpeech clean and other, AMI, Earnings-22, GigaSpeech, SPGISpeech, VoxPopuli), snapshot 2026-09-25.

Canonical: https://www.fermionresearch.com/speech/offline-speech-recognition-python/

Source: [https://www.fermionresearch.com/speech/offline-speech-recognition-python/](https://www.fermionresearch.com/speech/offline-speech-recognition-python/)
