fix(sarvam): align TTS validation with the Bulbul API - #6864
Open
uuzzrm wants to merge 2 commits into
Open
Conversation
The plugin's option validation drifted from what the Sarvam endpoints actually accept: - bulbul:v3 ships 37 documented speakers; nine were missing from the compatibility map (anand, tarun, sunny, mani, gokul, vijay, mohit, rehan, soham) while amelia/sophia were listed even though the API rejects them. - 32/44.1/48 kHz sample rates are REST-only (bulbul:v3); streaming now fails fast with a clear error instead of erroring mid-session, and synthesize() rejects them for non-v3 models. - pace is validated per model: 0.5-2.0 for v3/v3-beta, 0.3-3.0 for v2, in both the constructor and update_options. Adds unit tests covering the speaker map, pace ranges, and the streaming/REST sample-rate gates.
Contributor
Author
|
Addressed the stale-pace finding in 94829cc: update_options now re-validates the stored pace against the new model's range when only the model changes, clamping with a warning (same policy as pitch) instead of letting an out-of-range value reach the API. Added regression coverage for the clamp and for the in-range case. |
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.
Fixes #6774
The sarvam plugin's TTS option validation drifted from what the Bulbul
endpoints actually accept, so three combos that should work were being
rejected up front and three that can't work were only failing once the
request hit the API.
Speakers. bulbul:v3 has 37 documented voices. Nine were missing from
the compatibility map (anand, tarun, sunny, mani, gokul, vijay, mohit,
rehan, soham), while amelia/sophia were listed even though the API
rejects them with "Speaker is not recognized". Verified against
https://docs.sarvam.ai/api/getting-started/models/bulbul and the REST
reference.
Sample rates. 32/44.1/48 kHz are REST-only (bulbul:v3).
stream()now raises up front for those instead of erroring mid-session over the
socket, and
synthesize()rejects them for non-v3 models.pace. Now validated per model in both the constructor and
update_options: 0.5-2.0 for v3/v3-beta, 0.3-3.0 for v2.Added
tests/test_tts_validation.py(unit category) covering the speakermap, pace ranges, and the streaming/REST sample-rate gates.
uv run pytest --unit livekit-plugins/livekit-plugins-sarvampasses andruff check/ruff formatare clean on the changed files.