faster-whisper

SYSTRANMIT活跃维护

基于 CTranslate2 重实现的 Whisper 语音转文字推理引擎,通过量化与高效推理大幅提速并降低显存占用,适合本地部署转录。

Faster Whisper transcription with CTranslate2

v1.2.1发布于 2025-10-31 11:34 UTC26,650star +78 / 7 天2,230fork同步于 2026-11-10 17:22 UTC

怎么上手

由 README 提炼,执行前请确认
pip install faster-whisper
硬件要求按 README 说明

CPU 可运行,README 基准用 Intel Core i7-12700K 8 线程;GPU 需 NVIDIA 显卡,基准为 RTX 3070 Ti 8GB,large-v2 fp16 约 4525MB 显存、int8 约 2926MB。GPU 需安装 CUDA 12 的 cuBLAS 与 cuDNN 9。

纯 CPU 可运行需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 CTranslate2 重写 OpenAI Whisper 的语音转写库,同精度下更快更省内存

基于 CTranslate2 重实现的 Whisper 语音转文字推理引擎,通过量化与高效推理大幅提速并降低显存占用,适合本地部署转录。

核心能力

  • 基于 CTranslate2 推理引擎重写 Whisper 模型
  • 支持 CPU 与 GPU 上的 8-bit 量化以进一步提速
  • 提供 BatchedInferencePipeline 批量转写接口
  • 集成 Silero VAD 过滤无语音片段
  • 支持词级时间戳与 distil-whisper 检查点

容易踩的坑

segments 是生成器,不迭代就不会真正开始转写;GPU 需另装 CUDA 12 的 cuBLAS 和 cuDNN 9,CUDA 11/cuDNN 8 需降级 ctranslate2 版本;用 pip 装 NVIDIA 库时须在启动 Python 前设置 LD_LIBRARY_PATH

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.2.1
  1. v1.2.1faster-whisper 1.2.1最新正式版2025-10-31 · 2025-10-31 11:34 UTC

    What's Changed

    New Contributors

    Full Changelog: https://github.com/SYSTRAN/faster-whisper/compare/v1.2.0...v1.2.1

  2. v1.2.0faster-whisper 1.2.02025-08-06 · 2025-08-06 00:32 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/SYSTRAN/faster-whisper/compare/v1.1.1...v1.2.0

  3. v1.1.1faster-whisper 1.1.12025-01-01 · 2025-01-01 14:45 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/SYSTRAN/faster-whisper/compare/v1.1.0...v1.1.1

  4. v1.1.0faster-whisper 1.1.02024-11-21 · 2024-11-21 17:19 UTC
    查看更新说明

    New Features

    • New batched inference that is 4x faster and accurate, Refer to README on usage instructions.
    • Support for the new large-v3-turbo model.
    • VAD filter is now 3x faster on CPU.
    • Feature Extraction is now 3x faster.
    • Added log_progress to WhisperModel.transcribe to print transcription progress.
    • Added multilingual option to transcription to allow transcribing multilingual audio. Note that Large models already have codeswitching capabilities, so this is mostly beneficial to medium model or smaller.
    • WhisperModel.detect_language now has the option to use VAD filter and improved language detection using language_detection_segments and language_detection_threshold.

    Bug Fixes

    • Use correct features padding for encoder input when chunk_length <30s
    • Use correct seek value in output

    Other Changes

    • replace NamedTuple with dataclass in Word, Segment, TranscriptionOptions, TranscriptionInfo, and VadOptions, this allows conversion to json without nesting. Note that _asdict() method is still available in Word and Segment classes for backward compatibility but will be removed in the next release, you can use dataclasses.asdict() instead.
    • Added new tests for development
    • Updated benchmarks in the Readme
    • use jiwer instead of evaluate in benchmarks
    • Filter out non_speech_tokens in suppressed tokens by @jordimas in https://github.com/SYSTRAN/faster-whisper/pull/898

    New Contributors

    Full Changelog: https://github.com/SYSTRAN/faster-whisper/compare/v1.0.3...v1.1.0

  5. v1.0.3faster-whisper 1.0.32024-07-01 · 2024-07-01 10:05 UTC
    查看更新说明

    Upgrade Silero-Vad model to latest V5 version (https://github.com/SYSTRAN/faster-whisper/pull/884)

    Silero-vad V5 release: https://github.com/snakers4/silero-vad/releases/tag/v5.0

    • window_size_samples parameter is fixed at 512.
    • Change to use the state variable instead of the existing h and c variables.
    • Slightly changed internal logic, now some context (part of previous chunk) is passed along with the current chunk.
    • Change the dimensions of the state variable from 64 to 128.
    • Replace ONNX file with V5 version

    Other changes

    • Improve language detection when using clip_timestamps (#867)
    • Docker file improvements (#848)
    • Fix #839 incorrect clip_timestamps being used in model (#842)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    CI PyPI version

    Faster Whisper transcription with CTranslate2

    faster-whisper is a reimplementation of OpenAI's Whisper model using CTranslate2, which is a fast inference engine for Transformer models.

    This implementation is up to 4 times faster than openai/whisper for the same accuracy while using less memory. The efficiency can be further improved with 8-bit quantization on both CPU and GPU.

    Benchmark

    Whisper

    For reference, here's the time and memory usage that are required to transcribe 13 minutes of audio using different implementations:

    Large-v2 model on GPU

    ImplementationPrecisionBeam sizeTimeVRAM Usage
    openai/whisperfp1652m23s4708MB
    whisper.cpp (Flash Attention)fp1651m05s4127MB
    transformers (SDPA)1fp1651m52s4960MB
    faster-whisperfp1651m03s4525MB
    faster-whisper (batch_size=8)fp16517s6090MB
    faster-whisperint8559s2926MB
    faster-whisper (batch_size=8)int8516s4500MB

    distil-whisper-large-v3 model on GPU

    ImplementationPrecisionBeam sizeTimeYT Commons WER
    transformers (SDPA) (batch_size=16)fp16546m12s14.801
    faster-whisper (batch_size=16)fp16525m50s13.527

    GPU Benchmarks are Executed with CUDA 12.4 on a NVIDIA RTX 3070 Ti 8GB.

    Small model on CPU

    ImplementationPrecisionBeam sizeTimeRAM Usage
    openai/whisperfp3256m58s2335MB
    whisper.cppfp3252m05s1049MB
    whisper.cpp (OpenVINO)fp3251m45s1642MB
    faster-whisperfp3252m37s2257MB
    faster-whisper (batch_size=8)fp3251m06s4230MB
    faster-whisperint851m42s1477MB
    faster-whisper (batch_size=8)int8551s3608MB

    Executed with 8 threads on an Intel Core i7-12700K.

    Requirements

    • Python 3.9 or greater

    Unlike openai-whisper, FFmpeg does not need to be installed on the system. The audio is decoded with the Python library PyAV which bundles the FFmpeg libraries in its package.

    GPU

    GPU execution requires the following NVIDIA libraries to be installed:

    Note: The latest versions of ctranslate2 only support CUDA 12 and cuDNN 9. For CUDA 11 and cuDNN 8, the current workaround is downgrading to the 3.24.0 version of ctranslate2, for CUDA 12 and cuDNN 8, downgrade to the 4.4.0 version of ctranslate2, (This can be done with pip install --force-reinstall ctranslate2==4.4.0 or specifying the version in a requirements.txt).

    There are multiple ways to install the NVIDIA libraries mentioned above. The recommended way is described in the official NVIDIA documentation, but we also suggest other installation methods below.

    Note: For all these methods below, keep in mind the above note regarding CUDA versions. Depending on your setup, you may need to install the CUDA 11 versions of libraries that correspond to the CUDA 12 libraries listed in the instructions below.

    Use Docker

    The libraries (cuBLAS, cuDNN) are installed in this official NVIDIA CUDA Docker images: nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04.

    Install with pip (Linux only)

    On Linux these libraries can be installed with pip. Note that LD_LIBRARY_PATH must be set before launching Python.

    pip install nvidia-cublas-cu12 nvidia-cudnn-cu12==9.*
    
    export LD_LIBRARY_PATH=$(python3 -c 'import os, nvidia.cublas, nvidia.cudnn; print(os.path.dirname(nvidia.cublas.__path__[0]) + "/cublas/lib:" + os.path.dirname(nvidia.cudnn.__path__[0]) + "/cudnn/lib")')
    
    Download the libraries from Purfview's repository (Windows & Linux)

    Purfview's whisper-standalone-win provides the required NVIDIA libraries for Windows & Linux in a single archive. Decompress the archive and place the libraries in a directory included in the PATH.

    Installation

    The module can be installed from PyPI:

    pip install faster-whisper
    

    Install the master branch

    pip install --force-reinstall "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/refs/heads/master.tar.gz"
    

    Install a specific commit

    pip install --force-reinstall "faster-whisper @ https://github.com/SYSTRAN/faster-whisper/archive/a4f1cc8f11433e454c3934442b5e1a4ed5e865c3.tar.gz"
    

    Usage

    Faster-whisper

    from faster_whisper import WhisperModel
    
    model_size = "large-v3"
    
    # Run on GPU with FP16
    model = WhisperModel(model_size, device="cuda", compute_type="float16")
    
    # or run on GPU with INT8
    # model = WhisperModel(model_size, device="cuda", compute_type="int8_float16")
    # or run on CPU with INT8
    # model = WhisperModel(model_size, device="cpu", compute_type="int8")
    
    segments, info = model.transcribe("audio.mp3", beam_size=5)
    
    print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
    
    for segment in segments:
        print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
    

    Warning: segments is a generator so the transcription only starts when you iterate over it. The transcription can be run to completion by gathering the segments in a list or a for loop:

    segments, _ = model.transcribe("audio.mp3")
    segments = list(segments)  # The transcription will actually run here.
    

    Batched Transcription

    The following code snippet illustrates how to run batched transcription on an example audio file. BatchedInferencePipeline.transcribe is a drop-in replacement for WhisperModel.transcribe

    from faster_whisper import WhisperModel, BatchedInferencePipeline
    
    model = WhisperModel("turbo", device="cuda", compute_type="float16")
    batched_model = BatchedInferencePipeline(model=model)
    segments, info = batched_model.transcribe("audio.mp3", batch_size=16)
    
    for segment in segments:
        print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
    

    Faster Distil-Whisper

    The Distil-Whisper checkpoints are compatible with the Faster-Whisper package. In particular, the latest distil-large-v3 checkpoint is intrinsically designed to work with the Faster-Whisper transcription algorithm. The following code snippet demonstrates how to run inference with distil-large-v3 on a specified audio file:

    from faster_whisper import WhisperModel
    
    model_size = "distil-large-v3"
    
    model = WhisperModel(model_size, device="cuda", compute_type="float16")
    segments, info = model.transcribe("audio.mp3", beam_size=5, language="en", condition_on_previous_text=False)
    
    for segment in segments:
        print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
    

    For more information about the distil-large-v3 model, refer to the original model card.

    Word-level timestamps

    segments, _ = model.transcribe("audio.mp3", word_timestamps=True)
    
    for segment in segments:
        for word in segment.words:
            print("[%.2fs -> %.2fs] %s" % (word.start, word.end, word.word))
    

    VAD filter

    The library integrates the Silero VAD model to filter out parts of the audio without speech:

    segments, _ = model.transcribe("audio.mp3", vad_filter=True)
    

    The default behavior is conservative and only removes silence longer than 2 seconds. See the available VAD parameters and default values in the source code. They can be customized with the dictionary argument vad_parameters:

    segments, _ = model.transcribe(
        "audio.mp3",
        vad_filter=True,
        vad_parameters=dict(min_silence_duration_ms=500),
    )
    

    Vad filter is enabled by default for batched transcription.

    Logging

    The library logging level can be configured like this:

    import logging
    
    logging.basicConfig()
    logging.getLogger("faster_whisper").setLevel(logging.DEBUG)
    

    Going further

    See more model and transcription options in the WhisperModel class implementation.

    Community integrations

    Here is a non exhaustive list of open-source projects using faster-whisper. Feel free to add your project to the list!

    • speaches is an OpenAI compatible server using faster-whisper. It's easily deployable with Docker, works with OpenAI SDKs/CLI, supports streaming, and live transcription.
    • WhisperX is an award-winning Python library that offers speaker diarization and accurate word-level timestamps using wav2vec2 alignment
    • whisper-ctranslate2 is a command line client based on faster-whisper and compatible with the original client from openai/whisper.
    • whisper-diarize is a speaker diarization tool that is based on faster-whisper and NVIDIA NeMo.
    • whisper-standalone-win Standalone CLI executables of faster-whisper for Windows, Linux & macOS.
    • asr-sd-pipeline provides a scalable, modular, end to end multi-speaker speech to text solution implemented using AzureML pipelines.
    • Open-Lyrics is a Python library that transcribes voice files using faster-whisper, and translates/polishes the resulting text into .lrc files in the desired language using OpenAI-GPT.
    • wscribe is a flexible transcript generation tool supporting faster-whisper, it can export word level transcript and the exported transcript then can be edited with wscribe-editor
    • aTrain is a graphical user interface implementation of faster-whisper developed at the BANDAS-Center at the University of Graz for transcription and diarization in Windows (Windows Store App) and Linux.
    • Whisper-Streaming implements real-time mode for offline Whisper-like speech-to-text models with faster-whisper as the most recommended back-end. It implements a streaming policy with self-adaptive latency based on the actual source complexity, and demonstrates the state of the art.
    • WhisperLive is a nearly-live implementation of OpenAI's Whisper which uses faster-whisper as the backend to transcribe audio in real-time.
    • Faster-Whisper-Transcriber is a simple but reliable voice transcriber that provides a user-friendly interface.
    • Open-dubbing is open dubbing is an AI dubbing system which uses machine learning models to automatically translate and synchronize audio dialogue into different languages.
    • Whisper-FastAPI whisper-fastapi is a very simple script that provides an API backend compatible with OpenAI, HomeAssistant, and Konele (Android voice typing) formats.

    Model conversion

    When loading a model from its size such as WhisperModel("large-v3"), the corresponding CTranslate2 model is automatically downloaded from the Hugging Face Hub.

    We also provide a script to convert any Whisper models compatible with the Transformers library. They could be the original OpenAI models or user fine-tuned models.

    For example the command below converts the original "large-v3" Whisper model and saves the weights in FP16:

    pip install transformers[torch]>=4.23
    
    ct2-transformers-converter --model openai/whisper-large-v3 --output_dir whisper-large-v3-ct2
    --copy_files tokenizer.json preprocessor_config.json --quantization float16
    
    • The option --model accepts a model name on the Hub or a path to a model directory.
    • If the option --copy_files tokenizer.json is not used, the tokenizer configuration is automatically downloaded when the model is loaded later.

    Models can also be converted from the code. See the conversion API.

    Load a converted model

    1. Directly load the model from a local directory:
    model = faster_whisper.WhisperModel("whisper-large-v3-ct2")
    
    1. Upload your model to the Hugging Face Hub and load it from its name:
    model = faster_whisper.WhisperModel("username/whisper-large-v3-ct2")
    

    Comparing performance against other implementations

    If you are comparing the performance against other Whisper implementations, you should make sure to run the comparison with similar settings. In particular:

    • Verify that the same transcription options are used, especially the same beam size. For example in openai/whisper, model.transcribe uses a default beam size of 1 but here we use a default beam size of 5.
    • Transcription speed is closely affected by the number of words in the transcript, so ensure that other implementations have a similar WER (Word Error Rate) to this one.
    • When running on CPU, make sure to set the same number of threads. Many frameworks will read the environment variable OMP_NUM_THREADS, which can be set when running your script:
    OMP_NUM_THREADS=4 python3 my_script.py
    

    Footnotes

    1. transformers OOM for any batch size > 1 ↩