Skip to main content

CIPyPI - Version

Senko

閃光 (senkō) - a flash of light

A very fast and accurate speaker diarization pipeline.

1 hour of audio processed in 5 seconds (RTX 4090 + Ryzen 9 7950X).

On Apple M3, 1 hour in 7.7 seconds.

The pipeline achieves a best score of 13.5% DER on VoxConverse, 13.3% on AISHELL-4, and 26.5% on AMI-IHM. See the evaluation directory for more benchmarks and comparison with other diarization systems.

Senko powers the Zanshin media player.

Usage

import senko

diarizer = senko.Diarizer(device='auto', warmup=True, quiet=False, model_dir=None)

wav_path = 'audio.wav' # 16kHz mono 16-bit wav
result = diarizer.diarize(wav_path, generate_colors=False)

senko.save_json(result["merged_segments"], 'audio_diarized.json')
senko.save_rttm(result["merged_segments"], wav_path, 'audio_diarized.rttm')

See examples/diarize.py for an interactive script, and also read DOCS.md

Senko can also be used in a notebook, like Google Colab and Modal Notebooks.

Model Directory

Senko resolves each required source model with the following precedence:

  • Explicit model_dir= argument or script --model-dir flag
  • SENKO_MODEL_DIR
  • Bundled default model directory

If a model is missing from the configured model directory, Senko falls back to the bundled copy for that specific asset.

On macOS, Senko also stores reusable compiled CAM++ CoreML artifacts under <model_dir>/cached. That cache directory is disposable and can be deleted safely if it becomes stale or you want to reclaim disk space.

export SENKO_MODEL_DIR=/path/to/models
python examples/diarize.py --model-dir /path/to/override

Installation

The following instructions are for Linux, macOS, and WSL. For Windows, see WINDOWS.md.

Prerequisites:

  • gcc/clang - on Linux/WSL, a separate install; on macOS, have the Xcode Command Line Tools installed
  • uv

Create a Python virtual environment and activate it

uv venv --python 3.13 .venv
source .venv/bin/activate

Then install Senko

# For NVIDIA GPUs with CUDA compute capability >= 7.5 (~GTX 16 series and newer)
uv pip install "senko[nvidia]"

# For NVIDIA GPUs with CUDA compute capability < 7.5 (~GTX 10 series and older)
uv pip install "senko[nvidia-old]"

# For NVIDIA GPUs on native Windows with CUDA compute capability >= 7.5
uv pip install "senko[nvidia-windows]"

# For NVIDIA GPUs on native Windows with CUDA compute capability < 7.5
uv pip install "senko[nvidia-old-windows]"

# For Mac (macOS 14+) and CPU execution on all other platforms
uv pip install senko

For NVIDIA, make sure the installed driver is CUDA 12 capable (should see CUDA Version: 12+ in nvidia-smi). On Linux/WSL, a matching Kaldifeat CUDA wheel optionally enables GPU Fbank extraction.

PyPI alpha wheels are smoke-tested on GitHub-hosted runners, which cover packaging and CPU/default initialization but not GPU end-to-end execution.

For setting up Senko for development, see DEV_SETUP.md.

Accuracy

See the evaluation directory.

Technical Details

Senko is a heavily optimized and slightly modified version of the speaker diarization pipeline found in the excellent 3D-Speaker project. It consists of four stages: VAD (voice activity detection), Fbank feature extraction, speaker embeddings generation, and clustering (spectral or UMAP+HDBSCAN).

The following modifications have been made:

  • VAD model has been swapped from FSMN-VAD to either Senko's local pyannote backend (powered by the bundled segmentation-3.0 assets) or Silero VAD
  • Fbank feature extraction is done fully upfront with the bundled C++ extractor, or with Kaldifeat on GPU when installed.
  • Batched inference of the CAM++ embedding model
  • Clustering when on NVIDIA (with a GPU of CUDA compute capability 7.0+) can be done on the GPU through RAPIDS

On Linux/WSL, Senko's local segmentation-3.0 backend and CAM++ run using PyTorch, but on Mac, both models run through CoreML. The CAM++ CoreML conversion was done from scratch in this project (see tracing/coreml), but the segmentation-3.0 converted model and interfacing code is taken from the excellent FluidAudio project by Fluid Inference. No pyannote.audio package install is required at runtime.

Showcase

Application Description
reaper_speech_diarizer Split a downmixed voice recording into separate tracks for each speaker in REAPER DAW
scribe Produce speaker-attributed transcripts using parakeet-mlx and Senko
verbatim High quality multilingual speech to text with diarization

Create a PR or message on Discord if you'd like your application that uses Senko added here too.

FAQ

Is there any way to visualize the output diarization data?
Absolutely. The Zanshin media player is entirely made for this purpose. Zanshin is powered by Senko, so the easiest way to visualize the diarization data is by simply using it. It's currently available for Mac (Apple Silicon) with packaging. It also works on Windows and Linux, but without packaging (coming soon); you'll need to clone the repo and launch it through the terminal. See here for instructions.

You can also load in the diarization data that Senko generates manually into Zanshin if you want. First, turn off diarization in Zanshin by going into Settings and turning off Identify Speakers. Then, after you add a media item, click on it and on the player page press the H key. In the textbox that appears, paste the contents of the output JSON file that examples/diarize.py generates.
What languages does Senko support?
Generally, the pipeline should work for any language, as it relies on acoustic patterns as opposed to words or speech patterns. That being said, the embeddings model used in this pipeline was trained on a mix of English and Mandarin Chinese. So the pipeline will likely work best on English and Mandarin Chinese.
Are overlapping speaker segments detected correctly?
The current output will not have any overlapping speaker segments; i.e. only one speaker max is reported to be speaking at any given time. However, despite this, the current pipeline still performs great in determining who the dominant speaker is at any given time in chaotic audio with speakers talking over each other (example: casual podcasts). That said, detecting overlapping speaker segments is a planned feature thanks to the bundled segmentation-3.0 model (which we currently only use for VAD) supporting it.
How fast is the pipeline on CPU (cpu)?
On a Ryzen 9 9950X, it takes 42 seconds to process 1 hour of audio.
Does the entire pipeline run fully on the GPU, if available?
On Linux/WSL with device=cuda, all parts of the pipeline run on the GPU, so long as the NVIDIA card has CUDA compute capability ≥ 7.0 (~GTX 16 series and newer); otherwise clustering falls back to the CPU.

On native Windows with device=cuda, everything except fbank extraction and clustering run on the GPU.

On Mac, VAD and embeddings run on the ANE and CPU through CoreML, and fbank extraction and clustering run on the CPU.
Known limitations?
- The pipeline works best when the audio recording quality is good. Ideal setting: professional podcast studio. Heavy background noise, background music, or a generally low fidelity recording will degrade the diarization performance significantly. Note that it's also possible to have generally good recording quality but still low fidelity recorded voice quality; an example is this.

- It is rare but possible that voices that sound very similar get clustered as one voice. This can happen if the voices are genuinely extremely similar, or, more commonly, if the audio recording fidelity is low.

- The same voice recorded with >1 microphones or in >1 recording settings within the same audio file will often get detected as >1 speakers.

- If a single person makes >1 voices in the same recording (as in change the auditory texture/tone of their voice; like if they do an impression of someone else, for example), their speech will almost certainly get detected as >1 speakers.

Troubleshooting

If you run into Numba related errors after upgrading/downgrading the numba package or other packages that use it (umap-learn, pynndescent, etc.), they might be caused by failed Numba cache invalidation. In such a case, clear the cache manually like so:

rm -rf ~/.cache/senko

Such errors may also appear if you have Zanshin installed, with different package versions installed in its Python environment compared to the development venv that you're using for Senko.

If you are using a custom model directory and want to clear reusable CoreML artifacts, delete the <model_dir>/cached directory. Senko will recreate it automatically on the next run if needed.

Community & Support

Join the Discord server to ask questions, suggest features, talk about Senko and Zanshin development etc.

Future Improvements & Directions

  • Overlapping speaker segments support
  • Improve speaker colors generation algorithm
  • Support for Intel and AMD GPUs
  • Experiment with torch.compile()
  • Experiment with Modular MAX engine (faster CPU inference speed?)
  • Background noise removal (DeepFilterNet), speech enhancement
  • Live progress reporting
  • VBx-based clustering (DiariZen)

Metadata

Release files for senko 0.1.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 senko 0.1.1
File Size Uploaded
senko-0.1.1.tar.gz 81.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for senko 0.1.1
File Interpreter ABI Platform
senko-0.1.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
senko-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
senko-0.1.1-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details

Total release size: 324.2 MB

Release files / senko-0.1.1.tar.gz

Download URL senko-0.1.1.tar.gz
Size 81.0 MB
Tags Source
SHA-256 checksum
How to use checksums
34f10943188fb700e832ba0d9bb7785b15a8a5762688bc121192a92ec76ebaee
BLAKE2b-256 checksum
How to use checksums
06b789765b5ea3c54f919d4cc9325c8078e55e5fa401915f77a560599265a510
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 Oct 9, 2026.

Transparency log

Release files / senko-0.1.1-cp311-cp311-win_amd64.whl

Download URL senko-0.1.1-cp311-cp311-win_amd64.whl
Size 81.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
5cc91efcaa6115824637815017ce92dbb258673bab9b0a49f8462114da3577ba
BLAKE2b-256 checksum
How to use checksums
563d375fd71055415c23ef77a7c955373649de47414e651aaa03b3e66f31280e
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 Oct 9, 2026.

Transparency log

Release files / senko-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL senko-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 81.0 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f91a93389f6916841263255d55a38e01c47f001d1732ab3353ec80d768020f1c
BLAKE2b-256 checksum
How to use checksums
a71a63e77b8df51421f4dcb075f26c387a8be1e9569a1eeb66883005bf7bce56
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 Oct 9, 2026.

Transparency log

Release files / senko-0.1.1-cp311-cp311-macosx_14_0_arm64.whl

Download URL senko-0.1.1-cp311-cp311-macosx_14_0_arm64.whl
Size 81.0 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
447f82e8789737fa2a1db4b1457b60afbe3c69e625fd30252bf9dd325d67cd6f
BLAKE2b-256 checksum
How to use checksums
8013c4bad7bd562afbc109be7d00da57da1b79a14e77d1e173ed6337638d84a2
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 Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

4 release files

0.2.0

4 release files

This release

0.1.1 This release

4 release files

0.1.0

4 release files

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