Skip to content

feat: Add ModelsLab TTS provider#300

Open
adhikjoshi wants to merge 2 commits into
souzatharsis:mainfrom
adhikjoshi:feat/add-modelslab-tts
Open

feat: Add ModelsLab TTS provider#300
adhikjoshi wants to merge 2 commits into
souzatharsis:mainfrom
adhikjoshi:feat/add-modelslab-tts

Conversation

@adhikjoshi

Copy link
Copy Markdown

Summary

Adds ModelsLab as a new TTS provider for podcastfy, following the same factory/registry pattern as the existing ElevenLabs, OpenAI, Gemini, and Edge integrations.

Changes

File Change
podcastfy/tts/providers/modelslab.py New ModelsLabTTS class implementing TTSProvider
podcastfy/tts/factory.py Register 'modelslab': ModelsLabTTS in _providers
podcastfy/conversation_config.yaml Add modelslab: config section with default voices
tests/test_audio.py Add skipped integration test

Usage

from podcastfy.text_to_speech import TextToSpeech

tts = TextToSpeech(model='modelslab', api_key='YOUR_MODELSLAB_API_KEY')
tts.convert_to_speech(podcast_text, 'output.mp3')

Or set the MODELSLAB_API_KEY environment variable and just pass model='modelslab'.

Features

  • 10 voices: Bella, Antoni, Elli, Josh, Arnold, Adam, Sam, Rachel, Domi, Gigi
  • Default podcast voices: Bella (Person1/question) + Antoni (Person2/answer)
  • Async polling: handles status: "processing" responses (polls every 5s, up to 5 min)
  • 2,500-char limit: enforced automatically per ModelsLab API constraints
  • No new dependencies: uses only requests (already in project dependencies)

conversation_config.yaml

modelslab:
  default_voices:
    question: "Bella"
    answer: "Antoni"
  model: "modelslab-tts-v1"

About ModelsLab

ModelsLab is an AI inference platform offering TTS, image generation, and video generation via REST API. API docs: https://docs.modelslab.com/text-to-audio/realtime/tts

Adds ModelsLab (https://modelslab.com) as a new text-to-speech provider
for podcastfy, following the same factory/registry pattern used by the
existing ElevenLabs, OpenAI, Gemini, and Edge TTS integrations.

Changes:
- podcastfy/tts/providers/modelslab.py  — new ModelsLabTTS class
- podcastfy/tts/factory.py              — register 'modelslab' in _providers
- podcastfy/conversation_config.yaml   — add modelslab default voices
- tests/test_audio.py                  — skipped integration test

Features:
- 10 voices: Bella, Antoni, Elli, Josh, Arnold, Adam, Sam, Rachel, Domi, Gigi
- Default podcast voices: Bella (question) and Antoni (answer)
- Async polling support (handles 'processing' status, polls for up to 5 min)
- API key via constructor arg or MODELSLAB_API_KEY environment variable
- 2 500-character limit enforced automatically

Usage:
  from podcastfy.text_to_speech import TextToSpeech
  tts = TextToSpeech(model='modelslab', api_key='YOUR_KEY')
  tts.convert_to_speech(text, 'output.mp3')
- Remove aligned spaces in _VOICE_MAP dict values (E241)
- Remove aligned spaces in _API_URL/FETCH_URL assignments (E221)
- Remove aligned spaces in payload dict (E241)
- Remove aligned spaces in _poll_for_url assignments (E221)
- Fix docstring arg indentation for consistency
- Add missing docstring to _extract_url helper
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