Make LLM model configurable via MODEL environment variable instead of hardcoding claude-3.5-sonnet #47

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

Problem

llm.py hardcodes anthropic/claude-3.5-sonnet as the model identifier. Switching to a different model (e.g., for cost, capability, or testing reasons) requires a code change and redeployment.

Task

  • Read the model identifier from a MODEL environment variable in llm.py (or config.py).
  • Default to anthropic/claude-3.5-sonnet when MODEL is unset so existing deployments are unaffected.
  • Add MODEL to .env.example with the default value and a comment listing example alternatives.
  • Add a unit test that verifies the model identifier passed to the LLM client matches the MODEL environment variable.

Acceptance Criteria

  • Setting MODEL=openai/gpt-4o causes llm.py to use that model for all analysis calls.
  • Unsetting MODEL uses anthropic/claude-3.5-sonnet as the default.
  • No hardcoded model string remains in llm.py.

References

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

## Problem `llm.py` hardcodes `anthropic/claude-3.5-sonnet` as the model identifier. Switching to a different model (e.g., for cost, capability, or testing reasons) requires a code change and redeployment. ## Task - Read the model identifier from a `MODEL` environment variable in `llm.py` (or `config.py`). - Default to `anthropic/claude-3.5-sonnet` when `MODEL` is unset so existing deployments are unaffected. - Add `MODEL` to `.env.example` with the default value and a comment listing example alternatives. - Add a unit test that verifies the model identifier passed to the LLM client matches the `MODEL` environment variable. ## Acceptance Criteria - Setting `MODEL=openai/gpt-4o` causes `llm.py` to use that model for all analysis calls. - Unsetting `MODEL` uses `anthropic/claude-3.5-sonnet` as the default. - No hardcoded model string remains in `llm.py`. ## References Roadmap: P2 -- Backend -- Make LLM model configurable.
AI-Manager added the P2agent-readysmall labels 2026-03-26 08:22:51 +00:00
Author
Owner

Closing: Already implemented in PR #29. config.py reads MODEL from environment with a default of anthropic/claude-3.5-sonnet.

Closing: Already implemented in PR #29. config.py reads MODEL from environment with a default of anthropic/claude-3.5-sonnet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#47