Skip to content

feat: Add ModelsLab TTS provider#529

Open
adhikjoshi wants to merge 1 commit intoHuanshere:mainfrom
adhikjoshi:feat/add-modelslab-tts
Open

feat: Add ModelsLab TTS provider#529
adhikjoshi wants to merge 1 commit intoHuanshere:mainfrom
adhikjoshi:feat/add-modelslab-tts

Conversation

@adhikjoshi
Copy link

Summary

Adds ModelsLab as a new TTS backend for VideoLingo, following the exact same per-file pattern as the existing SiliconFlow, OpenAI, Azure, and Edge TTS integrations.

Changes

File Change
core/tts_backend/modelslab_tts.py New provider module
core/tts_backend/tts_main.py Import + elif TTS_METHOD == 'modelslab_tts' dispatch
config.yaml modelslab_tts: section with api_key and voice
core/st_utils/sidebar_setting.py Streamlit API key input + voice picker dropdown

Features

  • 10 voices: Bella, Antoni, Elli, Josh, Arnold, Adam, Sam, Rachel, Domi, Gigi
  • Async polling: handles status: "processing" responses (polls every 5s, up to 5 min)
  • Character limit: 2,500 chars enforced automatically
  • Retry logic: 3 attempts via @except_handler (same pattern as other providers)
  • WAV output: compatible with VideoLingo's audio pipeline

Setup

  1. Get your API key from modelslab.com
  2. Set modelslab_tts.api_key in config.yaml (or via Streamlit sidebar)
  3. Select modelslab_tts as the TTS Method and choose a voice
modelslab_tts:
  api_key: 'YOUR_MODELSLAB_API_KEY'
  voice: 'Bella'   # Bella, Antoni, Elli, Josh, Arnold, Adam, Sam, Rachel, Domi, Gigi

About ModelsLab

ModelsLab offers affordable AI inference including TTS, image generation, and video generation. API docs: https://docs.modelslab.com

Adds ModelsLab as a new TTS backend for VideoLingo, following the same
per-file pattern as the existing SiliconFlow, OpenAI, Azure, and Edge
TTS integrations.

Changes:
- core/tts_backend/modelslab_tts.py  — new provider module
- core/tts_backend/tts_main.py       — import + dispatch case
- config.yaml                        — modelslab_tts config section
- core/st_utils/sidebar_setting.py   — Streamlit API key + voice picker

Features:
- 10 voices: Bella, Antoni, Elli, Josh, Arnold, Adam, Sam, Rachel, Domi, Gigi
- Async polling: handles 'processing' status (polls every 5 s, up to 5 min)
- 2 500-character limit enforced automatically
- 3-retry logic via @except_handler decorator (same as other providers)
- WAV output — compatible with VideoLingo's audio pipeline

Setup:
  1. Get an API key at https://modelslab.com
  2. Set modelslab_tts.api_key in config.yaml (or via the Streamlit sidebar)
  3. Select 'modelslab_tts' as the TTS Method and choose a voice
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.

1 participant