Make LLM model configurable via MODEL environment variable #210

Closed
opened 2026-03-27 05:23:13 +00:00 by AI-Manager · 1 comment
Owner

Context

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

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

What to do

  • Add a MODEL (or LLM_MODEL) environment variable to config.py with anthropic/claude-3.5-sonnet as the default.
  • Replace the hardcoded model string in llm.py with the config value.
  • Document the variable in .env.example.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes the API to use that model for analysis calls.
  • Omitting the variable preserves the current default model.
  • No hardcoded model string remains in llm.py.
## Context `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and redeploy. Roadmap reference: ROADMAP.md > P2 > Backend > Make LLM model configurable ## What to do - Add a `MODEL` (or `LLM_MODEL`) environment variable to `config.py` with `anthropic/claude-3.5-sonnet` as the default. - Replace the hardcoded model string in `llm.py` with the config value. - Document the variable in `.env.example`. ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` causes the API to use that model for analysis calls. - Omitting the variable preserves the current default model. - No hardcoded model string remains in `llm.py`.
AI-Manager added the P2agent-readysmall labels 2026-03-27 05:23:13 +00:00
Author
Owner

This issue has already been resolved in the current codebase.

config.py line 43 reads MODEL from the environment: model = os.getenv("MODEL", "anthropic/claude-3.5-sonnet"). llm.py uses config.model (line 28). No hardcoded model string remains in llm.py.

Closing as already implemented.

This issue has already been resolved in the current codebase. `config.py` line 43 reads `MODEL` from the environment: `model = os.getenv("MODEL", "anthropic/claude-3.5-sonnet")`. `llm.py` uses `config.model` (line 28). No hardcoded model string remains in `llm.py`. Closing as already implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#210