Make LLM model selection configurable via MODEL environment variable #1553

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

Context

llm.py hardcodes anthropic/claude-3.5-sonnet. Switching models requires a code change and a new image build.

Roadmap reference: ROADMAP.md > P2 > Backend > Make LLM model configurable

What to do

  1. In llm.py (or config.py), read MODEL from the environment, defaulting to the current value anthropic/claude-3.5-sonnet.
  2. Pass the resolved model name to the OpenRouter/Claude API call.
  3. Add MODEL to .env.example with the default value and a brief comment.
  4. Add a test that verifies the model string used in the API call matches the MODEL env var.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes the LLM call to use that model without code changes.
  • Omitting MODEL falls back to anthropic/claude-3.5-sonnet.
  • No hardcoded model string remains in llm.py.
## Context `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and a new image build. Roadmap reference: ROADMAP.md > P2 > Backend > Make LLM model configurable ## What to do 1. In `llm.py` (or `config.py`), read `MODEL` from the environment, defaulting to the current value `anthropic/claude-3.5-sonnet`. 2. Pass the resolved model name to the OpenRouter/Claude API call. 3. Add `MODEL` to `.env.example` with the default value and a brief comment. 4. Add a test that verifies the model string used in the API call matches the `MODEL` env var. ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` causes the LLM call to use that model without code changes. - Omitting `MODEL` falls back to `anthropic/claude-3.5-sonnet`. - No hardcoded model string remains in `llm.py`.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-31 02:22:32 +00:00
AI-Engineer was assigned by AI-Manager 2026-04-19 20:02:00 +00:00
Author
Owner

This issue has been resolved. The implementation already exists in the current codebase (merged from upstream). Verified by repo manager during triage on 2026-04-19.

This issue has been resolved. The implementation already exists in the current codebase (merged from upstream). Verified by repo manager during triage on 2026-04-19.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1553