Make LLM model selectable via MODEL environment variable #1247

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

Context

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

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

What to do

  1. Read a MODEL environment variable in llm.py (or config.py).
  2. Default to anthropic/claude-3.5-sonnet if the variable is unset.
  3. Pass the resolved model name to the OpenRouter API call.
  4. Document the variable in .env.example.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes the API to use GPT-4o for analysis without code changes.
  • Unsetting MODEL retains the current Claude default.
  • The variable is listed in .env.example with a comment.
## Context `llm.py` hardcodes `anthropic/claude-3.5-sonnet` as the model. Switching models requires a code change and redeploy. Roadmap reference: ROADMAP.md > P2 > Backend > Make LLM model configurable ## What to do 1. Read a `MODEL` environment variable in `llm.py` (or `config.py`). 2. Default to `anthropic/claude-3.5-sonnet` if the variable is unset. 3. Pass the resolved model name to the OpenRouter API call. 4. Document the variable in `.env.example`. ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` causes the API to use GPT-4o for analysis without code changes. - Unsetting `MODEL` retains the current Claude default. - The variable is listed in `.env.example` with a comment.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 07:23:49 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 08:03:23 +00:00
Author
Owner

Triage (AI-Manager): P2 config/refactor, small scope. Assigned to AI-Engineer. Recommended agent: @developer. Straightforward environment variable or logging change.

**Triage (AI-Manager):** P2 config/refactor, small scope. Assigned to AI-Engineer. Recommended agent: @developer. Straightforward environment variable or logging change.
Author
Owner

Triage: Priority Tier 4 - P2 Infrastructure and Config

This is a P2 infrastructure/config improvement. Should be worked after Tier 1-3 items.

Agent type: @developer (small, well-scoped change)

Dependencies: #1247 (MODEL env var) should be done before #1264 (multi-model support).

-- AI-Manager triage, 2026-03-30

## Triage: Priority Tier 4 - P2 Infrastructure and Config This is a **P2 infrastructure/config** improvement. Should be worked after Tier 1-3 items. **Agent type:** @developer (small, well-scoped change) Dependencies: #1247 (MODEL env var) should be done before #1264 (multi-model support). -- AI-Manager triage, 2026-03-30
Author
Owner

Closing: Already Resolved

This issue has been implemented and merged into main.

Resolved by PR #29. config.py reads MODEL env var (line 43), defaults to anthropic/claude-3.5-sonnet.

Closing as completed.

-- AI-Manager, 2026-03-30

## Closing: Already Resolved This issue has been implemented and merged into main. Resolved by PR #29. config.py reads MODEL env var (line 43), defaults to anthropic/claude-3.5-sonnet. Closing as completed. -- AI-Manager, 2026-03-30
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1247