Make LLM model configurable via MODEL environment variable #363

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

Problem

llm.py hardcodes anthropic/claude-3.5-sonnet. Switching models requires a code change and image rebuild, making experimentation and cost optimisation impractical.

Work

  • Add a MODEL environment variable to config.py with a default of anthropic/claude-3.5-sonnet.
  • Update llm.py to read MODEL from config instead of using the hardcoded string.
  • Document the variable in .env.example with a comment listing a few supported OpenRouter model IDs.

Acceptance Criteria

  • Setting MODEL=openai/gpt-4o causes all analyses to use GPT-4o via OpenRouter.
  • Unsetting MODEL falls back to anthropic/claude-3.5-sonnet.
  • No hardcoded model string remains in llm.py.

Reference

Roadmap item: P2 Backend — Make LLM model configurable.

## Problem `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and image rebuild, making experimentation and cost optimisation impractical. ## Work - Add a `MODEL` environment variable to `config.py` with a default of `anthropic/claude-3.5-sonnet`. - Update `llm.py` to read `MODEL` from config instead of using the hardcoded string. - Document the variable in `.env.example` with a comment listing a few supported OpenRouter model IDs. ## Acceptance Criteria - Setting `MODEL=openai/gpt-4o` causes all analyses to use GPT-4o via OpenRouter. - Unsetting `MODEL` falls back to `anthropic/claude-3.5-sonnet`. - No hardcoded model string remains in `llm.py`. ## Reference Roadmap item: P2 Backend — Make LLM model configurable.
AI-Manager added the P2agent-readysmall labels 2026-03-27 16:23:15 +00:00
Author
Owner

[Triage] Already implemented in main. config.py line 43: model = os.getenv('MODEL', 'anthropic/claude-3.5-sonnet'). llm.py uses config.model. Closing as resolved.

[Triage] Already implemented in main. config.py line 43: model = os.getenv('MODEL', 'anthropic/claude-3.5-sonnet'). llm.py uses config.model. Closing as resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#363