NousResearch/hermes-agent · critical · RuntimeError
No LLM provider configured. Run `hermes model` to select a p
Error message
No LLM provider configured. Run `hermes model` to select a provider, or run `hermes setup` for first-time configuration.
What it means
Sibling of the explicit-provider failure: raised at init when NO provider is configured at all and no fallback client was activated (agent._fallback_activated is False). Hermes deliberately rejects startup rather than silently defaulting to an unintended provider.
Source
Thrown at agent/agent_init.py:1359
client_kwargs["timeout"] = _provider_timeout
_fb_headers = getattr(_fb_client, "_custom_headers", None)
if not _fb_headers:
_fb_headers = getattr(_fb_client, "default_headers", None)
if not _fb_headers:
_fb_headers = getattr(_fb_client, "_default_headers", None)
if _fb_headers:
client_kwargs["default_headers"] = dict(_fb_headers)
_fb_resolved = True
break
if not _fb_resolved:
raise RuntimeError(
f"Provider '{_explicit}' is set in config.yaml but no API key "
f"was found. Set the {_env_hint} environment "
f"variable, or switch to a different provider with `hermes model`."
)
if not getattr(agent, "_fallback_activated", False):
# No provider configured — reject with a clear message.
raise RuntimeError(
"No LLM provider configured. Run `hermes model` to "
"select a provider, or run `hermes setup` for first-time "
"configuration."
)
agent._client_kwargs = client_kwargs # stored for rebuilding after interrupt
# Enable fine-grained tool streaming for Claude on OpenRouter.
# Without this, Anthropic buffers the entire tool call and goes
# silent for minutes while thinking — OpenRouter's upstream proxy
# times out during the silence. The beta header makes Anthropic
# stream tool call arguments token-by-token, keeping the
# connection alive.
_effective_base = str(client_kwargs.get("base_url", "")).lower()
if base_url_host_matches(_effective_base, "openrouter.ai") and "claude" in (agent.model or "").lower():
headers = client_kwargs.get("default_headers") or {}
existing_beta = headers.get("x-anthropic-beta", "")
_FINE_GRAINED = "fine-grained-tool-streaming-2025-05-14"View on GitHub (pinned to c896c09c42)
Solutions
- Run `hermes model` to select a provider and model
- Run `hermes setup` for guided first-time setup (provider + key + model)
- Restore ~/.hermes/config.yaml from backup if it was accidentally removed
- Confirm the active profile's HERMES_HOME actually contains a config.yaml with a model section
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
from hermes_constants import get_hermes_home
import yaml
def provider_configured() -> bool:
cfg_path = get_hermes_home() / "config.yaml"
if not cfg_path.exists():
return False
model = (yaml.safe_load(cfg_path.read_text()) or {}).get("model") or {}
return bool(model.get("provider") or model.get("base_url"))
if not provider_configured():
run_first_time_setup() # hermes setup / hermes model Try / catch
try:
agent = AIAgent(...)
except RuntimeError as e:
if "No LLM provider configured" in str(e):
launch_setup_wizard()
else:
raise Prevention
- Run `hermes setup` once on fresh installs before any scripted agent usage
- When creating profiles, clone or seed config.yaml so a model.provider is always present
- Smoke-test deployments with a trivial `hermes chat 'ping'` to catch missing-provider early
When it happens
Trigger: Fresh HERMES_HOME with empty/minimal config.yaml (no model.provider, no custom endpoint), no provider env vars discoverable, and no credential-pool entry that would activate a fallback — every resolution tier returned nothing.
Common situations: First run before `hermes setup`; config.yaml deleted, reset, or lost; a profile created without copying config; .env wiped so no keys are discoverable by any tier.
Related errors
- Provider '{_explicit}' is set in config.yaml but no API key
- Failed to initialize OpenAI client: {e}
- switch_model: no base_url resolved for provider '{new_provid
- Invalid profile name: ${value}
- SSH host is required.
AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14).
Data as JSON: /api/errors/d65bdaa8e94f7992.
Report an issue: GitHub.