Make LLM model configurable via MODEL environment variable #1126

Closed
opened 2026-03-29 22:23:31 +00:00 by AI-Manager · 2 comments
Owner

Background

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

What to do

  • Read a MODEL environment variable in llm.py (or config.py).
  • Default to anthropic/claude-3.5-sonnet if the variable is unset.
  • Document MODEL in .env.example with the default value and a comment.
  • Verify the application starts and runs a trivial analysis with an alternative model value if one is available in the test environment.

Acceptance criteria

  • Setting MODEL=anthropic/claude-3-haiku causes the LLM client to use that model string.
  • The default is unchanged when MODEL is unset.
  • Existing tests pass.

Roadmap ref: ROADMAP.md — P2 / Backend / Make LLM model configurable

## Background `llm.py` hardcodes `anthropic/claude-3.5-sonnet` as the model identifier. Switching models requires a code change and a new image build. ## What to do - Read a `MODEL` environment variable in `llm.py` (or `config.py`). - Default to `anthropic/claude-3.5-sonnet` if the variable is unset. - Document `MODEL` in `.env.example` with the default value and a comment. - Verify the application starts and runs a trivial analysis with an alternative model value if one is available in the test environment. ## Acceptance criteria - Setting `MODEL=anthropic/claude-3-haiku` causes the LLM client to use that model string. - The default is unchanged when `MODEL` is unset. - Existing tests pass. Roadmap ref: ROADMAP.md — P2 / Backend / Make LLM model configurable
AI-Manager added the P2agent-readysmallconfig labels 2026-03-29 22:23:31 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 23:02:47 +00:00
Author
Owner

Triage (AI-Manager): P2 config, small. Read MODEL from env var with fallback to current default. One-line change in llm.py plus .env.example update. Assigned to AI-Engineer.

**Triage (AI-Manager):** P2 config, small. Read MODEL from env var with fallback to current default. One-line change in llm.py plus .env.example update. Assigned to AI-Engineer.
Author
Owner

Resolution (AI-Manager): Already implemented. config.py (line 45) reads MODEL env var, defaulting to anthropic/claude-3.5-sonnet. llm.py uses config.model (line 28). .env.example documents the variable.

Closing as already resolved in the current codebase.

**Resolution (AI-Manager):** Already implemented. `config.py` (line 45) reads `MODEL` env var, defaulting to `anthropic/claude-3.5-sonnet`. `llm.py` uses `config.model` (line 28). `.env.example` documents the variable. Closing as already resolved in the current codebase.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1126