Skip to content

QVAC-20550 feat[api]: separate TTS language validation per engine#2581

Merged
ishanvohra2 merged 2 commits into
tetherto:mainfrom
ishanvohra2:fix/chatterbox-mtl-support
Jun 15, 2026
Merged

QVAC-20550 feat[api]: separate TTS language validation per engine#2581
ishanvohra2 merged 2 commits into
tetherto:mainfrom
ishanvohra2:fix/chatterbox-mtl-support

Conversation

@ishanvohra2

@ishanvohra2 ishanvohra2 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🎯 What problem does this PR solve?

  • Chatterbox and Supertonic support different language sets, but the SDK validated both against one shared 4-language enum (en, es, de, it).
  • Chatterbox actually supports 18 multilingual languages — most were rejected by the schema.
  • Supertonic accepted de/it, which it never supports at runtime (native engine only handles en/es/fr/pt/ko).

📝 How does it solve it?

  • Split the single language enum into engine-specific lists: TTS_CHATTERBOX_LANGUAGES (18) and TTS_SUPERTONIC_LANGUAGES (5).
  • Wire each into its own runtime config schema (ttsChatterboxRuntimeConfigSchema / ttsSupertonicRuntimeConfigSchema).
  • Kept TTS_LANGUAGES for backwards compatibility (now the union, which equals the chatterbox 18 since supertonic is a subset).
  • Added TtsChatterboxLanguage / TtsSupertonicLanguage types.

🧪 How was it tested?

  • Added/updated unit tests in tts-schemas.test.ts: asserts all 18 chatterbox languages parse, the supertonic subset parses, supertonic rejects chatterbox-only languages (de), and a chatterbox load config accepts tr.
  • bun run test/unit/tts-schemas.test.ts → 18/18 tests, 67/67 asserts pass.

🔌 API Changes

import {
  TTS_CHATTERBOX_LANGUAGES, // en, es, fr, de, it, pt, nl, pl, tr, sv, da, fi, no, el, ms, sw, ar, ko
  TTS_SUPERTONIC_LANGUAGES, // en, es, fr, pt, ko
  type TtsChatterboxLanguage,
  type TtsSupertonicLanguage,
} from "@qvac/sdk";

// Chatterbox now accepts all 18 multilingual languages
await loadModel({
  modelSrc: ...,
  modelConfig: { ttsEngine: "chatterbox", language: "tr" },
});

Note: Supertonic's accepted language set is now correctly restricted to en/es/fr/pt/ko. de/it are no longer accepted for Supertonic configs — they never produced valid audio (the native engine only supports the 5-language subset), so this corrects previously-broken validation rather than removing working functionality.


@ishanvohra2 ishanvohra2 requested review from a team as code owners June 15, 2026 08:02
Validate chatterbox and supertonic languages with distinct enums instead
of a shared list. Expose all 18 chatterbox multilingual languages and
restrict supertonic to its actual subset (en/es/fr/pt/ko).

Co-authored-by: Cursor <cursoragent@cursor.com>
@ishanvohra2 ishanvohra2 force-pushed the fix/chatterbox-mtl-support branch from 14cbbb0 to 73081e8 Compare June 15, 2026 10:08
@ishanvohra2

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Tier-based Approval Status

**PR Tier:** TIER1

**Current Status:** ✅ APPROVED

**Requirements:**
- 1 Team Member approval ✅ (1/1)
- 1 Team Lead OR Management approval ✅ (1/1)



---
*This comment is automatically updated when reviews change.*

@ishanvohra2 ishanvohra2 merged commit 962607d into tetherto:main Jun 15, 2026
18 checks passed
opaninakuffo added a commit to opaninakuffo/qvac that referenced this pull request Jun 15, 2026
Release metadata for @qvac/sdk + @qvac/bare-sdk 0.13.2:
- bump sdk + bare-sdk 0.13.1 -> 0.13.2
- bump @qvac/rag ^0.6.2 -> ^0.6.4 (sdk + bare-sdk, mirrored via bare-sdk sync)
- changelog for 0.13.2 (cherry-picked tetherto#2581 TTS per-engine language
  validation, tetherto#2585 drop bare-runtime/bare-pack from bare-sdk deps, rag bump)
- regenerate NOTICE for sdk + bare-sdk (bare-sdk drops bare-runtime/bare-pack
  attributions; @qvac/rag bumped to 0.6.4)

Also align qv-sdk-bare-sdk-sync's SDK_ONLY_PACKAGES with
check-deps-vs-sdk.mjs (bare-runtime, bare-pack). tetherto#2585 added them to the
check script but not the sync script, so the sync was re-adding the
dropped deps to bare-sdk.
opaninakuffo added a commit to opaninakuffo/qvac that referenced this pull request Jun 15, 2026
Release metadata for @qvac/sdk + @qvac/bare-sdk 0.13.2:
- bump sdk + bare-sdk 0.13.1 -> 0.13.2
- bump @qvac/rag ^0.6.2 -> ^0.6.4 (sdk + bare-sdk, mirrored via bare-sdk sync)
- changelog for 0.13.2 (cherry-picked tetherto#2581 TTS per-engine language
  validation, tetherto#2585 drop bare-runtime/bare-pack from bare-sdk deps, rag bump)
- regenerate NOTICE for sdk + bare-sdk (bare-sdk drops bare-runtime/bare-pack
  attributions; @qvac/rag bumped to 0.6.4)

Also align qv-sdk-bare-sdk-sync's SDK_ONLY_PACKAGES with
check-deps-vs-sdk.mjs (bare-runtime, bare-pack). tetherto#2585 added them to the
check script but not the sync script, so the sync was re-adding the
dropped deps to bare-sdk.

(cherry picked from commit 92e996c)
opaninakuffo added a commit that referenced this pull request Jun 15, 2026
Release metadata for @qvac/sdk + @qvac/bare-sdk 0.13.2:
- bump sdk + bare-sdk 0.13.1 -> 0.13.2
- bump @qvac/rag ^0.6.2 -> ^0.6.4 (sdk + bare-sdk, mirrored via bare-sdk sync)
- changelog for 0.13.2 (cherry-picked #2581 TTS per-engine language
  validation, #2585 drop bare-runtime/bare-pack from bare-sdk deps, rag bump)
- regenerate NOTICE for sdk + bare-sdk (bare-sdk drops bare-runtime/bare-pack
  attributions; @qvac/rag bumped to 0.6.4)

Also align qv-sdk-bare-sdk-sync's SDK_ONLY_PACKAGES with
check-deps-vs-sdk.mjs (bare-runtime, bare-pack). #2585 added them to the
check script but not the sync script, so the sync was re-adding the
dropped deps to bare-sdk.

(cherry picked from commit 92e996c)
@ishanvohra2 ishanvohra2 deleted the fix/chatterbox-mtl-support branch June 23, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants