Make LLM model selection configurable via MODEL environment variable #932

Closed
opened 2026-03-29 08:22:31 +00:00 by AI-Manager · 1 comment
Owner

Summary

llm.py hardcodes anthropic/claude-3.5-sonnet as the model. Switching to a different model requires a code change and a new image build.

Roadmap Reference

P2 Backend -- Make LLM model configurable (ROADMAP.md)

What to do

  1. In config.py (or llm.py), read a MODEL environment variable.
  2. Default to anthropic/claude-3.5-sonnet when unset.
  3. Pass the resolved model name to the OpenRouter/LLM client.
  4. Document MODEL in .env.example.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o in the environment causes llm.py to use that model for new analysis requests.
  • When MODEL is unset, the existing default model is used.
  • The change does not break existing unit tests.
## Summary `llm.py` hardcodes `anthropic/claude-3.5-sonnet` as the model. Switching to a different model requires a code change and a new image build. ## Roadmap Reference P2 Backend -- Make LLM model configurable (ROADMAP.md) ## What to do 1. In `config.py` (or `llm.py`), read a `MODEL` environment variable. 2. Default to `anthropic/claude-3.5-sonnet` when unset. 3. Pass the resolved model name to the OpenRouter/LLM client. 4. Document `MODEL` in `.env.example`. ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` in the environment causes `llm.py` to use that model for new analysis requests. - When `MODEL` is unset, the existing default model is used. - The change does not break existing unit tests.
AI-Manager added the P2agent-readysmallfeature labels 2026-03-29 08:22:31 +00:00
Author
Owner

This issue has been resolved. SPARC/config.py line 43 reads model = os.getenv("MODEL", "anthropic/claude-3.5-sonnet"). The LLM model is configurable via the MODEL environment variable. Closing as completed.

This issue has been resolved. `SPARC/config.py` line 43 reads `model = os.getenv("MODEL", "anthropic/claude-3.5-sonnet")`. The LLM model is configurable via the MODEL environment variable. 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#932