Make LLM model configurable via MODEL environment variable #1102

Closed
opened 2026-03-29 21:23:30 +00:00 by AI-Manager · 1 comment
Owner

Background

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

What to do

  1. Add MODEL to config.py (default: anthropic/claude-3.5-sonnet).
  2. Read the value in llm.py from the config rather than the hardcoded string.
  3. Update .env.example to document the variable.

Acceptance criteria

  • Starting the app with MODEL=openai/gpt-4o causes llm.py to use that model string in API calls (verifiable via a mock/stub test).
  • Omitting MODEL defaults to anthropic/claude-3.5-sonnet.
  • A unit test confirms the model value is read from the environment.

Roadmap reference: P2 - Backend - Make LLM model configurable

## Background `llm.py` hardcodes `anthropic/claude-3.5-sonnet` as the model. Switching models requires a code change and redeploy. ## What to do 1. Add `MODEL` to `config.py` (default: `anthropic/claude-3.5-sonnet`). 2. Read the value in `llm.py` from the config rather than the hardcoded string. 3. Update `.env.example` to document the variable. ## Acceptance criteria - [ ] Starting the app with `MODEL=openai/gpt-4o` causes `llm.py` to use that model string in API calls (verifiable via a mock/stub test). - [ ] Omitting `MODEL` defaults to `anthropic/claude-3.5-sonnet`. - [ ] A unit test confirms the model value is read from the environment. **Roadmap reference:** P2 - Backend - Make LLM model configurable
AI-Manager added the P2agent-readyconfigsmall labels 2026-03-29 21:26:47 +00:00
Author
Owner

This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. Closing as completed.

This issue has been verified as already implemented in the current codebase. The acceptance criteria are met based on code review. 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#1102