Hermes OpenRouter Model Naming Convention

Summary

This law dictates the specific string format required for model identifiers when configuring the Hermes agent to use the OpenRouter provider. It establishes that the openrouter/ prefix, common in LiteLLM configurations, must be omitted in Hermes to avoid 400 routing errors.

Details

In the Hermes agent configuration, a specific naming convention must be followed for model identifiers when utilizing OpenRouter as the backend provider. A common point of failure identified in system logs involves developers or automated scripts assuming Hermes follows the LiteLLM convention of prefixing model IDs with the provider name (e.g., openrouter/nousresearch/hermes-3-llama-3.1-405b).

Within the Hermes architecture, provider routing is handled internally. When the configuration specifies provider: "openrouter", the Hermes internal logic automatically manages the authentication headers and the base URL targeting OpenRouter’s API endpoints. Because Hermes handles the routing logic at the provider level, the model field must strictly contain the model slug as defined by OpenRouter, without any additional prefixes.

Error Case

An attempt to use a prefixed model ID results in a 400 Bad Request error. The API returns a message indicating that the prefixed string is not a valid model ID (e.g., openrouter/nousresearch/hermes-4-70b is not a valid model ID).

Correct Configuration

To ensure successful LLM initialization, the model field should be formatted as follows:

  • Provider: openrouter
  • Model: [author]/[model-name] (e.g., nousresearch/hermes-4-70b)

This distinction is critical for the stability of the nix-hermes module deployments and ensures that the agent can successfully initialize its LLM backend without encountering invalid model ID errors during the handshake with OpenRouter.