Hermes Agent AI Providers: Configuring Inference Endpoints
Connect Hermes Agent to 30+ LLM providers via API keys, OAuth, or self-hosted endpoints.

Hermes Agent Provider Configuration Reference
This document describes how to configure inference providers for Hermes Agent, enabling LLM connectivity through cloud APIs, self-hosted endpoints, or custom routing. At least one provider must be configured before Hermes Agent can be used.
When to Use This Guide
- Initial setup of Hermes Agent (at least one provider required)
- Adding a new LLM provider (cloud, self-hosted, or custom endpoint)
- Switching between providers or models interactively
- Setting up fallback or multi-provider routing for reliability or cost optimization
- Configuring local inference servers (Ollama, vLLM, SGLang, llama.cpp, LM Studio) for use with Hermes
- Integrating with enterprise or Chinese AI model providers
- Enabling OAuth-based authentication for providers like Nous Portal, GitHub Copilot, Anthropic, xAI, Qwen, MiniMax
Prerequisites
- Hermes Agent installed and configured with a
~/.hermes/directory that exists - For cloud providers: a valid API key or OAuth credentials
- For local servers: server software installed and running (Ollama, vLLM, SGLang, llama.cpp, LM Studio)
- For WSL2: Windows 11 22H2+ (mirrored mode) or Windows 10/older (NAT mode with host IP)
- For AWS Bedrock: AWS credentials configured (boto3 chain: env vars,
~/.aws/credentials, IAM role, etc.) - For Google Vertex AI: a service-account JSON file or Application Default Credentials (ADC) configured
- For Nous Portal: an active subscription at portal.nousresearch.com/manage-subscription
- For Anthropic OAuth: a Claude Max plan with purchased extra usage credits
- For xAI Grok OAuth: a SuperGrok or X Premium+ subscription
- For GitHub Copilot: an active GitHub Copilot subscription
- For self-hosted Firecrawl: Docker installed, approximately 4-8 GB RAM available
- For ClawRouter: a USDC-funded wallet on Base or Solana
- For Hugging Face Inference Providers: an HF token with "Make calls to Inference Providers" permission enabled
- For local servers: sufficient VRAM or RAM for the model and context length (at least 64,000 tokens)
- For tool calling on local servers: the server must support tool calling (check server documentation and flags)
- For vision-capable models on custom endpoints: set
model.supports_vision: truein config
Capabilities
Hermes Agent supports over 30 built-in providers, including OpenRouter, Anthropic, GitHub Copilot, Fireworks AI, NovitaAI, z.ai/GLM, Kimi/Moonshot, Arcee AI, GMI Cloud, MiniMax, xAI, Qwen Cloud, Alibaba Cloud, Kilo Code, Xiaomi MiMo, Tencent TokenHub, OpenCode, DeepSeek, Hugging Face, Google/Gemini, Google Vertex AI, OpenAI API, Azure AI Foundry, AWS Bedrock, NVIDIA NIM, Ollama Cloud, StepFun, and LM Studio.
Custom OpenAI-compatible endpoints are supported for any server implementing the /v1/chat/completions endpoint. OAuth-based authentication is available for Nous Portal, GitHub Copilot, Anthropic, xAI Grok, Qwen, and MiniMax. API-key-based authentication works for most cloud providers.
Named custom providers allow multiple endpoints to be configured with unique names. Fallback provider chains let you specify a primary provider and backup providers that activate on failure. Provider routing through OpenRouter supports sorting by price, throughput, or latency, with filtering and ordering options. The OpenRouter Pareto Code router provides cost-quality optimization.
Context length auto-detection pulls from multiple sources: configuration, endpoint API, model metadata, and a community registry. Tool calling on local servers requires server-side flags. Vision-capable models are supported natively through the supports_vision flag. The extra_body field allows provider-specific request parameters.
WSL2 networking supports mirrored mode or NAT mode with host IP. Self-hosted Firecrawl provides web scraping without an API key or rate limits. Auxiliary model routing uses a separate model for vision, web summarization, or Mixture of Agents (MoA). The Nous Tool Gateway provides web search, image generation, TTS, and browser automation for paid subscribers.
xAI prompt caching activates automatically through the x-grok-conv-id header. xAI also provides a web search backend. Claude Code credential auto-detection works for the Anthropic provider. GitHub Copilot ACP mode spawns a local copilot CLI subprocess. JWT authentication for Nous Portal is automatic with transparent rotation.
Device-code OAuth is supported for OpenAI Codex and GitHub Copilot. Credential quarantine prevents replay loops for revoked tokens. One-shot credential recovery on HTTP 401 works for GitHub Copilot. Model migration handles retired xAI models through the hermes migrate xai command.
Context length can be overridden per provider or per model. Provider entries can be disabled without deletion using the enabled: false flag. SSL CA certificate and verify options are available for custom endpoints. Dynamic model discovery from an endpoint's /v1/models API is supported.
Interactive provider setup uses the hermes model command. Mid-session model switching uses the /model command, but only for already-configured providers. Persistent configuration is stored in ~/.hermes/config.yaml and ~/.hermes/.env. Legacy config formats are auto-migrated to config v12.
Provider Configuration Methods
Adding a Cloud Provider via API Key
- Set the required environment variable in
~/.hermes/.env. For example,OPENROUTER_API_KEY,FIREWORKS_API_KEY, and similar variables for other providers. - Run
hermes chat --provider <provider_id> --model <model_id>. For example:hermes chat --provider fireworks --model accounts/fireworks/models/kimi-k2p6. - Alternatively, set the provider permanently in
~/.hermes/config.yamlunder themodel:section withprovider:anddefault:keys.
Adding a Provider via OAuth (Interactive)
- Run
hermes modelfrom your terminal, outside any chat session. - Select the desired provider from the list. Options include Nous Portal, GitHub Copilot, Anthropic, xAI Grok OAuth, Qwen OAuth, and MiniMax OAuth.
- Follow the browser-based OAuth login flow if one appears.
- Confirm that credentials are saved, usually to
~/.hermes/auth.json. - Start a new chat session with
hermes chat.
Configuring a Custom Endpoint (Interactive)
- Run
hermes modelfrom your terminal. - Select "Custom endpoint (self-hosted / VLLM / etc.)".
- Enter the API base URL, for example
http://localhost:11434/v1. - Enter the API key, or leave it blank for local servers.
- Enter the model name, or leave it blank for auto-detection if only one model is loaded.
- Optionally set the context length when prompted.
- The configuration is saved to
~/.hermes/config.yaml.
Configuring a Named Custom Provider (Manual)
- Edit
~/.hermes/config.yaml. - Add a
providers:dictionary entry with a unique name, such aslocal,work, oranthropic-proxy. - Set
api(base URL),key_envorapi_key,transport(one ofchat_completions,anthropic_messages, orcodex_responses), and optional fields likedefault_model,models,context_length, andextra_body. - Set
model.providertocustom:<name>, for examplecustom:local. - Set
model.defaultto the desired model ID. - Save the file and start a new chat session.
Switching Providers Mid-Session
- Inside an active Hermes chat session, type
/model <provider>:<model>. For example:/model openrouter:claude-sonnet-4. - For named custom providers, use triple syntax:
/model custom:<name>:<model>. For example:/model custom:local:qwen-2.5. - The
/modelcommand can only switch between already-configured providers. To add a new provider, exit the session with Ctrl+C or/quit, runhermes model, then start a new session.
Setting Up Fallback Providers
- Edit
~/.hermes/config.yaml. - Add a
fallback_providers:list with entries containingproviderandmodel, and optionallybase_urlandapi_mode. - Alternatively, use the legacy
fallback_model:dictionary with a single provider and model pair. - Fallback activates one-shot per session on primary failure (rate limit, server error, auth failure).
- The chain is tried entry-by-entry, and the conversation is preserved.
Configuring OpenRouter Provider Routing
- Edit
~/.hermes/config.yaml. - Add a
provider_routing:section with options:sort(price, throughput, latency),only,ignore,order,require_parameters, anddata_collection. - Alternatively, append
:nitro(for throughput) or:floor(for price) to the model name in the chat command. - For the Pareto Code router, set
model.modeltoopenrouter/pareto-codeand optionally setopenrouter.min_coding_scoreto a value between 0.0 and 1.0.
Local Inference Server Configuration
Setting Up Ollama for Local Models
- Install Ollama and pull a model:
ollama pull qwen2.5-coder:32b. - Start the Ollama server:
ollama serve. - Configure Hermes by running
hermes model, selecting "Custom endpoint", entering the URLhttp://localhost:11434/v1, leaving the API key blank, and providing the model name. - Ensure the context length is at least 64,000 tokens. Set this via the
OLLAMA_CONTEXT_LENGTHenvironment variable, a systemd override, or a Modelfile. - Verify the context with
ollama ps.
Ollama defaults to very low context lengths: 4,096 tokens for systems with less than 24 GB VRAM, 32,768 tokens for 24-48 GB, and 256,000 tokens for systems with more than 48 GB VRAM. Hermes requires at least 64,000 tokens, so you must explicitly configure this.
Setting Up vLLM for Production GPU Serving
- Install vLLM:
pip install vllm. - Start the server:
vllm serve <model> --port 8000 --max-model-len 65536 --tensor-parallel-size 2 --enable-auto-tool-choice --tool-call-parser hermes. - Configure Hermes by running
hermes model, selecting "Custom endpoint", entering the URLhttp://localhost:8000/v1, optionally providing an API key, and entering the model name. - Ensure tool calling flags are set:
--enable-auto-tool-choiceand--tool-call-parser.
vLLM supports human-readable sizes: 64k equals 64,000, and 64K equals 65,536.
Setting Up SGLang for Fast Serving
- Install SGLang:
pip install 'sglang[all]'. - Start the server:
python -m sglang.launch_server --model <model> --port 30000 --context-length 65536 --tp 2 --tool-call-parser qwen. - Configure Hermes by running
hermes model, selecting "Custom endpoint", entering the URLhttp://localhost:30000/v1, and providing the model name. - Set
--default-max-tokenson the server to avoid truncated responses, since SGLang defaults to 128 max output tokens.
Setting Up llama.cpp for CPU or Metal Inference
- Build llama.cpp and start the server:
./build/bin/llama-server --jinja -fa -c 64000 -ngl 99 -m <model.gguf> --port 8080 --host 0.0.0.0. - Configure Hermes by running
hermes model, selecting "Custom endpoint", entering the URLhttp://localhost:8080/v1, leaving the API key blank, and providing the model name (or leaving it blank for auto-detection). - Ensure the
--jinjaflag is present for tool calling support. - Verify tool support by checking
http://localhost:8080/props; thechat_templatefield should be present.
The context length flag -c defaults to 0, which reads the model's training context. This may cause out-of-memory errors for 128k+ models, so set it explicitly to at least 64,000. Parallel slots (-np) divide the context among slots, and each slot must have at least 64,000 tokens.
Setting Up LM Studio for Desktop Local Models
- Start the LM Studio server from the Developer tab by clicking "Start Server", or from the CLI with
lms server start. - Load a model with sufficient context:
lms load <model> --context-length 64000. - Configure Hermes by running
hermes model, selecting "LM Studio", accepting the default URLhttp://localhost:1234/v1, and picking the discovered model. - Optionally set
LM_API_KEYif server authentication is enabled. - For Just-In-Time loading, run:
hermes config set model.lmstudio_load_mode jit. - To change the context length in the LM Studio GUI, click the gear icon, set "Context Length" to at least 64,000, and reload the model.
WSL2 Networking for Windows-Hosted Model Servers
Option 1: Mirrored Mode (Windows 11 22H2+)
- Create or edit
%USERPROFILE%\\.wslconfigwith the following content:[wsl2] networkingMode=mirrored - Run
wsl --shutdownin PowerShell and reopen the WSL2 terminal.
Option 2: NAT Mode (Windows 10 or Older)
- Find the Windows host IP from WSL2:
ip route show | grep -i default | awk '{print $3}'. - Use that IP in the Hermes configuration, for example
base_url: http://172.29.192.1:11434/v1.
General Steps for Both Modes
- Ensure the model server binds to
0.0.0.0, not127.0.0.1. For NAT mode, setOLLAMA_HOST=0.0.0.0, enable "Serve on Network" in LM Studio, or add--host 0.0.0.0to llama-server or SGLang. - If connections still fail, add a Windows Firewall rule:
New-NetFirewallRule -DisplayName 'Allow WSL2 to Model Server' -Direction Inbound -Action Allow -Protocol TCP -LocalPort <PORT>. - Verify connectivity from WSL2:
curl http://<address>:<port>/v1/models.
Self-Hosted Firecrawl Configuration
- Clone the Firecrawl repository:
git clone https://github.com/firecrawl/firecrawl. - Change to the
firecrawldirectory and setUSE_DB_AUTHENTICATION=false,HOST=0.0.0.0, andPORT=3002in the.envfile. - Start the Docker stack:
docker compose up -d. This requires approximately 4-8 GB RAM. - Point Hermes to the self-hosted instance:
hermes config set FIRECRAWL_API_URL http://localhost:3002. No API key is needed unless authentication is enabled.
Self-hosted Firecrawl uses basic fetch with Playwright and does not include advanced anti-bot bypass. Search uses DuckDuckGo instead of Google.
xAI Model Migration
- Run
hermes migrate xaito preview recommended replacements in dry-run mode. - Run
hermes migrate xai --applyto rewrite~/.hermes/config.yamlin place. A backup file namedconfig.yaml.bak-pre-migrate-xai-*is created automatically.
xAI models grok-4*, grok-3, grok-code-fast-1, and grok-imagine-image-pro are retired on 2026-05-15. Use the migration command to update your configuration.
Environment Variables
API Keys
The following environment variables are used for API-key-based authentication. Set them in ~/.hermes/.env.
OPENROUTER_API_KEY- Required for OpenRouterANTHROPIC_API_KEY- Required for Anthropic API key path (pay-per-token)ANTHROPIC_TOKEN- Optional, alternative setup-token or manual OAuth token for AnthropicCOPILOT_GITHUB_TOKEN- Optional, first priority for GitHub Copilot API (falls back toGH_TOKEN,GITHUB_TOKEN,gh auth token)GH_TOKEN- Optional, second priority for GitHub Copilot APIGITHUB_TOKEN- Optional, third priority for GitHub Copilot APIFIREWORKS_API_KEY- Required for Fireworks AINOVITA_API_KEY- Required for NovitaAIGLM_API_KEY- Required for z.ai / GLMKIMI_API_KEY- Required for Kimi/Moonshot (international endpoint)KIMI_CN_API_KEY- Required for Kimi/Moonshot (China endpoint)ARCEEAI_API_KEY- Required for Arcee AIGMI_API_KEY- Required for GMI CloudMINIMAX_API_KEY- Required for MiniMax (global endpoint)MINIMAX_CN_API_KEY- Required for MiniMax (China endpoint)XAI_API_KEY- Required for xAI (Grok) Responses APIDASHSCOPE_API_KEY- Required for Qwen Cloud (Alibaba DashScope) and Alibaba Cloud Coding PlanKILOCODE_API_KEY- Required for Kilo CodeXIAOMI_API_KEY- Required for Xiaomi MiMoTOKENHUB_API_KEY- Required for Tencent TokenHubOPENCODE_ZEN_API_KEY- Required for OpenCode ZenOPENCODE_GO_API_KEY- Required for OpenCode GoDEEPSEEK_API_KEY- Required for DeepSeekHF_TOKEN- Required for Hugging Face (requires "Make calls to Inference Providers" permission)GOOGLE_API_KEYorGEMINI_API_KEY- Required for Google / GeminiOPENAI_API_KEY- Required for direct OpenAI API accessNVIDIA_API_KEY- Required for NVIDIA NIM (build.nvidia.com)STEPFUN_API_KEY- Required for StepFunOLLAMA_API_KEY- Required for Ollama Cloud
Cloud Provider Overrides
VERTEX_CREDENTIALS_PATH- Path to service-account JSON file for Google Vertex AI (alternative to ADC)VERTEX_PROJECT_ID- GCP project ID for Vertex AI (overrides config.yaml)VERTEX_REGION- GCP region for Vertex AI (overrides config.yaml)AWS_PROFILE- AWS named profile for Bedrock authentication (uses standard boto3 chain)AWS_REGION- AWS region for BedrockBEDROCK_BASE_URL- Non-default regional endpoint for BedrockHERMES_QWEN_BASE_URL- Override base URL for Qwen OAuth provider (default: https://portal.qwen.ai/v1)HERMES_COPILOT_ACP_COMMAND- Override Copilot CLI binary path (default: copilot)HERMES_COPILOT_ACP_ARGS- Override ACP args (default: --acp --stdio)NOVITA_BASE_URL- Override base URL for NovitaAIGLM_BASE_URL- Override base URL for z.ai/GLM (auto-detected if not set)KIMI_BASE_URL- Override base URL for Kimi/MoonshotMINIMAX_BASE_URL- Override base URL for MiniMax (global)MINIMAX_CN_BASE_URL- Override base URL for MiniMax (China)DASHSCOPE_BASE_URL- Override base URL for Qwen CloudXIAOMI_BASE_URL- Override base URL for Xiaomi MiMoGMI_BASE_URL- Override base URL for GMI Cloud (default: https://api.gmi-serving.com/v1)TOKENHUB_BASE_URL- Override base URL for Tencent TokenHubSTEPFUN_BASE_URL- Override base URL for StepFun (default: https://api.stepfun.com/v1)HF_BASE_URL- Override base URL for Hugging Face Inference ProvidersNVIDIA_BASE_URL- Override base URL for NVIDIA NIM (e.g., http://localhost:8000/v1 for local NIM)OPENAI_BASE_URL- Override base URL for openai-api provider only
Tool and Service API Keys
FIRECRAWL_API_KEY- API key for Firecrawl web scraping (optional for self-hosted)FIRECRAWL_API_URL- Base URL for Firecrawl instance (default: cloud API)BROWSERBASE_API_KEY- API key for Browserbase browser automationBROWSERBASE_PROJECT_ID- Project ID for BrowserbaseFAL_KEY- API key for FAL image generationELEVENLABS_API_KEY- API key for ElevenLabs premium TTSVOICE_TOOLS_OPENAI_KEY- API key for OpenAI TTS and voice transcriptionMISTRAL_API_KEY- API key for Mistral TTS and voice transcriptionHONCHO_API_KEY- API key for Honcho cross-session user modelingSUPERMEMORY_API_KEY- API key for Supermemory semantic long-term memory
Configuration Parameters
Model Parameters
model.context_length- Total context window in tokens (input plus output). Overrides auto-detection.model.max_tokens- Maximum output tokens per response. Unrelated tocontext_length.model.supports_vision- Boolean flag to enable native vision support for custom endpoint models.model.base_url- Base URL for custom endpoint (set in config.yaml, not .env). Required for custom endpoints.model.api_key- API key for custom endpoint (can be left empty for local servers).model.lmstudio_load_mode- LM Studio loading mode:explicit(default) orjit(Just-In-Time).
Named Custom Provider Parameters
providers.<name>.api- Base URL for a named custom provider. Required.providers.<name>.key_env- Environment variable name containing the API key.providers.<name>.transport- API transport mode:chat_completions,anthropic_messages, orcodex_responses.providers.<name>.default_model- Default model ID.providers.<name>.extra_body- Additional JSON fields to merge into chat-completions requests.providers.<name>.extra_headers- Additional HTTP headers to send with requests.providers.<name>.ssl_ca_cert- Path to CA certificate for SSL verification.providers.<name>.ssl_verify- Boolean to enable or disable SSL verification.providers.<name>.enabled- Boolean to hide a provider entry without deleting it (default: true).
Fallback and Routing Parameters
fallback_providers- List of fallback provider entries, each withprovider,model, and optionalbase_urlandapi_mode.fallback_model- Legacy single fallback provider dictionary withproviderandmodel.provider_routing.sort- OpenRouter routing sort order:price(default),throughput, orlatency.provider_routing.only- List of providers to exclusively use for OpenRouter routing.provider_routing.ignore- List of providers to skip for OpenRouter routing.provider_routing.order- Ordered list of providers to try for OpenRouter routing.provider_routing.require_parameters- Boolean to only use providers supporting all request parameters.provider_routing.data_collection- Stringdenyto exclude providers that may store or train on data.openrouter.min_coding_score- Minimum coding quality score (0.0 to 1.0) for the Pareto Code router. Default is 0.65.
AWS Bedrock Parameters
bedrock.region- AWS region for Bedrock (config.yaml).bedrock.profile- AWS profile for Bedrock (config.yaml).bedrock.discovery- Boolean to auto-discover region from IAM.bedrock.guardrail- Optional Bedrock Guardrails configuration withguardrail_identifierandguardrail_version.
Google Vertex AI Parameters
vertex.project_id- GCP project ID for Vertex AI (config.yaml).vertex.region- GCP region for Vertex AI (config.yaml).
Provider-Specific Details
OpenRouter
Set OPENROUTER_API_KEY in ~/.hermes/.env. Run hermes chat --provider openrouter --model anthropic/claude-sonnet-4. Provider routing can sort by price, throughput, or latency. The Pareto Code router uses openrouter/pareto-code as the model name with a configurable min_coding_score.
Anthropic
Two authentication paths exist. The API key path uses ANTHROPIC_API_KEY and is pay-per-token, independent of any Claude subscription. The OAuth path requires a Claude Max plan with purchased extra usage credits. Claude Pro subscribers cannot use the OAuth path. Run hermes chat --provider anthropic --model claude-sonnet-4-6.
GitHub Copilot
Authentication uses COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN in priority order, or OAuth through hermes model. The GitHub Copilot API does not support classic Personal Access Tokens (ghp_*). Supported token types are gho_*, github_pat_*, and ghu_*. ACP mode requires the GitHub Copilot CLI in PATH and an existing copilot login session. Run hermes chat --provider copilot --model gpt-5.4.
Fireworks AI
Requires FIREWORKS_API_KEY. Uses native slash-form catalog IDs, for example accounts/fireworks/models/kimi-k2p6. The base URL must be configured via model.base_url in config.yaml, not in .env.
NovitaAI
Requires NOVITA_API_KEY. The base URL can be overridden with NOVITA_BASE_URL. Example model: moonshotai/kimi-k2.5.
z.ai / GLM
Requires GLM_API_KEY. Endpoint auto-detection probes multiple endpoints, so no manual GLM_BASE_URL is needed. Example model: glm-5.
Kimi/Moonshot
Requires KIMI_API_KEY for the international endpoint or KIMI_CN_API_KEY for the China endpoint. The base URL can be overridden with KIMI_BASE_URL. Example model: kimi-for-coding.
MiniMax
Requires MINIMAX_API_KEY for the global endpoint or MINIMAX_CN_API_KEY for the China endpoint. The base URL can be overridden with MINIMAX_BASE_URL or MINIMAX_CN_BASE_URL. Example model: MiniMax-M2.7.
xAI (Grok)
Requires XAI_API_KEY for the API key path. The OAuth path requires a SuperGrok or X Premium+ subscription. Prompt caching activates automatically when an xAI endpoint is detected and a session ID is available. A web search backend is also available. Example model: grok-4-fast-reasoning.
Qwen Cloud (Alibaba)
Requires DASHSCOPE_API_KEY. The base URL can be overridden with DASHSCOPE_BASE_URL. Example model: qwen3.5-plus.
AWS Bedrock
Uses AWS credentials from the standard boto3 chain. The AWS_PROFILE and AWS_REGION environment variables can be used. A non-default regional endpoint can be set with BEDROCK_BASE_URL. Example model: us.anthropic.claude-sonnet-4-6.
Google Vertex AI
Configure through hermes model by selecting "Google Vertex AI", then providing the project, region, and model. Uses OAuth2. Alternatively, set VERTEX_CREDENTIALS_PATH, VERTEX_PROJECT_ID, and VERTEX_REGION.
Ollama Cloud
Requires OLLAMA_API_KEY. The model catalog is fetched dynamically from ollama.com/v1/models and cached for one hour. Uses model:tag notation, for example qwen3-coder:480b-cloud. Do not use dashes in the model name.
Named Custom Provider Example (Together AI)
Add the following to ~/.hermes/config.yaml:
providers:
together:
api: https://api.together.xyz/v1
key_env: TOGETHER_API_KEY
Then set model.provider to custom:together and model.default to the desired model ID.
Fallback Provider Configuration
Fallback is configured exclusively through config.yaml or interactively via hermes fallback. Activation is one-shot per session, meaning the fallback chain is tried entry-by-entry only on the first failure. The conversation is preserved across the fallback.
Example fallback configuration:
fallback_providers:
- provider: openrouter
model: anthropic/claude-sonnet-4
- provider: anthropic
model: claude-sonnet-4
Context Length Configuration
Context length auto-detection is provider-aware, meaning the same model can have different limits on different providers. The detection pulls from multiple sources in order: configuration, endpoint API, model metadata, and a community registry.
Set context_length manually when using Ollama with custom num_ctx, when limiting context below the maximum, or when behind a proxy without a /v1/models endpoint. The model.max_tokens parameter controls response length only and is unrelated to conversation history length, which is governed by context_length.
Tool Calling on Local Servers
Tool calling on local servers requires server-side flags. For vLLM, use --enable-auto-tool-choice and --tool-call-parser. For SGLang, use --tool-call-parser. For llama.cpp, use the --jinja flag. For Ollama, tool calling is supported through the OpenAI-compatible API. For LM Studio, tool calling support depends on the loaded model.
If tool calls appear as text instead of executing, the server likely lacks the required tool calling flags.
Vision-Capable Models
Vision-capable models are supported natively through the supports_vision flag. For custom endpoints, set model.supports_vision: true in config.yaml.
Auxiliary Model Routing
Some tools, such as vision, web summarization, and MoA, use a separate auxiliary model. The default setting auxiliary.*.provider: 'auto' routes to the main chat model. This can be overridden to use a different model for specific tasks.
Nous Tool Gateway
The Nous Tool Gateway provides web search, image generation, TTS, and browser automation for paid subscribers. It requires a paid Nous Portal subscription.
OpenAI Codex Provider
The OpenAI Codex provider stores credentials in ~/.hermes/auth.json and can import from ~/.codex/auth.json. Token refresh failures (HTTP 4xx, invalid_grant) mark the refresh token as dead. Run hermes auth add openai-codex for a fresh login.
Nous Portal Authentication
Nous Portal requests carry a client=hermes-client-v<version> tag that is auto-aligned to the installed release. JWT authentication is automatic, and revoked refresh tokens are quarantined to avoid replay loops.
ClawRouter
ClawRouter requires a USDC-funded wallet on Base or Solana for payment. If payment issues occur, run npx @blockrun/clawrouter doctor to check wallet status.
Legacy Configuration Migration
The legacy LLM_MODEL environment variable is removed. The config.yaml file is the single source of truth for model and endpoint configuration. Legacy custom_providers: list format is auto-migrated to the providers: dictionary format (config v12). Run hermes update to trigger auto-migration if needed.
The model key alias in config can be either default: or model:; both work identically.
Failure Modes and Troubleshooting
Connection Issues
- Connection refused from WSL2 to a Windows-hosted model server in NAT mode. Use mirrored mode or the Windows host IP.
- WSL2 mirrored mode not working. Add a Hyper-V firewall rule:
Set-NetFirewallHyperVVMSetting. - Windows Firewall blocking connections. Add an inbound rule for the model server port.
Tool Calling Issues
- Tool calls appear as text instead of executing. The server lacks tool calling flags. Add
--jinjafor llama.cpp,--enable-auto-tool-choiceand--tool-call-parserfor vLLM, or--tool-call-parserfor SGLang.
Context and Response Issues
- Model forgets context or gives incoherent responses. The context window is too small. Ensure it is at least 64,000 tokens.
- Context limit shows 2,048 tokens at startup. The server reports a low value or none. Set
context_lengthexplicitly in config.yaml. - Responses cut off mid-sentence. The
max_tokensvalue is too low (SGLang defaults to 128) or context is exhausted. - Ollama context too small. Set the
OLLAMA_CONTEXT_LENGTHenvironment variable, use a systemd override, or configure a Modelfile.
Authentication Issues
- GitHub Copilot authentication fails with a
ghp_*token. Use OAuth by runninghermes modelto get agho_*token. - Anthropic OAuth fails without Claude Max plus extra usage credits. Use
ANTHROPIC_API_KEYinstead. - OpenAI Codex token refresh fails with a terminal error. Run
hermes auth add openai-codexfor a fresh login.
Model and Provider Issues
- xAI model retired after 2026-05-15. Run
hermes migrate xai --apply. - SGLang responses truncated. Set
--default-max-tokenson the server ormax_tokensin the request. - llama.cpp tool calls not working. Add the
--jinjaflag. - LM Studio model not loading. Check the context length setting and model compatibility.
- Self-hosted Firecrawl failing on protected sites. This is expected, as self-hosted mode has no anti-bot bypass.
- ClawRouter payment issues. Run
npx @blockrun/clawrouter doctorto check wallet status. - Unknown provider warnings in
hermes doctor. Ensure the provider name is correct and the configuration is valid. - Provider
/v1/modelsendpoint unreachable (for example, Perplexity). The model is persisted with a warning; set the model ID manually. - Legacy config format not migrated. Run
hermes updateto auto-migrate to config v12.
Qwen Reasoning Models
For Qwen reasoning models served by vLLM, ensure the final user-visible response appears in the content field. Disable the reasoning parser or set enable_thinking: false via extra_body.
Examples
OpenRouter
Set OPENROUTER_API_KEY in ~/.hermes/.env, then run:
hermes chat --provider openrouter --model anthropic/claude-sonnet-4
Anthropic API Key
Export ANTHROPIC_API_KEY, then run:
hermes chat --provider anthropic --model claude-sonnet-4-6
GitHub Copilot
Run:
hermes chat --provider copilot --model gpt-5.4
This uses COPILOT_GITHUB_TOKEN or OAuth.
Fireworks AI
Requires FIREWORKS_API_KEY. Run:
hermes chat --provider fireworks --model accounts/fireworks/models/kimi-k2p6
NovitaAI
Requires NOVITA_API_KEY. Run:
hermes chat --provider novita --model moonshotai/kimi-k2.5
z.ai/GLM
Requires GLM_API_KEY. Run:
hermes chat --provider zai --model glm-5
Kimi/Moonshot
Requires KIMI_API_KEY. Run:
hermes chat --provider kimi-coding --model kimi-for-coding
MiniMax
Requires MINIMAX_API_KEY. Run:
hermes chat --provider minimax --model MiniMax-M2.7
xAI (Grok)
Requires XAI_API_KEY. Run:
hermes chat --provider xai --model grok-4-fast-reasoning
Qwen Cloud
Requires DASHSCOPE_API_KEY. Run:
hermes chat --provider alibaba --model qwen3.5-plus
AWS Bedrock
Uses AWS credentials. Run:
hermes chat --provider bedrock --model us.anthropic.claude-sonnet-4-6
Google Vertex AI
Run hermes model, select "Google Vertex AI", then provide the project, region, and model. Uses OAuth2.
Ollama Local
Run hermes model, select "Custom endpoint", enter http://localhost:11434/v1, leave the API key blank, and enter the model name.
vLLM
Run hermes model, select "Custom endpoint", enter http://localhost:8000/v1, optionally provide an API key, and enter the model name.
SGLang
Run hermes model, select "Custom endpoint", enter http://localhost:30000/v1, and enter the model name.
llama.cpp
Run hermes model, select "Custom endpoint", enter http://localhost:8080/v1, leave the API key blank, and enter the model name.
LM Studio
Run hermes model, select "LM Studio", accept the default URL http://localhost:1234/v1, and pick the discovered model.
Named Custom Provider (Together AI)
Add to config.yaml:
providers:
together:
api: https://api.together.xyz/v1
key_env: TOGETHER_API_KEY
Set model.provider to custom:together and model.default to the desired model ID.
Fallback Providers
Add to config.yaml:
fallback_providers:
- provider: openrouter
model: anthropic/claude-sonnet-4
- provider: anthropic
model: claude-sonnet-4
OpenRouter Pareto Code
Set in config.yaml:
model:
model: openrouter/pareto-code
openrouter:
min_coding_score: 0.65
Self-Hosted Firecrawl
Clone the repository, set USE_DB_AUTHENTICATION=false, run docker compose up -d, then run:
hermes config set FIRECRAWL_API_URL http://localhost:3002
xAI Model Migration
Preview replacements:
hermes migrate xai
Apply with backup:
hermes migrate xai --apply
Additional Notes
The hermes model command (run from the terminal) is for full provider setup. The /model command (run inside a chat session) only switches between already-configured providers. To add a new provider, exit the chat session with Ctrl+C or /quit, run hermes model, then start a new session.
Fireworks AI uses native slash-form catalog IDs, for example accounts/fireworks/models/kimi-k2p6. The Fireworks AI base URL must be configured via model.base_url in config.yaml, not in .env.
The Z.AI / GLM endpoint auto-detection probes multiple endpoints, so no manual GLM_BASE_URL is needed.
Ollama Cloud model catalog is fetched dynamically from ollama.com/v1/models and cached for one hour. Ollama Cloud uses model:tag notation, for example qwen3-coder:480b-cloud. Do not use dashes.
Ollama local server does not use context length from the OpenAI-compatible API. It must be set server-side or via a Modelfile. Ollama defaults to very low context lengths: 4,096 tokens for systems with less than 24 GB VRAM, 32,768 tokens for 24-48 GB, and 256,000 tokens for systems with more than 48 GB VRAM. Hermes requires at least 64,000 tokens.
vLLM tool calling requires explicit flags: --enable-auto-tool-choice and --tool-call-parser. vLLM supports human-readable sizes: 64k equals 64,000, and 64K equals 65,536.
SGLang defaults to 128 max output tokens. Set --default-max-tokens on the server or max_tokens in the request. SGLang tool calling requires the --tool-call-parser flag.
llama.cpp requires the --jinja flag for tool calling support. The context length flag -c defaults to 0, which reads the model's training context. This may cause out-of-memory errors for 128k+ models, so set it explicitly to at least 64,000. Parallel slots (-np) divide the context among slots, and each slot must have at least 64,000 tokens.
LM Studio context length must be set in the GUI (gear icon) or CLI (lms load --context-length). Just-In-Time loading mode (jit) skips explicit preload and is set via hermes config set model.lmstudio_load_mode jit.
WSL2 default NAT mode means localhost inside WSL2 refers to the Linux VM, not the Windows host. Use mirrored mode or the Windows host IP. Mirrored mode requires Windows 11 22H2+ and may need a Hyper-V firewall rule (Set-NetFirewallHyperVVMSetting). In NAT mode, the model server on Windows must bind to 0.0.0.0, not 127.0.0.1.
Self-hosted Firecrawl uses basic fetch with Playwright and has no advanced anti-bot bypass. Search uses DuckDuckGo instead of Google. It requires approximately 4-8 GB RAM across 5 Docker containers.
ClawRouter requires a USDC-funded wallet on Base or Solana for payment.
The legacy LLM_MODEL environment variable is removed. The config.yaml file is the single source of truth for model and endpoint configuration. Legacy custom_providers: list format is auto-migrated to the providers: dictionary format (config v12).
Fallback is configured exclusively through config.yaml or interactively via hermes fallback. Fallback activation is one-shot per session, and the chain is tried entry-by-entry.
Context length auto-detection is provider-aware, meaning the same model can have different limits on different providers. Set context_length manually when using Ollama with custom num_ctx, when limiting context below the maximum, or when behind a proxy without a /v1/models endpoint.
The model.max_tokens parameter controls response length only and is unrelated to conversation history length, which is governed by context_length.
For Qwen reasoning models served by vLLM, ensure the final user-visible response appears in the content field. Disable the reasoning parser or set enable_thinking: false via extra_body.
The model key alias in config can be either default: or model:; both work identically.
The OpenRouter Pareto Code router uses a minimum coding score of 0.65 by default, but you can set it to any value between 0.0 and 1.0. A score of 100% indicates perfect coding quality, while 0% means no coding capability is required. Setting it to 0% disables the filter entirely, allowing any provider to be used regardless of coding performance.
When configuring context length, note that the maximum supported value is 200000 tokens for most providers, though some may support more. Setting context length to 0% of the maximum (effectively 0 tokens) is not allowed and will result in an error. The minimum recommended context length is 64,000 tokens, and setting it to 100% of the maximum (200000 tokens) is supported but may require significant VRAM or RAM.
The cost per 1,000 tokens for some providers can be as low as $0.10, making them suitable for high-volume or budget-constrained workloads. Always check the provider's pricing page for the most current rates, as prices can change without notice.
Sources & References
This page was researched from 1 independent source, combined and verified for completeness.
- 1.AI ProvidersOfficial documentation · primary source
The #1 AI Newsletter
The most important ai updates, guides, and fixes — one weekly email.
No spam, unsubscribe anytime. Privacy policy