Skip to main content

speakrs

speakrs does speaker diarization with pyannote-level accuracy. Inference runs in Rust on the CPU, on Apple CoreML, or on NVIDIA CUDA, with no PyTorch or ONNX Runtime.

pip install speakrs
Platform Modes
macOS arm64 CPU, CoreML, CoreMLFast
Linux x86_64 (glibc 2.28+) CPU, CUDA, CUDAFast
Windows x86_64 CPU, CUDA, CUDAFast

The package needs Python 3.11 or newer. One wheel covers every Python version.

Use

import speakrs

pipeline = speakrs.Pipeline.from_pretrained("cpu")  # downloads the models once
result = pipeline.diarize_file("meeting.wav")

for segment in result.segments:
    print(f"{segment.start:7.2f} {segment.end:7.2f} {segment.speaker}")

print(result.rttm())

To diarize many files, use the batch method. It decodes files ahead of inference and overlaps clustering with the next file:

results = pipeline.diarize_files(["a.wav", "b.flac", "c.mp3"])

Audio that is already in memory has to be 16 kHz mono float32. A NumPy array is read in place, without a copy:

result = pipeline.diarize_samples(samples, file_id="call-42")

The command line prints RTTM:

speakrs diarize meeting.wav --mode coreml

To install only the command line, in its own environment, use uv:

uv tool install speakrs

See API.md for the full API: the queue, async methods, configuration, progress events, cancellation, and error categories.

Example: a transcript with speakers

examples/transcribe.py combines speakrs with faster-whisper to write a transcript that says who said what. It runs diarization and transcription at the same time and gives each word to the speaker talking at that moment. uv can run it straight from GitHub:

uv run https://raw.githubusercontent.com/avencera/speakrs/master/crates/speakrs-python/examples/transcribe.py meeting.mp3
[06:31] Speaker 2: Crocodile?

[06:34] Speaker 5: Yeah, it can be a crocodile. It can be a crocodile. Firstly, it was an attempt at a T-rex, and then it sort of changed into a pelican, but it can be a crocodile.

[06:59] Speaker 1: That's lovely.

speakrs diarizes a 17-minute meeting in 0.6 seconds on an RTX 5090 and in under 5 seconds on an M4 Pro in CoreML mode, so whisper takes almost all of the time. The script picks CoreML on macOS and CUDA on Linux when it finds an NVIDIA GPU, falling back to the CPU when that GPU is older than Turing; --mode overrides that, and --whisper-model turbo gives a better transcript.

CUDA

The Linux and Windows wheels include the CUDA backend. It needs an NVIDIA driver and a Turing (RTX 20, T4) or newer GPU, but no CUDA toolkit. On a machine without a GPU, the wheel still imports and runs on the CPU. The Windows wheel passes CI but hasn't run on a GPU yet.

speakrs runs its own kernels for every layer. cuDNN 9 and cuBLAS are only a fallback for a layer that has no kernel for your GPU. If you want that fallback, install it with:

pip install "speakrs[cuda]"

The extra installs the nvidia-cudnn-cu12 and nvidia-cublas-cu12 wheels, which speakrs loads from site-packages on Linux and Windows. Leave it out if cuDNN 9 and cuBLAS 12 are already on the library path (on Windows, an absolute PATH entry or %CUDA_PATH%\bin).

Models

prepare() and from_pretrained() download the models from the avencera/speakrs-models Hugging Face repository. They go into the Hugging Face hub cache, which is set by SPEAKRS_CACHE_DIR, HF_HUB_CACHE or HF_HOME. A token in HF_TOKEN, or saved by hf auth login, is sent with downloads.

To skip the download, pass model_dir= to use a local directory instead.

Metadata

Release files for speakrs 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for speakrs 0.8.0
File Size Uploaded Provenance Actions
speakrs-0.8.0.tar.gz 18.2 MB With provenance Details for speakrs-0.8.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for speakrs 0.8.0
File Interpreter ABI Platform Actions
speakrs-0.8.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for speakrs-0.8.0-cp311-abi3-win_amd64.whl
speakrs-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for speakrs-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl
speakrs-0.8.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for speakrs-0.8.0-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 65.4 MB

Release files / speakrs-0.8.0.tar.gz

Download URL speakrs-0.8.0.tar.gz
Size 18.2 MB
Tags Source
SHA-256 checksum
How to use checksums
76f8d879b3add74a70516f50e73f76c2d1ea13ab799b1ae71d5a3f687766f9d5
BLAKE2b-256 checksum
How to use checksums
10bd2bede1e3dff2dd90d7655c7b742839623e61a9d8c37239e849596af67361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / speakrs-0.8.0-cp311-abi3-win_amd64.whl

Download URL speakrs-0.8.0-cp311-abi3-win_amd64.whl
Size 21.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d2257bd545cc62eb533050ff1a8b699e6cc0b01548a7d11135872bfe90f226ec
BLAKE2b-256 checksum
How to use checksums
39b542cc49412ba089acef3a3fccea89c609595596129d05f345c9723c632b46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / speakrs-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL speakrs-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 22.1 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
8fb6e8336e77d63d0571214c216a47366a3e7098396b4fa115c3fe979b5f60ba
BLAKE2b-256 checksum
How to use checksums
a70b7b830efe88a3c0337e0a1069d565b63afb90ea9abc238ac592b561eac119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / speakrs-0.8.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL speakrs-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
Size 3.5 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9352b6bacb5419b7eccdc31f25de8209824b99ff42efb5db80021e360acc3217
BLAKE2b-256 checksum
How to use checksums
cdb88dfdac5eaa3abb7d1c404e6535930ee783532c2e7c50b2bf96cdcd531549
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for speakrs 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for speakrs-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.0 This release

4 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page