# Hermes Agent

Connect Hermes Agent through a named OpenAI-compatible provider while preserving Laminarity routing.

> Verification: source-checked; checked 2026-09-01; Hermes Agent custom provider

## Store the key

Put the Laminarity key in Hermes' private environment file. Do not place the key directly in `config.yaml`.

```dotenv
# ~/.hermes/.env
LAMINARITY_API_KEY=pr-...
```

## Configure the provider

Define a named custom provider and explicitly select the Chat Completions transport. This prevents Hermes from guessing a different OpenAI API mode from the model name.

```yaml
# ~/.hermes/config.yaml
providers:
  laminarity:
    api: https://api.laminarity.ai/v1
    key_env: LAMINARITY_API_KEY
    transport: chat_completions
    default_model: auto

model:
  default: auto
  provider: custom:laminarity
  context_length: 64000
  # Enable if this agent should send images through Laminarity:
  # supports_vision: true
```

> Note: `context_length` controls Hermes history and compression. It is not a Laminarity API limit; 64,000 is a conservative starting value for the virtual `auto` model.

## Verify the connection

Check model access first, then Hermes' local configuration, then a basic chat, and finally a tool-using prompt.

```bash
curl https://api.laminarity.ai/v1/models \
  -H "Authorization: Bearer $LAMINARITY_API_KEY"

hermes doctor
hermes chat -q "Reply with exactly: Laminarity connected"
```

## Routing and fallback

`custom:laminarity:auto` keeps Laminarity routing and provider fallback enabled. Selecting a concrete model such as `custom:laminarity:gpt-5.4` pins the request and disables Laminarity routing and fallback.

Avoid adding a second Hermes fallback layer initially. If Hermes auxiliary tasks must also use Laminarity, set their provider to `main` in the Hermes configuration.

> Note: This configuration is based on the current Hermes provider schema. Run the verification flow against staging before treating a particular Hermes release as production-certified.

## Troubleshooting

A `401` usually means the key or `/v1` base URL is wrong. A `402` means the balance or key spend cap was exceeded. A `404 model_not_found` means the model is unknown or excluded by project policy—run `/v1/models` again. A `429` indicates the account rate limit was reached.

## Upstream documentation

- [Hermes custom providers](https://hermes-agent.nousresearch.com/docs/integrations/providers)
- [Hermes configuration](https://hermes-agent.nousresearch.com/docs/user-guide/configuration/)
- [Hermes verification quickstart](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/)
