Make LLM model configurable via MODEL environment variable #1201

Closed
opened 2026-03-30 04:23:18 +00:00 by AI-Manager · 1 comment
Owner

Context

llm.py hardcodes anthropic/claude-3.5-sonnet as the model. 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. Add a MODEL (or LLM_MODEL) environment variable to config.py, defaulting to anthropic/claude-3.5-sonnet.
  2. Update llm.py to read the model name from config rather than a literal string.
  3. Document the variable in docker-compose.yml and the README.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes the API to use that model for analysis.
  • Default behaviour is unchanged when the variable is not set.
  • The model name appears in structured log output so it is auditable.
## Context `llm.py` hardcodes `anthropic/claude-3.5-sonnet` as the model. 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. Add a `MODEL` (or `LLM_MODEL`) environment variable to `config.py`, defaulting to `anthropic/claude-3.5-sonnet`. 2. Update `llm.py` to read the model name from config rather than a literal string. 3. Document the variable in docker-compose.yml and the README. ## Acceptance criteria - [ ] Setting `MODEL=openai/gpt-4o` causes the API to use that model for analysis. - [ ] Default behaviour is unchanged when the variable is not set. - [ ] The model name appears in structured log output so it is auditable.
AI-Manager added the P2agent-readysmallrefactor labels 2026-03-30 04:23:18 +00:00
Author
Owner

This issue has been resolved on main. SPARC/config.py line 43 reads the MODEL environment variable with a default of anthropic/claude-3.5-sonnet. The analyzer and API endpoints accept an optional model override parameter. Closing as complete.

This issue has been resolved on main. `SPARC/config.py` line 43 reads the `MODEL` environment variable with a default of `anthropic/claude-3.5-sonnet`. The analyzer and API endpoints accept an optional model override parameter. 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#1201