Skip to content

Configuration

The hermes-bridge service is configured entirely through environment variables. Required values are validated on startup — a missing or malformed value fails fast with a descriptive error rather than starting in a broken state.

VariableRequiredDefaultDescription
DONUT_BOT_TOKENThe bridged bot’s donutbot_… token.
DONUT_STREAM_URLBot event WebSocket URL, e.g. wss://api.donutchat.com/bots/v1/stream.
DONUT_SEND_URLBot send API URL, e.g. https://api.donutchat.com/bots/v1/messages.
DONUT_TYPING_URLoptional(empty)Typing-indicator URL, e.g. https://api.donutchat.com/bots/v1/typing. Empty disables the thinking indicator.
BRIDGE_REPLY_CONTENT_TYPEoptionalMDContent type for posted replies — MD (markdown) or TX (plain text).
VariableRequiredDefaultDescription
HERMES_BASE_URLBase URL of the Hermes OpenAI-compatible API server, e.g. http://hermes-host:8642. Keep it private.
HERMES_API_KEYAPI key for the Hermes API server (API_SERVER_KEY on the Hermes box).
HERMES_MODELoptionalhermesModel name passed to /v1/chat/completions.
BRIDGE_SYSTEM_PROMPToptional(empty)System prompt prepended to each conversation.
VariableRequiredDefaultDescription
BRIDGE_MAX_CONCURRENToptional4Max parallel Hermes calls across chats. Must be ≥ 1. Within a single chat, messages are always serialized.
BRIDGE_REQUEST_TIMEOUToptional120sPer-call timeout for a Hermes request. Go duration syntax (e.g. 90s, 2m). Must be positive.
BRIDGE_RESPOND_TO_BOTSoptionalfalseWhen false, the bridge ignores messages from other bots/webhooks/feeds — a loop guard. Set true only if you intentionally want bot-to-bot replies.
VariableRequiredDefaultDescription
BRIDGE_BREAKER_THRESHOLDoptional3Consecutive Hermes failures that open the circuit breaker. Must be ≥ 1.
BRIDGE_BREAKER_COOLDOWNoptional60sHow long the breaker stays open before admitting one probe. Go duration syntax. Must be positive.
BRIDGE_FALLBACK_MESSAGEoptional⚠️ The agent is unavailable right now. Please try again later.Posted to a chat (rate-limited) when the breaker is open. Must be non-empty and ≤ 4000 bytes.

On startup the bridge rejects:

  • Any missing required variable (DONUT_BOT_TOKEN, DONUT_STREAM_URL, DONUT_SEND_URL, HERMES_BASE_URL, HERMES_API_KEY).
  • BRIDGE_MAX_CONCURRENT or BRIDGE_BREAKER_THRESHOLD less than 1.
  • A non-positive BRIDGE_REQUEST_TIMEOUT or BRIDGE_BREAKER_COOLDOWN.
  • A malformed integer / boolean / duration for any typed variable.
  • An empty or over-4000-byte BRIDGE_FALLBACK_MESSAGE.

When deploying via infra/, these map onto the environment above:

Terraform variableMaps toNotes
hermes_bridge_enabled(deploy toggle)false by default; set true to create the service + secret.
hermes_bridge_bot_tokenDONUT_BOT_TOKENSensitive → Secrets Manager.
hermes_bridge_api_keyHERMES_API_KEYSensitive → Secrets Manager.
hermes_bridge_stream_urlDONUT_STREAM_URLPlain env var.
hermes_bridge_send_urlDONUT_SEND_URLPlain env var.
hermes_bridge_typing_urlDONUT_TYPING_URLPlain env var.
hermes_bridge_hermes_base_urlHERMES_BASE_URLPlain env var; use a private address.
hermes_bridge_modelHERMES_MODELPlain env var.