headroomlabs-ai/headroom · error · SystemExit
Error: litellm required for --answer-model. Run: pip install
Error message
Error: litellm required for --answer-model. Run: pip install litellm
What it means
When the memory-eval command is given --answer-model, it answers questions via litellm.completion. litellm is optional; if importing it fails, the command prints 'Error: litellm required for --answer-model. Run: pip install litellm' and exits 1. Only the --answer-model code path needs it — evals without an answer model run fine.
Source
Thrown at headroom/cli/evals.py:520
3. For "when" questions: give the specific date if mentioned (e.g., "7 May 2023", "2022")
4. For "what" questions: give the specific thing/action
5. For "who" questions: give the name
6. If the exact answer is in the memories, use those exact words/dates
7. If you cannot find the answer, say "Information not found"
## Answer (be concise - just the facts):"""
response = litellm.completion(
model=answer_model,
messages=[{"role": "user", "content": prompt}],
temperature=0.0,
max_tokens=150,
)
return response.choices[0].message.content or ""
except ImportError:
click.echo("Error: litellm required for --answer-model. Run: pip install litellm")
raise SystemExit(1) from None
# Create LLM judge if enabled
llm_judge_fn: Callable[[str, str, str], tuple[float, str]] | None = None
if llm_judge:
# Use answer model for judge if not explicitly set
effective_judge_model = judge_model
if answer_model and judge_model == "gpt-4o":
effective_judge_model = answer_model # Match the answer model
if judge_provider == "simple":
llm_judge_fn = simple_judge
elif judge_provider == "openai":
llm_judge_fn = create_openai_judge(model=effective_judge_model)
elif judge_provider == "anthropic":
llm_judge_fn = create_anthropic_judge(model=effective_judge_model)
else:
llm_judge_fn = create_litellm_judge(model=effective_judge_model)
View on GitHub (pinned to 322425c43b)
Solutions
- pip install litellm (or reinstall with an extra that includes it)
- Drop --answer-model to use the default answering path that does not require litellm
- Set your API key env vars (OPENAI_API_KEY etc.) once litellm is installed so the completion call succeeds
- Verify: python -c "import litellm; print(litellm.__version__)"
Example fix
# before $ headroom evals memory --answer-model gpt-4o-mini # Error: litellm required for --answer-model. # after $ pip install litellm $ headroom evals memory --answer-model gpt-4o-mini
Defensive patterns
Strategy: validation
Validate before calling
try:
import litellm # noqa: F401
HAS_LITELLM = True
except ImportError:
HAS_LITELLM = False
if answer_model and not HAS_LITELLM:
raise SystemExit("--answer-model requires litellm: pip install litellm") Prevention
- Add litellm to your eval requirements whenever --answer-model is part of the workflow
- Wrap eval invocations in scripts and check for exit 1 with the litellm message to fail fast
- Set model API keys in the same script that runs evals
When it happens
Trigger: Running `headroom evals memory --answer-model gpt-4o-mini ...` (or --judge-provider litellm paths) without litellm installed in the active environment.
Common situations: Installing [evals] extra but not litellm (it is a separate dependency); running evals on a slim CI image; uninstalling litellm to slim an image and forgetting this path.
Related errors
- Error: Memory eval dependencies not installed.
- Error: Memory eval V2 dependencies not installed.
- Evaluation interrupted.
- Error: MCP SDK not installed.
- Error: MCP dependencies not installed: {e}
AI-assisted analysis of headroomlabs-ai/headroom@322425c43b (2026-08-15).
Data as JSON: /api/errors/3218fb77c84e478b.
Report an issue: GitHub.