{"record":{"id":"336b26d0c42a830e","repo":"usestrix/strix","slug":"no-llm-model-configured-set-strix-llm-env-or-pass","errorCode":null,"errorMessage":"No LLM model configured. Set STRIX_LLM env or pass model= to run_strix_scan().","messagePattern":"No LLM model configured\\. Set STRIX_LLM env or pass model= to run_strix_scan\\(\\)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"strix/core/runner.py","lineNumber":173,"sourceCode":"    agents_path = state_dir / \"agents.json\"\n    agents_db = state_dir / \"agents.db\"\n    is_resume = agents_path.exists()\n\n    logger.info(\n        \"%s Strix scan %s (image=%s, max_turns=%d, interactive=%s, run_dir=%s)\",\n        \"Resuming\" if is_resume else \"Starting\",\n        scan_id,\n        image,\n        max_turns,\n        interactive,\n        run_dir,\n    )\n\n    settings = load_settings()\n    configure_sdk_model_defaults(settings)\n    resolved_model = (model or settings.llm.model or \"\").strip()\n    if not resolved_model:\n        raise RuntimeError(\n            \"No LLM model configured. Set STRIX_LLM env or pass model= to run_strix_scan().\",\n        )\n    logger.info(\"LLM model resolved: %s\", resolved_model)\n    chat_completions_tools = uses_chat_completions_tool_schema(resolved_model, settings)\n\n    if coordinator is None:\n        coordinator = AgentCoordinator()\n    coordinator.set_snapshot_path(agents_path)\n\n    from strix.tools.notes.tools import hydrate_notes_from_disk\n    from strix.tools.todo.tools import hydrate_todos_from_disk\n\n    hydrate_todos_from_disk(state_dir)\n    hydrate_notes_from_disk(state_dir)\n\n    root_id: str | None = None\n    if is_resume:\n        try:","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/usestrix/strix/blob/85513391305171ecc6faffe03da4a8bda5e3febb/strix/core/runner.py#L155-L191","documentation":"Raised at the top of run_strix_scan (strix/core/runner.py:173) when no LLM model can be resolved: the model= argument, the loaded settings' llm.model (typically set from the STRIX_LLM environment variable), are all empty after stripping. Strix is BYO-LLM-key and needs a LiteLLM model id for every agent turn, so it fails fast with RuntimeError before creating any sandbox session.","triggerScenarios":"Calling run_strix_scan() without model= while STRIX_LLM is unset/empty and ~/.strix/cli-config.json has no llm.model; running the CLI in a fresh shell where the env var was never exported; CI jobs that strip the environment.","commonSituations":"Fresh installs that never ran `strix config`; env vars lost through sudo, cron, Docker, or systemd service units; typos like STRIX_LLM=\"\" or exporting in a subshell.","solutions":["export STRIX_LLM=\"<litellm-model-id>\" (e.g. openai/gpt-4o, anthropic/claude-sonnet-4) in the shell/profile that launches strix.","Or pass model= explicitly when calling run_strix_scan() programmatically.","Or persist it in ~/.strix/cli-config.json under llm.model so shells without the env var still work.","Verify with `strix config` (or load_settings()) that llm.model is non-empty, and confirm LLM_API_KEY is also set for that provider."],"exampleFix":"# before\n$ strix -n -t ./  # RuntimeError: No LLM model configured\n\n# after\n$ export STRIX_LLM=\"openai/gpt-4o\"\n$ export LLM_API_KEY=\"sk-...\"\n$ strix -n -t ./","handlingStrategy":"validation","validationCode":"import os\nfrom strix.config import load_settings\n\nmodel = (os.environ.get('STRIX_LLM') or load_settings().llm.model or '').strip()\nif not model:\n    raise SystemExit('Set STRIX_LLM or llm.model before starting a scan')","typeGuard":"def has_llm_model() -> bool:\n    import os\n    from strix.config import load_settings\n    return bool((os.environ.get('STRIX_LLM') or load_settings().llm.model or '').strip())","tryCatchPattern":"try:\n    await run_strix_scan(target=..., model=None)\nexcept RuntimeError as exc:\n    if 'No LLM model configured' in str(exc):\n        os.environ['STRIX_LLM'] = 'openai/gpt-4o'\n        await run_strix_scan(target=..., model=None)\n    else:\n        raise","preventionTips":["Persist llm.model in ~/.strix/cli-config.json so environments without the env var still work.","Add a startup assert for STRIX_LLM in CI wrappers before invoking strix.","Also verify LLM_API_KEY is set for the chosen provider."],"tags":["configuration","llm","environment","setup"],"backgroundTag":null,"analyzedSha":"85513391305171ecc6faffe03da4a8bda5e3febb","analyzedAt":"2026-08-15T05:03:57.275Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}