0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

(Hermes Agent) OpenAI API の BASE_URL を TTS とチャットで分けた件

0
Last updated at Posted at 2026-11-13

課題

  • Hermes Agent で OpenAI 互換の TTS サービスとテキスト生成のベース URL が分けられない

参考:
https://github.com/NousResearch/hermes-agent/pull/326
TTS_OPENAI_BASE_URLだァ?ねえよそんなもん
( STT_OPENAI_BASE_URL はあるのに.. )

対象となる方

  • Hermes で OpenAI API (or互換API)を使っている方
  • TTS(Text To Speech)とテキスト生成で別のサービスを使いたい方

対策

  • nginx を経由して
    • 音声合成系を TTS コンテナへ
    • チャット系/その他を LLM へ流す

■ 具体的な対応
経由する nginx の定義ファイルにて、以下の様に設定します。
Hermes Agent は、この http://nginx:11435 を OPENAI_BASE_URL として指定します。
以下のようなホスト名を想定しています

ホスト ポート サービス エンドポイント
tts 8080 文字読み上げ /v1/audio/speech
llm 11434 OpenAI API 互換 LLM API /v1/responses, /v1/chat/completions
default.conf
# OpenAI API 互換サービスの中継(内部処理用)
server {
    listen 11435; # このサービスの待ち受けポート
  
    proxy_http_version 1.1;
    proxy_set_header Host $host;

    # TTS(音声合成): tts へ
    location /v1/audio/speech {
        proxy_pass http://tts:8080;
    }

    # チャットの転送(1): llm へ
    location /v1/chat/completions {
        proxy_pass http://llm:11434;      
    }

    # チャットの転送(2): llm へ
    location /v1/responses {
        proxy_pass http://llm:11434;      
    }

    # その他の全ての通信は LLM サーバーへ
    # 記載せずに通信ブロックも可
    location / {
        proxy_pass http://llm:11434;      
    }
}

appendix: バージョン等について

いずれも Docker にて管理

$ docker images --digests | grep nousresearch/hermes-agent
nousresearch/hermes-agent       latest          sha256:276d44685c65c0cb2a25f190b63c65c8906f9dc76486fb1c05ae71b5826bda08   276d44685c65   XXX days ago     4.56GB
$ docker images --digests | grep nginx
nginx                           latest          sha256:165ddde8751e75a1c907d24ef10d9f6deb08b57e0fe56caf67512486aff76d82   165ddde8751e   XXX days ago     243MB

筆者のアーキテクチャ(参考用)

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?