feat(parakeet-cpp): name speakers from the shared voice registry - #12382
Merged
Merged
Conversation
The voice registry could register, identify and forget but not list, and it did not remember which speaker encoder produced an embedding. Add Metadata.Model and Registry.List, answered from the index the store registry already keeps for Forget. Needed so a backend can be given the registered voices that match its own speaker encoder. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
… messages Assisted-by: Claude:claude-haiku-4-5 [Claude Code]
When a diarization model has a speaker_model option, the endpoint sends the registered voices made by that encoder to the backend. The backend's name and name_score come back as extra fields next to the normalized SPEAKER_NN speaker, and the speakers summary carries the first name seen for each speaker. RTTM output and results without names are unchanged. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
…ker names Live sessions now send the registered voices that match the model's speaker_model to the backend, and each speaker segment carries the name the backend matched. The realtime segment event gains an optional speaker_name field. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
…registries Adds the speaker bindings (ABI v9 and v10, probed separately), the speaker_model, speaker_threshold and speaker_margin options, and a per-request registry builder over the known voices. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
Diarize builds a per-request speaker registry from the known voices when a speaker model is loaded, calls the named C functions, and puts each slot's registered name and score on the segments. The registry is freed on every path. A library without ABI 10 reports Unimplemented instead of dropping the names. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
The live scene stream now begins with a known-voice registry when a speaker model is loaded and the live config carries voices, and each closed speaker segment takes its slot's current name from the feed's names map. A segment that closes before its slot is identified has an empty name. The registry is freed after the stream, on every path. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
Add three gallery entries that load the WeSpeaker ResNet34 speaker model next to the diarization or realtime scene models, and document speaker names in the voice recognition, diarization, audio to text and realtime pages. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
…ng the request A registered voice with the wrong embedding size, or one the C side refused, failed the whole diarization request, so one legacy voice broke the model for every user. Skip such voices with a warning that does not carry the voice name, and take the plain path when none is left. Also map an exact 0 speaker threshold or margin to a tiny positive value, since the C side reads 0 as "use the default", and fix a stale comment about which contexts Free() walks. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
…er; document the privacy limit The different-encoder warning fired on every request. Log it once per feature and speaker model, then at debug level. Document that the global voice registry lets any caller of a speaker_model model learn matching names, and that skipped wrong-sized voices are logged. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
…ck speaker naming against the real library The pin moves from 623a968 to 8c8cec0, which brings in everything merged in parakeet.cpp since: the voice identification change (C-API v9, #78) and raw-embedding enroll plus diarize-only speaker naming (C-API v10, #79). New real-library specs (gated on PARAKEET_BACKEND_TEST_SPEAKER_MODEL, _DIAR_MODEL, _WAV and, for the live path, _STREAM_MODEL) name the two speakers of two_speakers.wav from a committed pair of WeSpeaker embeddings, with the voices passed in reversed order. They also check that the float32 threshold reaches C through purego. The shared test loader now registers the v9/v10 and scene symbols as main.go does. The rebase onto origin/master had no conflicts. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Register a voice once with
/v1/voice/registerand the parakeet-cpp backend uses it to name the speakers it finds: in/v1/audio/diarizationresults and in live transcription. Speakers that are not registered keep theirSPEAKER_NNlabel.It is opt-in per model. Nothing changes for models without
speaker_model:, for other diarization backends, or for clients that ignore the new fields.What changes
Registry.List, andMetadata.Model: the speaker encoder that produced an embedding (the voice-detect backend's model name, by default the GGUF file name)./v1/voice/registernow stores it. A voice's encoder and a model'sspeaker_model:file have to match, so an encoder switch cannot turn into wrong names.speaker_model:, takes the registered voices made by that encoder (plus untagged legacy voices of the same size), and sends them with the diarize request and the live session config (KnownVoicein the proto).speakerssummary gainname, segments alsoname_score.speakerstaysSPEAKER_NN; RTTM is unchanged. A result without names marshals byte for byte as before (golden test).speaker_name.speaker_model:,speaker_threshold:(a distance, 1 minus cosine, the unit of/v1/voice/identify, default 0.5) andspeaker_margin:(default 0.05). It builds a per-request parakeet.cpp registry from the known voices and calls the named diarization and scene-stream functions. A voice of the wrong embedding size is skipped with a warning that does not name it.parakeet-cpp-nemotron-3-diarization-speakers,parakeet-cpp-nemotron-3-diarization-asr-speakers,parakeet-cpp-realtime-scene-speakers), all using the WeSpeaker ResNet34 file thevoice-detect-wespeaker-resnet34entry already installs, so no new files on the Hub. Docs invoice-recognition.md,audio-diarization.md,audio-to-text.mdandopenai-realtime.md.PARAKEET_VERSIONmoves from623a968to8c8cec0, which contains the speaker code (feat: identify speakers in the scene stream (voice-detect.cpp, C-API v9) parakeet.cpp#78) and the C-API v10 functions this needs (Welcome to LocalAI Discussions! #79). Those two commits are the whole range, both additive.Checked
libparakeet.sobuilt from the pinned tree and diarizetwo_speakers.wavwith two known voices passed in reverse order: 5 segments, slot 0 named for voice A and slot 1 for voice B, scores about 0.92 and 0.97. With only voice B registered andspeaker_threshold:0.3, slot 0 stays unnamed.speaker_threshold:0.01names nobody, which shows thefloat32threshold really reaches C through purego. The live path names all 5 segments correctly. These specs are gated on env vars and skip in default CI.Things to know
speaker_model:can learn which registered names match their audio; the docs say to restrict such models with the model allowlist. A possible follow-up is to skip the known voices when the caller lacks the voice-recognition feature.model_name:. Amodel_name:option on the voice-detect model config overrides the tag and the voices then won't match. Documented.include_textthe names use parakeet.cpp's default threshold and margin, because that C function takes neither. In a live stream a segment that closes before its speaker is identified has no name.swagisn't installed here).🤖 Generated with Claude Code