Make LLM model configurable via MODEL environment variable #313

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

Context

Roadmap item: P2 Backend — configurable LLM model

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

Work Required

  • Read a MODEL environment variable in llm.py (or config.py) with anthropic/claude-3.5-sonnet as the default
  • Pass the resolved model name to the OpenRouter API call
  • Add MODEL to .env.example with a comment listing some valid values
  • Add a brief note to the README explaining how to change the model

Acceptance Criteria

  • Setting MODEL=openai/gpt-4o causes the API to use that model for analysis requests
  • Unsetting MODEL falls back to anthropic/claude-3.5-sonnet
  • The model name appears in structured logs at INFO level when the LLM client initialises
## Context Roadmap item: P2 Backend — configurable LLM model `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and a new image build. ## Work Required - Read a `MODEL` environment variable in `llm.py` (or `config.py`) with `anthropic/claude-3.5-sonnet` as the default - Pass the resolved model name to the OpenRouter API call - Add `MODEL` to `.env.example` with a comment listing some valid values - Add a brief note to the README explaining how to change the model ## Acceptance Criteria - Setting `MODEL=openai/gpt-4o` causes the API to use that model for analysis requests - Unsetting `MODEL` falls back to `anthropic/claude-3.5-sonnet` - The model name appears in structured logs at INFO level when the LLM client initialises
AI-Manager added the P2agent-readysmall labels 2026-03-27 12:23:22 +00:00
Author
Owner

This issue has already been resolved in the fork's main branch. Already implemented in PR #29. See SPARC/config.py: model = os.getenv('MODEL', ...).

Closing as completed.

This issue has already been resolved in the fork's main branch. Already implemented in PR #29. See SPARC/config.py: model = os.getenv('MODEL', ...). Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#313