usestrix/strix · critical · RuntimeError
No LLM model configured. Set STRIX_LLM env or pass model= to
Error message
No LLM model configured. Set STRIX_LLM env or pass model= to run_strix_scan().
What it means
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.
Source
Thrown at strix/core/runner.py:173
agents_path = state_dir / "agents.json"
agents_db = state_dir / "agents.db"
is_resume = agents_path.exists()
logger.info(
"%s Strix scan %s (image=%s, max_turns=%d, interactive=%s, run_dir=%s)",
"Resuming" if is_resume else "Starting",
scan_id,
image,
max_turns,
interactive,
run_dir,
)
settings = load_settings()
configure_sdk_model_defaults(settings)
resolved_model = (model or settings.llm.model or "").strip()
if not resolved_model:
raise RuntimeError(
"No LLM model configured. Set STRIX_LLM env or pass model= to run_strix_scan().",
)
logger.info("LLM model resolved: %s", resolved_model)
chat_completions_tools = uses_chat_completions_tool_schema(resolved_model, settings)
if coordinator is None:
coordinator = AgentCoordinator()
coordinator.set_snapshot_path(agents_path)
from strix.tools.notes.tools import hydrate_notes_from_disk
from strix.tools.todo.tools import hydrate_todos_from_disk
hydrate_todos_from_disk(state_dir)
hydrate_notes_from_disk(state_dir)
root_id: str | None = None
if is_resume:
try:View on GitHub (pinned to 8551339130)
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.
Example fix
# before $ strix -n -t ./ # RuntimeError: No LLM model configured # after $ export STRIX_LLM="openai/gpt-4o" $ export LLM_API_KEY="sk-..." $ strix -n -t ./
Defensive patterns
Strategy: validation
Validate before calling
import os
from strix.config import load_settings
model = (os.environ.get('STRIX_LLM') or load_settings().llm.model or '').strip()
if not model:
raise SystemExit('Set STRIX_LLM or llm.model before starting a scan') Type guard
def has_llm_model() -> bool:
import os
from strix.config import load_settings
return bool((os.environ.get('STRIX_LLM') or load_settings().llm.model or '').strip()) Try / catch
try:
await run_strix_scan(target=..., model=None)
except RuntimeError as exc:
if 'No LLM model configured' in str(exc):
os.environ['STRIX_LLM'] = 'openai/gpt-4o'
await run_strix_scan(target=..., model=None)
else:
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- No model configured. Set STRIX_LLM first.
- extra_system_prompt_context cannot override built-in scope k
- Model connection failed: {exc}
- strix_image is not configured. Set it in ~/.strix/cli-config
- The interactive interface could not start: {exc}
AI-assisted analysis of usestrix/strix@8551339130 (2026-08-15).
Data as JSON: /api/errors/336b26d0c42a830e.
Report an issue: GitHub.