Hermes Agent Model Configuration: DeepSeek, Ollama, Claude & OpenRouter
Quick Answer
hermes setup— interactive first-time configuration: pick a provider, enter your API key, and you’re done.hermes model— terminal provider/auth/model setup./model— switch among already-configured models inside an active Hermes chat.~/.hermes/config.yaml— non-secret settings, including the persistent model configuration.~/.hermes/.env— where API keys and secrets live (never inconfig.yaml).
The full flow in three commands:
hermes setup # guided first-time setup (provider + API key)hermes model # provider/auth/model setupcat ~/.hermes/config.yaml # see the persistent model configThe Problem: Too Many LLM Providers, Confusing Configuration
Hermes Agent supports many LLM backends—DeepSeek, Ollama, Claude, OpenRouter, and more. Each provider has different setup requirements, different API key locations, and different model name formats.
I made several mistakes:
- Put the API key in the wrong file
- Used incorrect model name prefixes
- Forgot to start Ollama before configuring it
These mistakes cost me hours of debugging. Let me save you that time.
How Model Configuration Is Stored
Hermes Agent separates two concerns:
- Model and provider settings (non-secret) live in
~/.hermes/config.yaml. - API keys and secrets live in
~/.hermes/.env— a plain file that should never be committed to Git.
model: provider: anthropic default: claude-sonnet-4-6ANTHROPIC_API_KEY=sk-ant-your-key-hereYou can open the config file with hermes config edit or edit ~/.hermes/config.yaml directly. In the YAML, the model is a nested block: provider selects the backend and default is the model name on that provider. hermes config set model <provider>/<model> is a convenient CLI shortcut that writes to this structure, but the provider/model string is not the underlying single source of truth.
Provider Configuration
The setup differs by authentication flow: API-key providers (DeepSeek, Claude, OpenRouter) need a key in ~/.hermes/.env; OAuth providers authenticate interactively through hermes model; local/custom endpoints (Ollama) need no key at all. After configuring, verify with hermes chat.
DeepSeek
hermes config set model deepseek/deepseek-chatDEEPSEEK_API_KEY=sk-your-key-hereModel IDs change over time, so treat deepseek-chat as an example and verify the current model IDs in the provider catalog (for example, the DeepSeek Platform) before configuring. DeepSeek is popular for its low cost, but the setup is identical to any other API-key provider.
Ollama (Local)
ollama serve # start the Ollama server FIRSThermes model # then pick Custom endpoint → http://localhost:11434/v1Ollama runs models locally: zero API fees, full privacy, and offline support. Configure it by starting ollama serve, then running hermes model and choosing Custom endpoint with http://localhost:11434/v1. No API key is needed for local models.
Claude
hermes config set model anthropic/claude-sonnet-4-6ANTHROPIC_API_KEY=sk-ant-your-key-hereOpenRouter
hermes config set model openrouter/anthropic/claude-sonnet-4-6OPENROUTER_API_KEY=sk-or-your-key-hereOpenRouter fronts many providers behind one API key, so you can switch models without changing keys — just update the model name.
How to Change the Model in Hermes Agent
This is the flow I use most. There are a few ways to change the model.
1. Terminal setup
hermes modelhermes model is the terminal provider/auth/model setup: it walks you through choosing a provider, entering your API key (or a custom endpoint such as Ollama’s), and selecting the model. Your choice is saved to ~/.hermes/config.yaml.
2. /model inside a chat
Inside an active Hermes chat, /model switches among already-configured models without leaving the session. It’s the quickest way to hop between models once everything is set up.
3. Direct command
hermes config set model openrouter/anthropic/claude-sonnet-4-6hermes config set model <provider>/<model> is a convenient CLI shortcut where supported — it writes the same provider/default block into ~/.hermes/config.yaml. For local models, use hermes model and pick Custom endpoint → http://localhost:11434/v1 instead.
Check the current model
hermes configcat ~/.hermes/config.yamlWhen you change providers, make sure the matching API key exists in ~/.hermes/.env (see below).
API Key Configuration
API keys go in ~/.hermes/.env — not in config.yaml. I learned this the hard way when I almost committed my key to Git. Hermes writes secret values to ~/.hermes/.env automatically when you run hermes setup or hermes config set <ENV_VAR> <value>:
hermes config set OPENROUTER_API_KEY sk-or-your-key-hereOr edit the file directly:
mkdir -p ~/.hermesecho 'DEEPSEEK_API_KEY=sk-your-key-here' >> ~/.hermes/.envEach provider needs its own key:
| Provider | Env var |
|---|---|
| DeepSeek | DEEPSEEK_API_KEY |
| Claude | ANTHROPIC_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Ollama | none (local models only) |
Auxiliary Models (Optional)
Hermes also uses separate models for side tasks like vision/image analysis and web content extraction. The defaults work fine for most people, so you usually don’t need to touch this. If you do want to customize, hermes model → Configure auxiliary models is easier than manually editing YAML. In config.yaml, each auxiliary task uses its own provider and model (note: auxiliary tasks use model, not default):
auxiliary: vision: provider: openrouter model: google/gemini-2.5-flashDelegation is configured separately with the top-level delegation.provider / delegation.model, not under auxiliary.
Setting a cheap model for side tasks keeps them from burning through your premium provider budget.
Troubleshooting
Unknown model or provider
If Hermes reports an unknown provider, check the model name for typos and make sure the provider prefix is present:
hermes config set model deepseek/deepseek-chat # correcthermes config set model deepseek-chat # missing provider prefixMissing API key
If you see a missing API key error, the key for that provider isn’t in ~/.hermes/.env. Add it — hermes config set <ENV_VAR> <value> writes it to ~/.hermes/.env automatically — and restart Hermes:
hermes config set DEEPSEEK_API_KEY sk-your-key-hereOllama connection refused
A connection refused error almost always means the Ollama server isn’t running:
ollama serveKeep ollama serve running in its own terminal, then retry. If the model isn’t downloaded yet, fetch it first:
ollama pull llama3.3Also make sure Hermes is pointed at Ollama’s custom endpoint (hermes model → Custom endpoint → http://localhost:11434/v1).
Ollama context window too small
Hermes Agent requires models with at least a 64K context window. A local model may run successfully in Ollama but still be rejected by Hermes if its configured context is too small. Check the model’s configured context size on the Ollama side before using it with Hermes.
Invalid model name
The model name must exist on the provider you picked. Model IDs change over time, so verify the current ones against the provider’s catalog — for example deepseek/deepseek-chat and anthropic/claude-sonnet-4-6 are valid, while a made-up name will fail. On OpenRouter, keep the vendor prefix: openrouter/anthropic/claude-sonnet-4-6, not openrouter/claude-sonnet-4-6.
Verifying Your Configuration
After any change, verify:
# Show current confighermes config
# Check environment variablescat ~/.hermes/.env
# Test the connectionhermes chat "Hello, are you working?"Summary
Configuring Hermes Agent with different LLM providers is straightforward once you know where things live. Non-secret model/provider settings go in ~/.hermes/config.yaml (set them with hermes model or hermes config set model provider/model), API keys and secrets go in ~/.hermes/.env, hermes setup handles first-time configuration, and /model switches models inside an active chat. Use this checklist:
- Model config →
~/.hermes/config.yaml(viahermes modelorhermes config set model <provider>/<model>) - API keys →
~/.hermes/.env(viahermes setup,hermes config set <ENV_VAR> ..., or direct edit) - Change model →
hermes model, or/modelinside a chat, orhermes config set model ... - Ollama → start
ollama serve, thenhermes model→ Custom endpoint →http://localhost:11434/v1
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
- 👨💻 Hermes Agent GitHub
- 👨💻 Ollama
- 👨💻 DeepSeek Platform
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments