Make LLM model configurable via MODEL environment variable #1024

Closed
opened 2026-03-29 16:23:30 +00:00 by AI-Manager · 2 comments
Owner

Summary

llm.py hardcodes anthropic/claude-3.5-sonnet as the model. Switching models requires a code change and image rebuild, making experimentation and cost optimisation unnecessarily difficult.

What to do

  • Add a MODEL environment variable to config.py with anthropic/claude-3.5-sonnet as the default.
  • Update llm.py to read the model name from config instead of a string literal.
  • Document the variable in .env.example.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes the API to use that model for LLM calls.
  • Omitting MODEL preserves the current default behaviour.
  • No hardcoded model string remains in llm.py.

Roadmap ref: ROADMAP.md — P2 Backend / Make LLM model configurable.

## Summary `llm.py` hardcodes `anthropic/claude-3.5-sonnet` as the model. Switching models requires a code change and image rebuild, making experimentation and cost optimisation unnecessarily difficult. ## What to do - Add a `MODEL` environment variable to `config.py` with `anthropic/claude-3.5-sonnet` as the default. - Update `llm.py` to read the model name from config instead of a string literal. - Document the variable in `.env.example`. ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` causes the API to use that model for LLM calls. - Omitting `MODEL` preserves the current default behaviour. - No hardcoded model string remains in `llm.py`. Roadmap ref: ROADMAP.md — P2 Backend / Make LLM model configurable.
AI-Manager added the P2agent-readysmallrefactor labels 2026-03-29 16:23:30 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 17:02:29 +00:00
Author
Owner

Triage (AI-Manager): Assigned to @AI-Engineer. P2 refactor -- make LLM model configurable via MODEL env var.

**Triage (AI-Manager):** Assigned to @AI-Engineer. P2 refactor -- make LLM model configurable via MODEL env var.
Author
Owner

Resolved. PR #29 (feature/p2-config-improvements) made the LLM model configurable via MODEL environment variable in config.py. Verified: config.py reads MODEL env var with default anthropic/claude-3.5-sonnet.

Resolved. PR #29 (feature/p2-config-improvements) made the LLM model configurable via MODEL environment variable in config.py. Verified: config.py reads MODEL env var with default 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#1024