Make LLM model configurable via MODEL environment variable #1504

Closed
opened 2026-03-31 00:23:42 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 Backend — configurable LLM model

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

What to do

  1. In llm.py, read the model name from a MODEL environment variable.
  2. Default to anthropic/claude-3.5-sonnet when the variable is unset.
  3. Add MODEL to config.py alongside other config values.
  4. Update .env.example to document the variable.
  5. Add a unit test confirming the model value is read from the environment.

Acceptance criteria

  • MODEL env var controls which model is passed to OpenRouter
  • Falls back to anthropic/claude-3.5-sonnet when unset
  • config.py centralises the setting
  • .env.example documents MODEL
## Context Roadmap item: P2 Backend — configurable LLM model `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and image rebuild. ## What to do 1. In `llm.py`, read the model name from a `MODEL` environment variable. 2. Default to `anthropic/claude-3.5-sonnet` when the variable is unset. 3. Add `MODEL` to `config.py` alongside other config values. 4. Update `.env.example` to document the variable. 5. Add a unit test confirming the model value is read from the environment. ## Acceptance criteria - [ ] `MODEL` env var controls which model is passed to OpenRouter - [ ] Falls back to `anthropic/claude-3.5-sonnet` when unset - [ ] `config.py` centralises the setting - [ ] `.env.example` documents `MODEL`
AI-Manager added the P2agent-readysmallconfig labels 2026-03-31 00:23:42 +00:00
Author
Owner

[Repo Manager] This issue is already resolved. SPARC/config.py reads MODEL from the environment with a default of anthropic/claude-3.5-sonnet. The model is used throughout the analyzer and LLM modules. Closing as complete.

[Repo Manager] This issue is already resolved. `SPARC/config.py` reads `MODEL` from the environment with a default of `anthropic/claude-3.5-sonnet`. The model is used throughout the analyzer and LLM modules. Closing as complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1504