Skip to content

feat(tools): add base_url support to OpenAI TTS provider#2064

Merged
teknium1 merged 1 commit intoNousResearch:mainfrom
hanai:feat/openai-tts-base-url
Mar 19, 2026
Merged

feat(tools): add base_url support to OpenAI TTS provider#2064
teknium1 merged 1 commit intoNousResearch:mainfrom
hanai:feat/openai-tts-base-url

Conversation

@hanai
Copy link
Copy Markdown
Contributor

@hanai hanai commented Mar 19, 2026

What and Why

The OpenAI TTS provider previously had base_url hardcoded to https://api.openai.com/v1, making it impossible to use self-hosted or OpenAI-compatible TTS services.

This PR reads base_url from ~/.hermes/config.yaml under tts.openai.base_url, falling back to the official endpoint when not set. No behavior change for existing users.

Usage

tts:
  provider: openai
  openai:
    base_url: http://localhost:8000/v1  # e.g. LocalAI, or any OpenAI-compatible TTS endpoint
    voice: alloy

Changes

  • tools/tts_tool.py: read base_url from oai_config in _generate_openai_tts()
  • website/docs/user-guide/features/voice-mode.md: document the new base_url field under tts.openai

How to Test

  1. Set tts.provider: openai and tts.openai.base_url: http://localhost:8000/v1 in ~/.hermes/config.yaml
  2. Run hermes chat -q "Say hello" with TTS enabled — requests should go to the custom endpoint
  3. Without base_url set, behavior is identical to before

Platform

Tested on macOS.

Copilot AI review requested due to automatic review settings March 19, 2026 15:49
@hanai hanai marked this pull request as draft March 19, 2026 15:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurability to the OpenAI TTS provider so Hermes can target self-hosted / OpenAI-compatible TTS endpoints via tts.openai.base_url in ~/.hermes/config.yaml, while preserving the existing default behavior.

Changes:

  • Read tts.openai.base_url from config and pass it to the OpenAI client in the OpenAI TTS provider.
  • Document TTS configuration (including OpenAI base_url) in cli-config.yaml.example.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tools/tts_tool.py Plumbs base_url from tts.openai config into the OpenAI client initialization.
cli-config.yaml.example Adds a commented example block showing TTS configuration, including OpenAI base_url.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Allow users to configure a custom base_url for the OpenAI TTS provider
in ~/.hermes/config.yaml under tts.openai.base_url. Defaults to the
official OpenAI endpoint. Enables use of self-hosted or OpenAI-compatible
TTS services (e.g. http://localhost:8000/v1).

Also adds a TTS configuration example block to cli-config.yaml.example.
@hanai hanai force-pushed the feat/openai-tts-base-url branch from 532cbdc to 116984f Compare March 19, 2026 15:55
@hanai hanai marked this pull request as ready for review March 19, 2026 16:01
@teknium1 teknium1 merged commit efa7536 into NousResearch:main Mar 19, 2026
@hanai hanai deleted the feat/openai-tts-base-url branch March 20, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants