[PR #1569] [CLOSED] feat: TTS support for openedai-speech external api #7502

Closed
opened 2025-11-11 17:28:32 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/1569
Author: @ghost
Created: 4/16/2024
Status: Closed

Base: devHead: openedai-speech-external-support


📝 Commits (8)

  • 0946bf1 Ignore ollama-data dir
  • dee87c7 Support a local openedai-speech server separate from ollama
  • 4d4206d Ignore .vscode/
  • a61a7e2 Properly join paths
  • 2b53302 Merge branch 'open-webui:main' into master
  • beff0a3 feat: TTS support for openedai-speech external api
  • 4f32925 Merge branch 'dev' into openedai-speech-external-support
  • 3f309d1 Format fixes

📊 Changes

10 files changed (+302 additions, -8 deletions)

View changed files

📝 .gitignore (+5 -1)
📝 backend/apps/openai/main.py (+50 -3)
📝 backend/config.py (+15 -0)
docker-compose.customized.yaml (+8 -0)
run-customized.sh (+25 -0)
📝 src/lib/apis/openai/index.ts (+92 -0)
📝 src/lib/components/chat/Messages/ResponseMessage.svelte (+75 -1)
📝 src/lib/components/chat/Settings/Audio.svelte (+29 -2)
📝 src/lib/i18n/locales/en-US/translation.json (+1 -0)
📝 src/lib/utils/index.ts (+2 -1)

📄 Description

Pull Request Checklist

  • Description: Briefly describe the changes in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?

Description

Add optional support for the openedai-speech TTS speech engine API. The ENABLE & BASE_URL variables must be set to activate integration. SPEECH_VOICES can be set to limit or add voices to match the backend openedai-speech configuration. The default voice is alloy matching the OpenAI implementation.

Seems to be working well. I've only tested using the minimal Docker container without CUDA & GPU: --env 'ENABLE_OPENEDAI_SPEECH=true' --env 'OPENEDAI_SPEECH_BASE_URL=http://127.0.0.1:8000/v1'.

Based on work by @jmtatsch. Thanks!

Edit: Oops, I meant to tag @lee-b.


Changelog Entry

Added

  • Update config.py to add the environment variables: ENABLE_OPENEDAI_SPEECH (default: false), OPENEDAI_SPEECH_BASE_URL (default: ''), and OPENEDAI_SPEECH_VOICES (default: alloy;echo;fable;onyx;nova;shimmer).
  • New backend functions for frontend features: get_openedai_audio_voices() & get_openedai_audio_enabled().
  • New frontend functions: synthesizeOpenedAISpeech(), getOpenedAISpeechEnabled(), and getOpenedAISpeechVoices()
  • GUI Option to select "Opened AI Speech" (openedai) TTS engine with minimal settings support and is toggled by ENABLE_OPENEDAI_SPEECH.

Fixed

  • Fix to: Replace quotations to avoid corrupt TTS (looking at you tinyllama).

Changed

  • Share the existing OpenAI speech() backend function with /opened/audio/speech path alias.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/1569 **Author:** [@ghost](https://github.com/ghost) **Created:** 4/16/2024 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `openedai-speech-external-support` --- ### 📝 Commits (8) - [`0946bf1`](https://github.com/open-webui/open-webui/commit/0946bf13fb7c8befd65d7a6800ed32b1aec158e7) Ignore ollama-data dir - [`dee87c7`](https://github.com/open-webui/open-webui/commit/dee87c76d00657b7627aad07af54e4f63cfa2ba8) Support a local openedai-speech server separate from ollama - [`4d4206d`](https://github.com/open-webui/open-webui/commit/4d4206d6292e8c1fcc3fec770dd22e890fd36cf2) Ignore .vscode/ - [`a61a7e2`](https://github.com/open-webui/open-webui/commit/a61a7e2c5c32d37e8245f73be9cf4e8c59dcd101) Properly join paths - [`2b53302`](https://github.com/open-webui/open-webui/commit/2b53302fe2dbcb267fbfb2df7dc64d68b11abe99) Merge branch 'open-webui:main' into master - [`beff0a3`](https://github.com/open-webui/open-webui/commit/beff0a34567410aac6bb839da2f4feacaf6038a5) feat: TTS support for openedai-speech external api - [`4f32925`](https://github.com/open-webui/open-webui/commit/4f32925117431daf3dccac404d2b10f129cca0c7) Merge branch 'dev' into openedai-speech-external-support - [`3f309d1`](https://github.com/open-webui/open-webui/commit/3f309d12193636de1a401196071d367ea3644b77) Format fixes ### 📊 Changes **10 files changed** (+302 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+5 -1) 📝 `backend/apps/openai/main.py` (+50 -3) 📝 `backend/config.py` (+15 -0) ➕ `docker-compose.customized.yaml` (+8 -0) ➕ `run-customized.sh` (+25 -0) 📝 `src/lib/apis/openai/index.ts` (+92 -0) 📝 `src/lib/components/chat/Messages/ResponseMessage.svelte` (+75 -1) 📝 `src/lib/components/chat/Settings/Audio.svelte` (+29 -2) 📝 `src/lib/i18n/locales/en-US/translation.json` (+1 -0) 📝 `src/lib/utils/index.ts` (+2 -1) </details> ### 📄 Description ## Pull Request Checklist - [x] **Description:** Briefly describe the changes in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? --- ## Description Add _**optional**_ support for the [openedai-speech](https://github.com/matatonic/openedai-speech) TTS speech engine API. The *ENABLE* & *BASE_URL* variables must be set to activate integration. *SPEECH_VOICES* can be set to limit or add voices to match the backend openedai-speech configuration. The default voice is `alloy` matching the OpenAI implementation. Seems to be working well. I've only tested using the [minimal Docker container](https://github.com/matatonic/openedai-speech/blob/main/Dockerfile.min) without CUDA & GPU: `--env 'ENABLE_OPENEDAI_SPEECH=true' --env 'OPENEDAI_SPEECH_BASE_URL=http://127.0.0.1:8000/v1'`. Based on work by @jmtatsch. Thanks! Edit: Oops, I meant to tag @lee-b. --- ### Changelog Entry ### Added - Update `config.py` to add the environment variables: **ENABLE_OPENEDAI_SPEECH** (default: false), **OPENEDAI_SPEECH_BASE_URL** (default: ''), and **OPENEDAI_SPEECH_VOICES** (default: `alloy;echo;fable;onyx;nova;shimmer`). - New backend functions for frontend features: `get_openedai_audio_voices()` & `get_openedai_audio_enabled()`. - New frontend functions: `synthesizeOpenedAISpeech()`, `getOpenedAISpeechEnabled()`, and `getOpenedAISpeechVoices()` - GUI Option to select "Opened AI Speech" (openedai) TTS engine with minimal settings support and is toggled by **ENABLE_OPENEDAI_SPEECH**. ### Fixed - Fix to: _Replace quotations to avoid corrupt TTS (looking at you tinyllama)_. ### Changed - Share the existing OpenAI `speech()` backend function with `/opened/audio/speech` path alias. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-11 17:28:32 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#7502