whisper-rs
Library Featured
Rust bindings for whisper.cpp
- Downloads
- 466,717
- Dependents
- 98
- Latest release
- 0.16.0 ·
About
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 thelogbackend. Requires callingtracing_backend: allows hooking into whisper.cpp's log output and sending it to thetracingbackend.
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 don't have a way to test these platforms, so I can't really help you.
- I get a panic during binding generation build!
- You can attempt to fix it yourself, or you can set the
WHISPER_DONT_GENERATE_BINDINGSenvironment 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!
- You can attempt to fix it yourself, or you can set the
License
tl;dr: code is in the public domain
the PR template is derived from GoToSocial's PR template
Compatibility
- 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.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
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 |
|
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 |
|
transcribe-cpp New
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 daysdormancy: last activity 2026-03-12, 242 days ago, E = 560: activefeatured: 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
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- repo manifest, fetched
Adoption67 active dependents, 63 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 67 | crates.io database dump | Yes | |
| New dependents (365 days) | 63 | crates.io database dump | Yes | |
| Peak active dependents | 67.5 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceNot measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | Not measured | Yes | ||
| Latest release | 2026-03-12 | crates.io database dump | Yes | |
| First release | 2022-10-10 | crates.io database dump | Yes | |
| Latest version | 0.16.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | Not measured | Yes | ||
| Maintainer replies over 365 days | Not measured | Yes | ||
| Repository archived | Not measured | Yes | ||
| Repository gone | Not measured | Yes | ||
| Release commit or manifest in the repo | true | repo manifest | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution26 releases, 466,717 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 26 | crates.io database dump | Yes | |
| Downloads over 30 days | 466717 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
RepositoryNot measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | Not measured | Yes — one part of the repository route | ||
| GitHub forks | Not measured | Yes — one part of the repository route | ||
| Contributors with a GitHub account | Not measured | Yes — one part of the repository route | ||
| Commits on the default branch | Not measured | No | ||
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Unlicense | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | CUDA, Metal, Vulkan | crates.io database dump | No | |
| What shows each backend | 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 | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | Binds native code: piper, piper1-rs-sys, whisper, whisper-rs-sys. Build uses a native toolchain: bindgen, cmake | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 98 | crates.io database dump | No |
Corrections and review history
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.