Softcatala/whisper-ctranslate2

Whisper command line client compatible with original OpenAI client based on CTranslate2.

What it is

whisper‑ctranslate2 is a drop‑in replacement for the official OpenAI Whisper command‑line tool, but it runs on the CTranslate2 inference engine (the same engine used by the faster‑whisper project). By leveraging CTranslate2’s optimized CPU/GPU kernels and optional quantisation, the tool can transcribe or translate audio up to 4 × faster than the original Whisper (and up to 16 × faster when using batched inference), while keeping the same accuracy.

Core capabilities

  • Transcription & translation – identical CLI syntax to OpenAI’s Whisper (whisper-ctranslate2 file.mp3 --model medium), with the extra --task translate flag that outputs English translations.
  • Speed tricks – batched decoding (--batched True + --batch_size) and model quantisation (--compute_type int8 etc.) give extra speed‑ups.
  • Hardware flexibility – runs on CPU (x86‑64 or ARM64) with MKL/oneDNN/OpenBLAS/Ruy/Apple Accelerate back‑ends, or on NVIDIA GPUs via cuBLAS/cuDNN. The best device is chosen automatically, but you can force a device with --device.
  • Live microphone mode – --live_transcribe True streams audio from the mic and prints results in real time.
  • Speaker diarisation – optional integration with pyannote.audio to label which speaker is talking (segment‑level only).
  • Voice‑activity detection – a Silero VAD filter (--vad_filter True) removes silent parts before decoding, improving both speed and output quality.
  • Colour‑coded confidence – words are printed in different colours to visualise model confidence, mirroring the behaviour of whisper.cpp.
  • Docker image – pre‑built container (ghcr.io/softcatala/whisper-ctranslate2) ships the small/medium/large‑v2 models ready‑to‑run, with optional GPU support.

How to get it

  • Python package – pip install whisper-ctranslate2 installs the CLI and all required dependencies.
  • Docker – pull the image, mount a local folder, and run the command inside the container. GPU access is added with --gpus "device=0".

Typical workflow

# Simple transcription (CPU or GPU, whichever is available)
whisper-ctranslate2 myaudio.mp3 --model medium

# Faster batch mode with int8 quantisation on CPU
whisper-ctranslate2 myaudio.mp3 --model medium \
    --batched True --batch_size 4 --compute_type int8

# Live mic transcription in English
whisper-ctranslate2 --live_transcribe True --language en

# Add speaker labels (requires a HuggingFace token)
whisper-ctranslate2 myaudio.mp3 --hf_token $HF_TOKEN

Who might use it

  • Researchers or developers who need Whisper‑level quality but are limited by compute time or memory.
  • Media production pipelines that batch‑process many audio files and want to squeeze extra speed from a single GPU.
  • Accessibility tools that require real‑time transcription from a microphone.
  • Anyone already comfortable with the OpenAI Whisper CLI and looking for a faster, drop‑in alternative.

Contact: Jordi Mas (jmas@softcatala.org) – for questions, bug reports, or feature requests.

Related

  • Project
  • Project
  • Project
  • Project
  • Project