Quiet Crab - Run Whisper Models in Rust Natively
Quiet Crab is a project to let developers run Whisper transcription models against various audio files in pure Rust.
I was working on a flashcard app but couldn't get Whisper.cpp Rust bindings to build on NixOS so it was easier to rebuilt it.
Installation
At the moment this project is not publishing a crate.
To install, add the following to your Cargo.toml
[]
= { = "0.1.0"}
# Use wgpu for GPU support, and ndarray for CPU-only
= { = "0.20.1", = ["wgpu", "ndarray"] }
Quick Start
Grab A Model And Tokenizer
Get yourself a tokenizer.json from https://huggingface.co/openai/whisper-large-v3/blob/main/tokenizer.json
Also grab a medium/small model from huggingface (large is currently unsupported):
- small: https://huggingface.co/openai/whisper-small/blob/main/model.safetensors
- medium: https://huggingface.co/openai/whisper-medium/blob/main/model.safetensors
Run A Transcription
use ;
// For CPU users
// use burn::backend::{ndarray::NdArrayDevice, NdArray};
// type Backend = NdArray<f32>;
// For GPU users
use Wgpu;
type Backend = Wgpu;
Model Support
| Model | Tested | Working |
|---|---|---|
whisper-tiny |
❌ | ❓ |
whisper-small |
✅ | ✅ |
whisper-medium |
✅ | ✅ |
whisper-large |
✅ | ❌ |