Skip to content

Add ElevenLabs provider support and update related documentation#25

Merged
ronibhakta1 merged 2 commits into
readium:mainfrom
ronibhakta1:main
Jul 23, 2026
Merged

Add ElevenLabs provider support and update related documentation#25
ronibhakta1 merged 2 commits into
readium:mainfrom
ronibhakta1:main

Conversation

@ronibhakta1

Copy link
Copy Markdown
Contributor

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.env file 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 /demo endpoint 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]

…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.
@ronibhakta1
ronibhakta1 merged commit df47645 into readium:main Jul 23, 2026
1 check passed
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