DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to add fast speech-to-text to a Python script with Faster Whisper

Install Faster Whisper and transcribe audio files in a few lines, on GPU or on CPU with int8.

Short answer: Run pip install faster-whisper; then create a model with WhisperModel(model_size, device="cuda", compute_type="float16"), or use device cpu with compute_type int8 if you have no GPU; call model.transcribe("audio.mp3", beam_size=5) to get segments and info. All steps.

  • Top pick
  • Content
  • Beginner
  • 15 minutes
  • From the README
  • Claude Code
  • Codex
  • Cursor

Who it is forA developer building a meeting notes tool or voice feature who wants Whisper quality without the slowness.

The problemThe original Whisper package is slow and memory hungry, which makes it costly to run at any volume.

The outcomeA Python function that returns timestamped transcript segments and the detected language for any audio file.

What you need first

  • Python 3.9 or greater
  • No system FFmpeg needed: audio is decoded with PyAV
  • For GPU: NVIDIA cuBLAS for CUDA 12 and cuDNN 9 for CUDA 12

Steps

  1. Run pip install faster-whisper
  2. Create a model with WhisperModel(model_size, device="cuda", compute_type="float16"), or use device cpu with compute_type int8 if you have no GPU
  3. Call model.transcribe("audio.mp3", beam_size=5) to get segments and info
  4. Iterate over the segments to print start, end and text; segments is a generator, so transcription only runs when you loop over it
  5. Read info.language and info.language_probability to see which language was detected

Prompt for your agent

Add SYSTRAN/faster-whisper to my Python project and write a function transcribe(path) that loads the <model size> model on <cuda or cpu with int8>, transcribes the file with beam_size=5 and returns a list of (start, end, text) plus the detected language. Test it on <audio file>.

Caveat. GPU use needs matching CUDA 12 and cuDNN 9 libraries; older CUDA setups need an older ctranslate2 version as the README explains.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for SYSTRAN/faster-whisper and "Add fast speech-to-text to a Python script"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer