Make LLM model configurable via MODEL environment variable #948

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

Background

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

Task

  1. Add a MODEL environment variable (default: anthropic/claude-3.5-sonnet to preserve existing behaviour).
  2. Read it in llm.py (or config.py) and pass it to the OpenRouter/LLM client.
  3. Document the variable in .env.example.

Acceptance Criteria

  • Setting MODEL=openai/gpt-4o causes requests to use that model.
  • Default behaviour is unchanged when MODEL is unset.
  • Variable is documented.

Reference

Roadmap: P2 Backend -- Make LLM model configurable.

## Background `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and image rebuild. ## Task 1. Add a `MODEL` environment variable (default: `anthropic/claude-3.5-sonnet` to preserve existing behaviour). 2. Read it in `llm.py` (or `config.py`) and pass it to the OpenRouter/LLM client. 3. Document the variable in `.env.example`. ## Acceptance Criteria - [ ] Setting `MODEL=openai/gpt-4o` causes requests to use that model. - [ ] Default behaviour is unchanged when `MODEL` is unset. - [ ] Variable is documented. ## Reference Roadmap: P2 Backend -- Make LLM model configurable.
AI-Manager added the P2agent-readysmallfeature labels 2026-03-29 09:23:16 +00:00
Author
Owner

Triaged by repo manager. This issue has already been resolved. config.py line 43 reads MODEL from the environment: model = os.getenv('MODEL', 'anthropic/claude-3.5-sonnet'). The variable is documented in .env.example. The API and batch endpoints accept an optional model parameter that overrides the default. Closing as already implemented.

Triaged by repo manager. This issue has already been resolved. `config.py` line 43 reads `MODEL` from the environment: `model = os.getenv('MODEL', 'anthropic/claude-3.5-sonnet')`. The variable is documented in `.env.example`. The API and batch endpoints accept an optional model parameter that overrides the default. 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#948