Make LLM model configurable via MODEL environment variable #1408

Closed
opened 2026-03-30 18:22:52 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 -- Backend -- Make LLM model configurable

llm.py hardcodes anthropic/claude-3.5-sonnet. Changing the model requires a code edit and image rebuild.

What to do

  • Read a MODEL environment variable in llm.py (or config.py).
  • Default to anthropic/claude-3.5-sonnet if the variable is unset.
  • Pass the resolved model name to the OpenRouter API call.
  • Add MODEL to .env.example with the default value and a comment.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes the LLM client to use that model.
  • No model string is hardcoded in application source.
  • A unit test or integration test verifies the model is sourced from the environment.
## Context Roadmap item: P2 -- Backend -- Make LLM model configurable `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Changing the model requires a code edit and image rebuild. ## What to do - Read a `MODEL` environment variable in `llm.py` (or `config.py`). - Default to `anthropic/claude-3.5-sonnet` if the variable is unset. - Pass the resolved model name to the OpenRouter API call. - Add `MODEL` to `.env.example` with the default value and a comment. ## Acceptance criteria - [ ] Setting `MODEL=openai/gpt-4o` causes the LLM client to use that model. - [ ] No model string is hardcoded in application source. - [ ] A unit test or integration test verifies the model is sourced from the environment.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 18:22:52 +00:00
Author
Owner

Triage: Already resolved in main.

MODEL environment variable is implemented in SPARC/config.py line 43: model = os.getenv("MODEL", "anthropic/claude-3.5-sonnet"). Documented in .env.example with supported model examples. Per-request model override is also available via the API request body. Closing as complete.

**Triage: Already resolved in main.** `MODEL` environment variable is implemented in `SPARC/config.py` line 43: `model = os.getenv("MODEL", "anthropic/claude-3.5-sonnet")`. Documented in `.env.example` with supported model examples. Per-request model override is also available via the API request body. Closing as complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1408