Return voices for single-model servers when model param is omitted - #64
Merged
Merged
Conversation
GET /v1/audio/voices without ?model= returns {"voices":[]} even when
the server has a single model configured with voice presets. Clients
that call this endpoint to populate a voice picker receive an empty
list and cannot discover available voices.
When no model param is provided and exactly one model is configured,
fall back to that model. Multi-model servers are unchanged since voices
cannot be attributed without the param.
Owner
|
@kevin-ho Thank you! PR merged. |
dleiferives
pushed a commit
to dleiferives/audio.cpp
that referenced
this pull request
Jul 25, 2026
…ndpoint Return voices for single-model servers when model param is omitted
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.
Problem
When the server has a single model configured,
GET /v1/audio/voiceswithout a?model=query parameter returns{"voices":[]}. Clients that call this endpoint to populate a voice picker — without prior knowledge of model IDs — receive an empty list and cannot discover available voices.Fix
When no
?model=param is provided and exactly one model is configured, fall back to that model's voices. When multiple models are configured, the existing behavior is unchanged (empty response, since voices cannot be attributed to a specific model without the param).Rationale
The change is purely additive — it only affects the
models_.size() == 1path that previously returned empty. The multi-model path and the explicit?model=path are unchanged.Voice presets are static config metadata parsed at startup, so this works regardless of
lazy_loadsetting. No runtime state or model session is involved —handle_voicesonly reads the in-memoryvoice_presetsmap and theembeddings/directory listing.Tested
GET /v1/audio/voices(no param) → voices returned (was[])GET /v1/audio/voices?model=<id>→ unchanged