{"record":{"id":"d65bdaa8e94f7992","repo":"NousResearch/hermes-agent","slug":"no-llm-provider-configured-run-hermes-model-to","errorCode":null,"errorMessage":"No LLM provider configured. Run `hermes model` to select a provider, or run `hermes setup` for first-time configuration.","messagePattern":"No LLM provider configured\\. Run `hermes model` to select a provider, or run `hermes setup` for first-time configuration\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"agent/agent_init.py","lineNumber":1359,"sourceCode":"                                client_kwargs[\"timeout\"] = _provider_timeout\n                            _fb_headers = getattr(_fb_client, \"_custom_headers\", None)\n                            if not _fb_headers:\n                                _fb_headers = getattr(_fb_client, \"default_headers\", None)\n                            if not _fb_headers:\n                                _fb_headers = getattr(_fb_client, \"_default_headers\", None)\n                            if _fb_headers:\n                                client_kwargs[\"default_headers\"] = dict(_fb_headers)\n                            _fb_resolved = True\n                            break\n                    if not _fb_resolved:\n                        raise RuntimeError(\n                            f\"Provider '{_explicit}' is set in config.yaml but no API key \"\n                            f\"was found. Set the {_env_hint} environment \"\n                            f\"variable, or switch to a different provider with `hermes model`.\"\n                        )\n                if not getattr(agent, \"_fallback_activated\", False):\n                    # No provider configured — reject with a clear message.\n                    raise RuntimeError(\n                        \"No LLM provider configured. Run `hermes model` to \"\n                        \"select a provider, or run `hermes setup` for first-time \"\n                        \"configuration.\"\n                    )\n        \n        agent._client_kwargs = client_kwargs  # stored for rebuilding after interrupt\n\n        # Enable fine-grained tool streaming for Claude on OpenRouter.\n        # Without this, Anthropic buffers the entire tool call and goes\n        # silent for minutes while thinking — OpenRouter's upstream proxy\n        # times out during the silence.  The beta header makes Anthropic\n        # stream tool call arguments token-by-token, keeping the\n        # connection alive.\n        _effective_base = str(client_kwargs.get(\"base_url\", \"\")).lower()\n        if base_url_host_matches(_effective_base, \"openrouter.ai\") and \"claude\" in (agent.model or \"\").lower():\n            headers = client_kwargs.get(\"default_headers\") or {}\n            existing_beta = headers.get(\"x-anthropic-beta\", \"\")\n            _FINE_GRAINED = \"fine-grained-tool-streaming-2025-05-14\"","sourceCodeStart":1341,"sourceCodeEnd":1377,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/agent_init.py#L1341-L1377","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom hermes_constants import get_hermes_home\nimport yaml\n\ndef provider_configured() -> bool:\n    cfg_path = get_hermes_home() / \"config.yaml\"\n    if not cfg_path.exists():\n        return False\n    model = (yaml.safe_load(cfg_path.read_text()) or {}).get(\"model\") or {}\n    return bool(model.get(\"provider\") or model.get(\"base_url\"))\n\nif not provider_configured():\n    run_first_time_setup()  # hermes setup / hermes model","typeGuard":null,"tryCatchPattern":"try:\n    agent = AIAgent(...)\nexcept RuntimeError as e:\n    if \"No LLM provider configured\" in str(e):\n        launch_setup_wizard()\n    else:\n        raise","preventionTips":["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"],"tags":["config","provider","first-run","initialization"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}