Packages
Native Elixir bindings for whisper.cpp. Accepts 16 kHz mono f32 PCM and runs on CPU, CUDA, ROCm (hipBLAS), Metal, Vulkan, or CoreML.
Current section
Files
Jump to
Current section
Files
native/whisper_cpp_native/Cargo.toml
[package]
name = "whisper_cpp_native"
version = "0.1.0"
edition = "2024"
rust-version = "1.91"
[lib]
name = "whisper_cpp_native"
crate-type = ["cdylib"]
[dependencies]
rustler = "0.37.4"
# `whisper-rs` is the canonical Rust binding to whisper.cpp. It vendors
# whisper.cpp under `sys/whisper.cpp/` and exposes cargo features that
# toggle the upstream CMake build flags.
whisper-rs = { version = "0.16.0", default-features = false }
parking_lot = "0.12.5"
anyhow = "1.0.102"
[features]
# Pick exactly one acceleration backend per build via WHISPER_CPP_FEATURES.
# CPU is always available (bare `mix compile`); GPU backends are mutually
# exclusive at runtime.
default = []
cuda = ["whisper-rs/cuda"]
hipblas = ["whisper-rs/hipblas"]
vulkan = ["whisper-rs/vulkan"]
metal = ["whisper-rs/metal"]
coreml = ["whisper-rs/coreml"]
intel-sycl = ["whisper-rs/intel-sycl"]
openblas = ["whisper-rs/openblas"]
openmp = ["whisper-rs/openmp"]
[lints.rust]
unsafe_code = "deny"
missing_docs = "warn"
unreachable_pub = "warn"
[lints.clippy]
pedantic = { level = "warn", priority = -1 }
module_name_repetitions = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
doc_markdown = "allow"
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1