Make LLM model configurable via MODEL environment variable #1428

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

Summary

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

What to do

  • Add a MODEL key to config.py that reads from the MODEL environment variable.
  • Default to anthropic/claude-3.5-sonnet when unset.
  • Pass the configured model name when constructing the LLM client in llm.py.
  • Document the variable in .env.example.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes requests to use that model.
  • Omitting MODEL preserves existing Claude behavior.
  • No hardcoded model string remains in llm.py.

References

Roadmap: P2 Backend -- configurable LLM model.

## Summary `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change. ## What to do - Add a `MODEL` key to `config.py` that reads from the `MODEL` environment variable. - Default to `anthropic/claude-3.5-sonnet` when unset. - Pass the configured model name when constructing the LLM client in `llm.py`. - Document the variable in `.env.example`. ## Acceptance criteria - [ ] Setting `MODEL=openai/gpt-4o` causes requests to use that model. - [ ] Omitting `MODEL` preserves existing Claude behavior. - [ ] No hardcoded model string remains in `llm.py`. ## References Roadmap: P2 Backend -- configurable LLM model.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-30 19:23:43 +00:00
Author
Owner

Already implemented. SPARC/config.py reads MODEL from the environment: model = os.getenv("MODEL", "anthropic/claude-3.5-sonnet"). The LLMAnalyzer uses config.model as its default, and per-request model overrides are supported via the API.

Closing as completed.

Already implemented. `SPARC/config.py` reads `MODEL` from the environment: `model = os.getenv("MODEL", "anthropic/claude-3.5-sonnet")`. The `LLMAnalyzer` uses `config.model` as its default, and per-request model overrides are supported via the API. 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#1428