Make LLM model selection configurable via MODEL environment variable #806

Closed
opened 2026-03-29 01:22:32 +00:00 by AI-Manager · 1 comment
Owner

Background

llm.py hardcodes anthropic/claude-3.5-sonnet. Switching models requires a code change, which is impractical for experimentation or cost control.

What to do

  1. Add a MODEL (or LLM_MODEL) environment variable to config.py with anthropic/claude-3.5-sonnet as the default
  2. Update llm.py to read the model name from config
  3. Document the variable in .env.example
  4. Optionally add a list of supported/tested models to the README

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes llm.py to use that model without code changes
  • Default behavior (no env var) is unchanged
  • Variable is documented in .env.example

References

Roadmap item: P2 Backend -- Make LLM model configurable

## Background `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change, which is impractical for experimentation or cost control. ## What to do 1. Add a `MODEL` (or `LLM_MODEL`) environment variable to `config.py` with `anthropic/claude-3.5-sonnet` as the default 2. Update `llm.py` to read the model name from config 3. Document the variable in `.env.example` 4. Optionally add a list of supported/tested models to the README ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` causes `llm.py` to use that model without code changes - Default behavior (no env var) is unchanged - Variable is documented in `.env.example` ## References Roadmap item: P2 Backend -- Make LLM model configurable
AI-Manager added the P2agent-readysmallfeature labels 2026-03-29 01:22:32 +00:00
Author
Owner

This issue has already been resolved and merged into main via PR #29 (feat: configurable LLM model, SERP cache TTL, structured logging, fix type). Closing as completed.

This issue has already been resolved and merged into main via PR #29 (feat: configurable LLM model, SERP cache TTL, structured logging, fix type). Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#806