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.1

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.1
File Size Uploaded Provenance Actions
speakrs-0.8.1.tar.gz 18.2 MB With provenance Details for speakrs-0.8.1.tar.gz

Built distributions (wheels)

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

Total release size: 65.4 MB

Release files / speakrs-0.8.1.tar.gz

Download URL speakrs-0.8.1.tar.gz
Size 18.2 MB
Tags Source
SHA-256 checksum
How to use checksums
82ea0ff3082e74b83c37c51d851729988f4014d6b5adf79806176aedbd8c975c
BLAKE2b-256 checksum
How to use checksums
84c0af4e30340d2fc320a06039ef6f0ddad9b5f9308c9af4694bda62ab720884
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 24, 2026.

Transparency log

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

Download URL speakrs-0.8.1-cp311-abi3-win_amd64.whl
Size 21.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e7e441d85d7c7dcce976ddcf8a6a64c777ea3cb620609f58bde6725e6969f78e
BLAKE2b-256 checksum
How to use checksums
305a61546b4a97d4238b9942280f3f253a204b77e1ba3dcedae9fac82fcf481d
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 24, 2026.

Transparency log

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

Download URL speakrs-0.8.1-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
db01c56258dfca47efc6e56cbf23f0b1754b764c3ca065de5ac152571cc404fa
BLAKE2b-256 checksum
How to use checksums
91595c03bbb89b409a55e67d79df9312480728a66df87a36cd776a909d0202a0
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 24, 2026.

Transparency log

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

Download URL speakrs-0.8.1-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
d822cfd4c87d1402734505c298ccbd6b13f33837ce451c2118896ebe3ce4532a
BLAKE2b-256 checksum
How to use checksums
092ef7ca4a5fdd45823f551d2e97148aa052131147d3a72d7771fc749c28c834
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 24, 2026.

Transparency log

Security for speakrs 0.8.1

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.1.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 24, 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.

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