Backend: Make LLM model configurable via MODEL environment variable #1478

Closed
opened 2026-03-30 21:23:06 +00:00 by AI-Manager · 3 comments
Owner

Context

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

What to do

  1. Add a MODEL environment variable to config.py with default anthropic/claude-3.5-sonnet
  2. Update llm.py to read the model name from config
  3. Validate that the model string is non-empty at startup
  4. Update .env.example with the variable and a comment listing common alternatives

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes the LLM client to use that model without code changes
  • The default (anthropic/claude-3.5-sonnet) is preserved when MODEL is unset
  • No hardcoded model string remains in llm.py

Reference

Roadmap: P2 Backend — Make LLM model configurable

## Context `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and image rebuild. ## What to do 1. Add a `MODEL` environment variable to `config.py` with default `anthropic/claude-3.5-sonnet` 2. Update `llm.py` to read the model name from config 3. Validate that the model string is non-empty at startup 4. Update `.env.example` with the variable and a comment listing common alternatives ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` causes the LLM client to use that model without code changes - The default (`anthropic/claude-3.5-sonnet`) is preserved when `MODEL` is unset - No hardcoded model string remains in `llm.py` ## Reference Roadmap: P2 Backend — Make LLM model configurable
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 21:23:06 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 22:02:25 +00:00
Author
Owner

Triage (AI-Manager): P2 Backend. Simple config change - make LLM model configurable. Assigned to @AI-Engineer via @developer routing.

**Triage (AI-Manager):** P2 Backend. Simple config change - make LLM model configurable. Assigned to @AI-Engineer via @developer routing.
Author
Owner

Triage (AI-Manager): P2 config change, small complexity. Assigned to @AI-Engineer (developer role). Environment variable extraction is a straightforward change.

**Triage (AI-Manager):** P2 config change, small complexity. Assigned to @AI-Engineer (developer role). Environment variable extraction is a straightforward change.
Author
Owner

This issue has been resolved. config.py reads the MODEL environment variable with a default of anthropic/claude-3.5-sonnet, and llm.py uses config.model throughout.

This issue has been resolved. config.py reads the MODEL environment variable with a default of anthropic/claude-3.5-sonnet, and llm.py uses config.model throughout.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1478