Model and provider selection Independent guide
Hermes Agent models and providers
Choose a provider path and model, connect credentials, set routing and fallbacks, and verify that tool calling actually works.
Pick a provider path by answering three questions in order: can you authenticate it today, does it serve a model with
at least 64,000 tokens of context and working tool calling, and is sending your prompt data there acceptable? Run
hermes model to connect it, then verify with a task that forces a real tool call — not with a greeting.
Checked against Hermes Agent v0.20.5 on . Re-check when a provider is added or removed, an environment variable name changes, or the documented minimum context requirement changes.
Choose a Hermes Agent model and provider
Hermes Agent ships no model. It calls whichever provider you configure, so this choice determines quality, cost, and data flow all at once.
The decision in three steps:
- Authentication. Pick something you can log into or hold a key for today. One working provider beats three half-configured ones.
- Capability. The model must handle tool calling and at least 64,000 tokens of context. Below that, agent runs fail in confusing ways.
- Data flow. A hosted API receives your prompts and tool output. A local endpoint does not leave your machine.
hermes modelExpected result: An interactive provider list; selecting one writes the provider and model into your configuration.
Source: Nous Research AI Providers documentation, checked 25 August 2026
Provider categories and requirements
Four categories, and the difference between them is what you must supply.
- Aggregated subscription. Nous Portal authenticates through OAuth and reaches 300+ models plus a hosted tool
gateway, with no per-provider keys to manage.
hermes setup --portalwires it in one command. - Direct vendor APIs. Anthropic, OpenAI, Google Gemini, xAI, DeepSeek, Mistral and others take an API key in
~/.hermes/.envor an OAuth login. You manage each key separately. - Routers and gateways. OpenRouter and similar services put one key in front of many models, with their own routing and fallback behaviour.
- Local and self-hosted endpoints. Ollama, vLLM, SGLang, llama.cpp, and LM Studio are configured as a
customprovider with abase_url. Nothing leaves your machine, and you own the context and tool-calling flags.
Cloud platform paths — AWS Bedrock, Google Vertex AI, Azure AI Foundry — sit inside the direct-vendor category but authenticate through their platform's own credential chain.
Compare by task quality, tool use, context, cost, and privacy
| Provider path | Setup | Tool use | Context | Cost basis | Data flow |
|---|---|---|---|---|---|
| Nous Portal | OAuth login via hermes setup --portal; refresh token stored in auth.json | Yes, plus a hosted tool gateway for search, images, TTS, and browser | Model-dependent; 300+ models available | Subscription with monthly credits, billed by Nous Research | Prompts go to Nous Portal and the upstream model provider |
| Direct vendor API | Provider API key in ~/.hermes/.env, or an OAuth flow where offered | Yes on current tool-calling models | Model-dependent; must meet the 64,000-token minimum | Usage-based, billed by that vendor | Prompts go to that vendor |
| Router (for example OpenRouter) | One API key in ~/.hermes/.env | Yes; routing and fallback chains are supported | Model-dependent | Usage-based, billed by the router | Prompts pass through the router to the upstream provider |
| Local or self-hosted endpoint | provider: custom plus a base_url; server flags set by you | Only if the server is started with tool-calling enabled | Whatever you configure; must be raised to at least 64,000 | Your hardware and electricity | Stays on your machine or network |
Source: Nous Research AI Providers and Nous Portal documentation, checked 25 August 2026 against v0.20.5. No provider is ranked here: the right one depends on your authentication, budget, and data constraints.
Configure provider credentials
Keys belong in ~/.hermes/.env, never in config.yaml. hermes config set routes recognised secret keys there
automatically:
hermes config set OPENROUTER_API_KEY YOUR_KEY_HEREExpected result: The key is written to ~/.hermes/.env and used for subsequent runs.
Substitute your own key. Prefer exporting it into the shell or editing the file directly so the secret does not persist in shell history.
Source: Nous Research Configuration and AI Providers documentation, checked 25 August 2026
Documented environment-variable names differ per provider — for example OPENROUTER_API_KEY, ANTHROPIC_API_KEY,
OPENAI_API_KEY, GOOGLE_API_KEY or GEMINI_API_KEY, DEEPSEEK_API_KEY, XAI_API_KEY. OAuth-based providers
store their credentials in ~/.hermes/auth.json instead.
Restrict the file, and treat key rotation as routine. How those credentials are then exposed to containers, MCP subprocesses, and skills is covered under provider credential security.
Review provider credential securitySelect and switch models
- Persistently: set
model.providerandmodel.nameinconfig.yaml, or re-runhermes model. - For one run: pass the model on the command line.
- Mid-session: the
/modelslash command switches between providers you have already configured. It cannot add a new one — exit and runhermes modelfor that.
Two cost-relevant behaviours are worth knowing. Switching model inside a live conversation means the next message
re-reads the whole conversation at full input price. And auxiliary tasks can be pointed at a cheaper model under the
auxiliary: block rather than paying main-model rates for title generation and compression.
Which of those choices actually moves your bill is covered by provider cost components.
Use local or custom endpoints
Any OpenAI-compatible endpoint works through the custom provider:
model:
provider: custom
base_url: http://localhost:8000/v1
name: <model-id>
context_length: 64000
The two failure modes are always the same, and both are on the server side:
- Context too small. Ollama in particular defaults well below the requirement; the documented fix is to start it
with
OLLAMA_CONTEXT_LENGTH=64000, or set the equivalent flag for your server (--max-model-lenon vLLM,--context-lengthon SGLang,-c 64000on llama.cpp). - Tool calling not enabled. vLLM needs
--enable-auto-tool-choicewith a--tool-call-parser; llama.cpp needs--jinja. Without those, the agent looks broken while the model is simply answering in prose.
Running several local endpoints side by side
Named custom providers let one installation address multiple endpoints, each with its own base URL and optional key
environment variable, and /model custom:<name>:<model> switches between them. Source: Nous Research AI Providers
documentation, checked 25 August 2026.
Set fallbacks and limits
A single provider outage should not end a run. Fallback providers are declared as an ordered list and tried when the primary model errors:
fallback_providers:
- provider: openrouter
model: <model-id>
- provider: anthropic
model: <model-id>
Related controls: providers.<name>.request_timeout_seconds for slow endpoints, agent.api_max_retries for how many
attempts happen before falling back, and agent.run_budget_seconds to cap a run by wall-clock time.
Verify model and tool behavior
A greeting proves nothing. Verify with all four:
-
hermes config get modelreturns the provider and model you intended. - A one-shot prompt returns a response without an authentication error.
- A task that requires a tool actually shows a tool call in the interface.
- A long input does not immediately fail with a context error, which would mean the context limit is lower than the agent needs.
The end-to-end version of this check — a bounded task with a checkable artifact — is owned by verify first model response.
Fix provider errors
| Symptom | Suspect component | Check | Expected result | If it still fails |
|---|---|---|---|---|
| Authentication rejected or 401 | Credential in .env or auth.json | hermes model, then reselect the provider | The provider authenticates and a model list appears | Rotate the key at the provider and set it again |
| Model not found or unavailable | Model identifier format | hermes model to list what the provider actually offers | The identifier matches one the provider serves | Check the provider's identifier format — several require an org or family prefix |
| 429 rate limited | Provider quota | Retry after a pause, or switch to an alternative provider | Requests succeed at a lower rate | Add a fallback provider or raise the plan limit |
| Context length exceeded | Model context window or detection | Compress the session, or set context_length explicitly in config.yaml | Long sessions run without an immediate error | Move to a larger-context model, or raise the local server's context flag |
| The model answers in prose instead of calling tools | Tool calling on the endpoint | Confirm the server was started with tool-calling flags enabled | Tool activity appears in the interface | Choose a model documented to support tool calling on that provider |
| Only one provider appears under /model | Configured provider list | Exit the session and run hermes model from the terminal | New providers can be added there | Confirm the second provider's credential is actually set |
Source: Nous Research FAQ and Troubleshooting, checked 25 August 2026 against v0.20.5.