whisper-rs

Library Featured

Rust bindings for whisper.cpp

Checked · Sources

Downloads
466,717
Dependents
98
Latest release
0.16.0 ·

About

From the project README ·

Rust bindings to whisper.cpp

Usage

git clone --recursive https://codeberg.org/tazz4843/whisper-rs.git

cd whisper-rs

cargo run --example basic_use

cargo run --example audio_transcription
Read the full README
use whisper_rs::{WhisperContext, WhisperContextParameters, FullParams, SamplingStrategy};

fn main() {
    let path_to_model = std::env::args().nth(1).unwrap();

    // load a context and model
    let ctx = WhisperContext::new_with_params(
        path_to_model,
        WhisperContextParameters::default()
    ).expect("failed to load model");

    // create a params object
    let params = FullParams::new(SamplingStrategy::BeamSearch {
        beam_size: 5,
        patience: -1.0,
    });

    // assume we have a buffer of audio data
    // here we'll make a fake one, floating point samples, 32 bit, 16KHz, mono
    let audio_data = vec![0_f32; 16000 * 2];

    // now we can run the model
    let mut state = ctx.create_state().expect("failed to create state");
    state
        .full(params, &audio_data[..])
        .expect("failed to run model");

    // fetch the results
    for segment in state.as_iter() {
        println!(
            "[{} - {}]: {}",
            // note start and end timestamps are in centiseconds
            // (10s of milliseconds)
            segment.start_timestamp(),
            segment.end_timestamp(),
            // the Display impl for WhisperSegment will replace invalid UTF-8 with the Unicode replacement character
            segment
        );
    }
}

See examples/basic_use.rs for more details.

Lower level bindings are exposed if needed, but the above should be enough for most use cases. See the docs: https://docs.rs/whisper-rs/ for more details.

Feature flags

All disabled by default unless otherwise specified.

  • raw-api: expose whisper-rs-sys without having to pull it in as a dependency. NOTE: enabling this no longer guarantees semver compliance, as whisper-rs-sys may be upgraded to a breaking version in a patch release of whisper-rs.
  • cuda: enable CUDA support. Implicitly enables hidden GPU flag at runtime.
  • hipblas: enable ROCm/hipBLAS support. Only available on linux. Implicitly enables hidden GPU flag at runtime.
  • openblas: enable OpenBLAS support.
  • metal: enable Metal support. Implicitly enables hidden GPU flag at runtime.
  • vulkan: enable Vulkan support. Implicitly enables hidden GPU flag at runtime.
  • log_backend: allows hooking into whisper.cpp's log output and sending it to the log backend. Requires calling
  • tracing_backend: allows hooking into whisper.cpp's log output and sending it to the tracing backend.

Building

See BUILDING.md for instructions for building whisper-rs on Windows and OSX M1. Linux builds should just work out of the box.

Troubleshooting

  • Something other than Windows/macOS/Linux isn't working!
    • I don't have a way to test these platforms, so I can't really help you.
      • If you can get it working, please open a PR with any changes to make it work and build instructions in BUILDING.md!
  • I get a panic during binding generation build!
    • You can attempt to fix it yourself, or you can set the WHISPER_DONT_GENERATE_BINDINGS environment variable. This skips attempting to build the bindings whatsoever and copies the existing ones. They may be out of date, but it's better than nothing.
      • WHISPER_DONT_GENERATE_BINDINGS=1 cargo build
    • If you can fix the issue, please open a PR!

License

Unlicense

tl;dr: code is in the public domain

the PR template is derived from GoToSocial's PR template

Runs on
CUDA, Metal, Vulkan
What shows it
  • CUDA: whisper-rs feature cuda, whisper-rs-sys feature cuda
  • Metal: whisper-rs feature metal, whisper-rs-sys feature metal
  • Vulkan: whisper-rs feature vulkan, whisper-rs-sys feature vulkan
Native code
Required
  • Binds native code: piper, piper1-rs-sys, whisper, whisper-rs-sys
  • Build uses a native toolchain: bindgen, cmake
Python bindings
No Python binding crate found
License
Unlicense

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

whisper-rs beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
whisper-rs This page Featured

Rust bindings for whisper.cpp

466,717 downloads over 30 days 98 Not measured 0.16.0 CUDA, Metal, Vulkan Binds native code: piper, piper1-rs-sys, whisper, whisper-rs-sys. Build uses a native toolchain: bindgen, cmake Unlicense
sherpa-onnx Featured

Safe Rust wrapper for sherpa-onnx speech recognition toolkit

259,599 downloads over 30 days 28 15,834 2.0.1 GPU support unknown Binds native code: sherpa-onnx, sherpa-onnx-sys Apache-2.0
webrtc-vad Listed Dormant

Rust interface for the WebRTC Voice-Activity-Detction Module

60,022 downloads over 30 days 7 31 0.4.0 GPU support unknown Build uses a native toolchain: cc MIT
mel_spec Listed

Mel spectrograms aligned to the results from the whisper.cpp, pytorch and librosa reference implementations and suited to streaming audio.

26,437 downloads over 30 days 6 91 0.5.0 CUDA, WebGPU Binds native code: ort-sys (feature ort-tensor). Build uses a native toolchain: cc MIT
scribble Listed

High-level Rust API for audio transcription using Whisper

457 downloads over 30 days 0 105 0.5.4 CUDA, Metal, Vulkan Binds native code: whisper-rs-sys MIT

Rust bindings for transcribe.cpp, a C/C++ speech-to-text library built on ggml

50,251 downloads over 30 days 3 2,149 0.4.1 CUDA, Metal, ROCm, Vulkan Binds native code: transcribe, transcribe-cpp-sys, transcribe_cpp. Build uses a native toolchain: cmake MIT
voxr New

Audio and speech on boostr: compressed-audio decode, resampling, DSP and grapheme to phoneme, with speech synthesis (Kokoro, VITS), voice cloning (VoxCPM2), transcription with word timings (Whisper), voice activity (Silero) and audio-text scoring (CLAP), on CPU or CUDA.

642 downloads over 30 days 2 2 0.9.1 CUDA No native code found Apache-2.0
Why FeaturedIt passes every Featured gate.

What it meets

  • It has 67 active dependents and 63 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days.
  • Active dependents are at 100% of their peak. Featured needs at least 50%.
  • Docs are present. The release commit or a manifest ties the crate to the repository.
  • No vulnerability advisory stays unpatched past the grace window. At least one version is neither a prerelease nor 0.0.x.
  • The last activity is on 12 Mar 2026, 242 days ago. The rules expect an update within 560 days. Dormancy rule

Check notes

  • repo host codeberg.org has no facts source: repository signals unknown
  • the repo manifest Cargo.toml declares the crate, and no release commit proves the link

Exact rules: Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 0.16.0 base 140, doubled for 466717 downloads per month, doubled for 67 active users: E = 560 days
  • dormancy: last activity 2026-03-12, 242 days ago, E = 560: active
  • featured: featured: active_users 67, new_adopters 63, former_glory 1
Crates4 crates

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources4 sources
Adoption67 active dependents, 63 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents67crates.io database dumpYes
New dependents (365 days)63crates.io database dumpYes
Peak active dependents67.5crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceNot measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commitNot measuredYes
Latest release2026-03-12crates.io database dumpYes
First release2022-10-10crates.io database dumpYes
Latest version0.16.0crates.io database dumpYes
Days the oldest outside issue waits for a replyNot measuredYes
Maintainer replies over 365 daysNot measuredYes
Repository archivedNot measuredYes
Repository goneNot measuredYes
Release commit or manifest in the repotruerepo manifestYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution26 releases, 466,717 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases26crates.io database dumpYes
Downloads over 30 days466717crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
RepositoryNot measured
Repository measurements
SignalValueSourceFetchedCounts
GitHub starsNot measuredYes — one part of the repository route
GitHub forksNot measuredYes — one part of the repository route
Contributors with a GitHub accountNot measuredYes — one part of the repository route
Commits on the default branchNot measuredNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseUnlicensecrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesCUDA, Metal, Vulkancrates.io database dumpNo
What shows each backendCUDA: whisper-rs feature cuda, whisper-rs-sys feature cuda; Metal: whisper-rs feature metal, whisper-rs-sys feature metal; Vulkan: whisper-rs feature vulkan, whisper-rs-sys feature vulkancrates.io database dumpNo
Native code, from listed crates and their dependenciesBinds native code: piper, piper1-rs-sys, whisper, whisper-rs-sys. Build uses a native toolchain: bindgen, cmakecrates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly98crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.