From bec8a23dfb3cd5cc1713632309603751102ab481 Mon Sep 17 00:00:00 2001 From: Harshita Jain <77115160+harshitajain165@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:36:08 +0530 Subject: [PATCH] fix: sync Smallest AI voice dropdown with selected model (#451) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add model_options to SmallestAITTSConfiguration's voice field so the UI renders the correct voice list per model — 15 standard voices for lightning_v3.1 and 6 premium voices (meher, rhea, aviraj, cressida, willow, maverick) for lightning_v3.1_pro. All 21 voice IDs verified against the Smallest AI API. The frontend's existing model_options machinery already handles dropdown filtering and auto-reset on model change, so no UI changes are needed. --- api/services/configuration/options/__init__.py | 2 ++ api/services/configuration/options/smallest.py | 9 +++++++++ api/services/configuration/registry.py | 12 ++++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/api/services/configuration/options/__init__.py b/api/services/configuration/options/__init__.py index 5bd5bc20..c30b128c 100644 --- a/api/services/configuration/options/__init__.py +++ b/api/services/configuration/options/__init__.py @@ -44,6 +44,7 @@ from .sarvam import ( from .smallest import ( SMALLEST_TTS_LANGUAGES, SMALLEST_TTS_MODELS, + SMALLEST_TTS_PRO_VOICES, SMALLEST_TTS_VOICES, ) from .speechmatics import SPEECHMATICS_STT_LANGUAGES @@ -87,6 +88,7 @@ __all__ = [ "SARVAM_V3_VOICES", "SMALLEST_TTS_LANGUAGES", "SMALLEST_TTS_MODELS", + "SMALLEST_TTS_PRO_VOICES", "SMALLEST_TTS_VOICES", "SPEECHMATICS_STT_LANGUAGES", ] diff --git a/api/services/configuration/options/smallest.py b/api/services/configuration/options/smallest.py index 7072349d..70b90f56 100644 --- a/api/services/configuration/options/smallest.py +++ b/api/services/configuration/options/smallest.py @@ -16,6 +16,15 @@ SMALLEST_TTS_VOICES = ( "mia", "maithili", ) +# Premium voices for lightning_v3.1_pro (American, British, Indian accents; English + Hindi only) +SMALLEST_TTS_PRO_VOICES = ( + "meher", + "rhea", + "aviraj", + "cressida", + "willow", + "maverick", +) SMALLEST_TTS_LANGUAGES = ( "en", "hi", diff --git a/api/services/configuration/registry.py b/api/services/configuration/registry.py index 0b4438ee..99172cc1 100644 --- a/api/services/configuration/registry.py +++ b/api/services/configuration/registry.py @@ -41,6 +41,7 @@ from api.services.configuration.options import ( SARVAM_V3_VOICES, SMALLEST_TTS_LANGUAGES, SMALLEST_TTS_MODELS, + SMALLEST_TTS_PRO_VOICES, SMALLEST_TTS_VOICES, SPEECHMATICS_STT_LANGUAGES, ) @@ -1194,8 +1195,15 @@ class SmallestAITTSConfiguration(BaseTTSConfiguration): ) voice: str = Field( default="sophia", - description="Smallest AI voice ID.", - json_schema_extra={"examples": SMALLEST_TTS_VOICES, "allow_custom_input": True}, + description="Smallest AI voice ID. Available voices differ by model: lightning_v3.1 has a broad multilingual pool; lightning_v3.1_pro has premium American, British, and Indian accent voices (English + Hindi only).", + json_schema_extra={ + "examples": list(SMALLEST_TTS_VOICES), + "allow_custom_input": True, + "model_options": { + "lightning_v3.1": list(SMALLEST_TTS_VOICES), + "lightning_v3.1_pro": list(SMALLEST_TTS_PRO_VOICES), + }, + }, ) language: str = Field( default="en",