mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
[PR #16036] [CLOSED] feat: KokoroTTS text-to-speech-engine option (decoupled from OpenAI TTS) #127668
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/16036
Author: @silentoplayz
Created: 7/26/2025
Status: ❌ Closed
Base:
dev← Head:KokoroTTS-text-to-speech-engine📝 Commits (9)
3a25512feat: KokoroTTS text-to-speech-engine option (decoupled from OpenAI TTS option)60f83f3remove commentsf170ea3fix: add required for TTS fields to save settingsd007819refac: forward slash (/) support for KokoroTTS Base URL4bb995cfeat: display voice distribution percentages for KokoroTTS voice combinations input4c88936refac: validate KokoroTTS custom voice combination input against the actual available voice names fetched from the KokoroTTS API0536da1.f09e15bMerge branch 'dev' into KokoroTTS-text-to-speech-enginec96fb20fix: add back required📊 Changes
5 files changed (+502 additions, -44 deletions)
View changed files
📝
backend/open_webui/config.py(+8 -0)📝
backend/open_webui/main.py(+2 -0)📝
backend/open_webui/routers/audio.py(+122 -8)📝
src/lib/components/admin/Settings/Audio.svelte(+360 -31)📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+10 -5)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
AUDIO_TTS_KOKORO_API_BASE_URLenvironment variable (or UI setting) and integrates KokoroTTS model/voice discovery and speech generation throughout the audio pipeline.Added
kokoro) selectable in the UI alongsideopenai,azure, andelevenlabs./v1/modelsand/v1/audio/voicesendpoints, respectively.TTS_KOKORO_API_BASE_URL/v1/audio/speech.AUDIO_TTS_KOKORO_API_BASE_URLand corresponding persistent config entry.TTS_KOKORO_API_BASE_URLto prevent cache collisions when switching engines.TTS_KOKORO_API_BASE_URLand an optionalTTS_API_KEYfor KokoroTTS.af_bella+af_skyoraf_bella(2)+af_sky(1)).KOKORO_NORMALIZATION_OPTIONS.normalizein the config.Changed
backend/open_webui/config.pyto registerAUDIO_TTS_KOKORO_API_BASE_URL.backend/open_webui/main.pyto exposeTTS_KOKORO_API_BASE_URLto the application state.backend/open_webui/routers/audio.py:TTSConfigForm,get_audio_config, andupdate_audio_config, includingKOKORO_NORMALIZATION_OPTIONS./speechendpoint for KokoroTTS requests.get_available_modelsandget_voicesfor dynamic discovery.Audio.svelte(frontend UI):TTS_ENGINEselection.KOKORO_NORMALIZATION_OPTIONS.normalizesetting.Fixed
Hopefully there aren't any breaking changes. All existing TTS engines remain unchanged and KokoroTTS is an optional text-to-speech engine.
Before vs After — KokoroTTS in Open WebUI
/v1/modelsand/v1/audio/voices) endpoints and lists every available model and voice in drop-down menus—no typing required!Settings>Audio>Text-to-Speech Engine. Selecting it instantly tells the UI to use the correct endpoints and parameters (as long as a valid URL is entered in the TTS engine base URL input field), removing all guesswork.af_alloy+af_heart+af_sky+af_bella) into a single text field.af_bella(2)+af_sky(1)).kokoro) into a text field.Additional Information
Voice Combinationsection of https://github.com/remsky/Kokoro-FastAPI?tab=readme-ov-file#features.Missing words & Missing some timestampssection of https://github.com/remsky/Kokoro-FastAPI?tab=readme-ov-file#known-issues--troubleshooting. I am not 100% sure if this is working or not. It gets toggled off when I toggle it on, save the settings, swap off the audio settings page, and swap back to it. PLEASE TEST/FIX THIS FOR ME!Optional) logic is working properly for KokoroTTS - UNTESTED!Enable Text Normalizationoption is colored gray and still needs styling to be green.AUDIO_TTS_KOKORO_API_KEYlikely should be an environment variable added to this PR. Thoughts?Testing is definitely desired with this PR and any feedback is certainly appreciated. This PR was made entirely possible with the companionship of Gemini 2.5 Flash model! DO NOT JUST BLINDLY MERGE THIS!
BEFORE THIS PR
AFTER MODIFICATIONS MADE IN THIS PR
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.