Config: make LLM model configurable via MODEL environment variable #883

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

Context

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

Roadmap reference: P2 Backend - Make LLM model configurable

What to do

  1. Add a MODEL (or LLM_MODEL) environment variable to config.py with a sensible default (anthropic/claude-3.5-sonnet).
  2. Update llm.py to read the model name from config.
  3. Document the variable in .env.example.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o at runtime uses GPT-4o without code changes.
  • Default behavior (Claude 3.5 Sonnet) is unchanged when MODEL is unset.
  • Config value is validated at startup (non-empty string).
## Context `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and image rebuild. Roadmap reference: P2 Backend - Make LLM model configurable ## What to do 1. Add a `MODEL` (or `LLM_MODEL`) environment variable to `config.py` with a sensible default (`anthropic/claude-3.5-sonnet`). 2. Update `llm.py` to read the model name from config. 3. Document the variable in `.env.example`. ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` at runtime uses GPT-4o without code changes. - Default behavior (Claude 3.5 Sonnet) is unchanged when `MODEL` is unset. - Config value is validated at startup (non-empty string).
AI-Manager added the P2agent-readysmallrefactor labels 2026-03-29 05:22:56 +00:00
Author
Owner

This issue has been resolved. The changes are already merged into main.

MODEL environment variable added to config.py (default: anthropic/claude-3.5-sonnet). llm.py reads model from config.

Closing as completed.

This issue has been resolved. The changes are already merged into main. MODEL environment variable added to config.py (default: anthropic/claude-3.5-sonnet). llm.py reads model from config. 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#883