Add ElevenLabs provider support and update related documentation#25
Merged
Conversation
…tching - Updated docker-compose.yml to include optional environment files for ElevenLabs. - Created documentation for the ElevenLabs provider detailing configuration, models, and audio output. - Enhanced configure.sh to manage ElevenLabs-specific environment variables and settings. - Introduced fetch_elevenlabs_voices.py script to fetch and curate voices from ElevenLabs API. - Added tests for ElevenLabs provider logic, including daily limit functionality and audio validation. - Refactored audio testing helpers to support new audio formats and validation methods. - Implemented a fake provider for testing purposes to simulate ElevenLabs behavior without network calls.
…ployment documentation
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.
This pull request introduces ElevenLabs as a new optional TTS provider, adds support for provider-specific environment configuration, and implements a host-wide daily usage cap for ElevenLabs to control API costs. It also updates documentation and deployment scripts to reflect these changes, and improves error handling and provider integration in the synthesizer.
Provider integration and configuration:
ElevenLabs is now supported as a TTS provider, with its own environment file (
elevenlabs.env) for configuration. The provider is registered when enabled, and provider-specific settings (API key, model ID, languages, usage cap, etc.) are loaded and validated. (app/config/settings.py,app/main.py,.github/workflows/deploy.yml) [1] [2] [3] [4] [5] [6]A new ElevenLabs voices registry is added with sample voices and language support. (
app/data/voices/elevenlabs/voices.json)Usage limits and reliability:
Implements a host-wide daily usage budget for ElevenLabs, backed by an fcntl-locked JSON file, to enforce per-day character limits and prevent abuse. (
app/core/daily_limit.py)Error handling in the synthesizer is improved: only provider outages (5xx errors) now trip the circuit breaker, while client and quota errors (e.g., daily cap exceeded) do not. (
app/core/synthesizer.py)Deployment and documentation:
Deployment workflow is updated to handle the new
elevenlabs.envfile and secret, including optional handling if ElevenLabs is not enabled. (.github/workflows/deploy.yml) [1] [2]Documentation and README are updated to reflect ElevenLabs as a supported provider, with links to provider-specific docs and updated feature tables. (
README.md) [1] [2]Other improvements:
The
/demoendpoint now disables browser caching to always serve the latest demo after edits. (app/main.py)The synthesizer now passes audio format and bitrate to providers, and handles native-encoded audio output (such as from ElevenLabs) directly, bypassing local encoding steps. (
app/core/synthesizer.py) [1] [2]