Speaker diarization answers the question “who spoke when?” — given an audio clip with multiple speakers, it returns time-stamped segments labelled with a stable speaker ID (SPEAKER_00, SPEAKER_01, …). LocalAI exposes this through the /v1/audio/diarization endpoint, modelled after /v1/audio/transcriptions. Because diarization is exposed as a regular OpenAI-compatible endpoint, any HTTP client works, and there is no Python dependency on pyannote or NeMo on the consumer side. This is not a flat transcript: the default reply carries no transcription at all, only who spoke and when.
Install a diarization model
First install a diarization-capable model from the gallery. The docs’ example uses vibevoice-cpp-asr, which serves the vibevoice.cpp backend and returns speaker-labelled segments (and, optionally, a transcript):
local-ai run vibevoice-cpp-asr
Five backends are supported today: sherpa-onnx — pyannote-3.0 segmentation plus a speaker-embedding extractor plus fast clustering, pure diarization with no transcription cost, recommended when you only need speaker turns; vibevoice.cpp — produces speaker-labelled segments as a by-product of its long-form ASR pass, so you can optionally get a transcript per segment for free; NeMo-Speech.cpp — NVIDIA Sortformer, served standalone, end to end, so the speaker capacity is fixed by the checkpoint and the count hints are ignored; audio.cpp — the sortformer_diar family; and parakeet.cpp — NVIDIA Nemotron-3-Diarization (Sortformer, up to 8 speakers), served standalone or paired with a Parakeet ASR model for per-segment text.
Send the recording to the diarization endpoint
Send the file as a multipart upload with the model name:
curl http://localhost:8080/v1/audio/diarization \
-H "Content-Type: multipart/form-data" \
-F file="@meeting.wav" \
-F model="vibevoice-cpp-asr" \
-F num_speakers=3
The request fields are: file (required, audio in any format ffmpeg accepts), model (required, name of the diarization-capable model), num_speakers (exact speaker count when known; above 0 forces it, 0 means auto), min_speakers and max_speakers (hints when auto-detecting), clustering_threshold (cosine distance threshold used when num_speakers is unknown), min_duration_on (discard segments shorter than this many seconds), min_duration_off (merge gaps shorter than this many seconds), language (only meaningful for backends that bundle ASR), include_text (when the backend can emit per-segment transcript for free, populate it), include_sounds (add the closed sound events of the clip as sounds; default false), and response_format (json by default, verbose_json, or rttm).
Read the speaker segments
The default json reply is a compact payload with no transcription and no per-speaker summary. The docs’ example reply has a duration of 12.34 seconds and 2 speakers:
{
"task": "diarize",
"duration": 12.34,
"num_speakers": 2,
"segments": [
{"id": 0, "speaker": "SPEAKER_00", "label": "0", "start": 0.00, "end": 2.34},
{"id": 1, "speaker": "SPEAKER_01", "label": "1", "start": 2.34, "end": 4.10}
]
}
speaker is the normalized, zero-padded label clients should display. label preserves the raw backend-emitted ID for clients that maintain their own speaker dictionary. The verbose_json reply adds per-speaker totals and, when the backend supports it and include_text=true, the per-segment transcript: in the docs’ example, SPEAKER_00 has total_speech_duration 5.6 and segment_count 3, while SPEAKER_01 has 1.76 and 1. With response_format=rttm you get NIST RTTM, the standard interchange format used by pyannote.metrics / dscore, returned as Content-Type: text/plain; charset=utf-8:
SPEAKER audio 1 0.000 2.340 <NA> <NA> SPEAKER_00 <NA> <NA>
SPEAKER audio 1 2.340 1.760 <NA> <NA> SPEAKER_01 <NA> <NA>
Try it: four checks from recording to speaker segments
| Check | What you should see | If you do not see it |
|---|---|---|
| Model installed | vibevoice-cpp-asr installed with local-ai run vibevoice-cpp-asr |
Check the gallery install finished and LocalAI is running |
| Request sent | A reply from /v1/audio/diarization with no error |
Check the file path after @, the model name, and that LocalAI is running on localhost:8080 |
| Speakers counted | Segments labelled SPEAKER_00, SPEAKER_01, each with start and end times; the docs’ example reply has duration 12.34, 2 speakers, SPEAKER_00 0.00–2.34 and SPEAKER_01 2.34–4.10 |
If the count is wrong, pass num_speakers with the exact count you know, or min_speakers and max_speakers as hints |
| RTTM format | With response_format=rttm, plain-text lines starting SPEAKER audio 1 0.000 2.340 <NA> <NA> SPEAKER_00 <NA> <NA> |
Check response_format is spelled rttm and the request used the same file and model |
Expected result. We checked the LocalAI speaker diarization docs page, which gives diarization as the answer to “who spoke when?” with time-stamped segments labelled SPEAKER_00, SPEAKER_01, and the rest, the /v1/audio/diarization endpoint modelled after /v1/audio/transcriptions, any HTTP client working with no Python dependency on pyannote or NeMo on the consumer side, the five backends sherpa-onnx, vibevoice.cpp, NeMo-Speech.cpp, audio.cpp, and parakeet.cpp with sherpa-onnx recommended when you only need speaker turns and parakeet.cpp supporting up to 8 speakers, the quick start local-ai run vibevoice-cpp-asr with the curl command for meeting.wav, model vibevoice-cpp-asr, and num_speakers=3, the request fields file, model, num_speakers, min_speakers, max_speakers, clustering_threshold, min_duration_on, min_duration_off, language, include_text, include_sounds with default false, and response_format json, verbose_json, or rttm, the json example reply with duration 12.34, num_speakers 2, SPEAKER_00 0.00–2.34 and SPEAKER_01 2.34–4.10, speaker as the normalized zero-padded display label and label as the raw backend ID, the verbose_json per-speaker totals SPEAKER_00 5.6 seconds across 3 segments and SPEAKER_01 1.76 seconds across 1 segment, and the rttm format as NIST RTTM used by pyannote.metrics / dscore with the two example lines and Content-Type text/plain; charset=utf-8. We did not install LocalAI, download any model, or diarize any recording on this machine.
Limits
This guide covers LocalAI’s own diarization endpoint only. It is not the Whisper plus pyannote pipeline: no separate transcription step and no Python code are involved, and the default reply has no transcript text — add include_text=true with a backend that can emit it (vibevoice.cpp or parakeet.cpp) if you want words on each segment. The labels are SPEAKER_00, SPEAKER_01, and so on: the reply does not tell you the speakers’ names. Naming a speaker needs registered voices through /v1/voice/register with a parakeet-cpp model that has a speaker_model, which is a separate setup. With NeMo-Speech.cpp’s Sortformer the speaker capacity is fixed by the checkpoint, so the count hints are ignored. For a flat transcript with no speakers, use /v1/audio/transcriptions instead. We did not run any of this ourselves.
