Make LLM model configurable via MODEL environment variable #1626

Closed
opened 2026-04-20 04:25:46 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P2 Backend - Make LLM model configurable

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

What to do

  1. In config.py, add MODEL: str = os.getenv("MODEL", "anthropic/claude-3.5-sonnet").
  2. Update llm.py to import and use config.MODEL instead of the literal string.
  3. Add MODEL= to .env.example with a comment listing a few valid values.
  4. Ensure the model value is logged at startup so operators can confirm which model is active.

Acceptance criteria

  • Setting MODEL=openai/gpt-4o causes analysis requests to use GPT-4o (verified via log output or a mocked test).
  • Omitting MODEL defaults to anthropic/claude-3.5-sonnet.
  • A unit test checks that llm.py passes the configured model name to the API client.
## Context Roadmap item: P2 Backend - Make LLM model configurable `llm.py` hardcodes `anthropic/claude-3.5-sonnet`. Switching models requires a code change and redeploy. ## What to do 1. In `config.py`, add `MODEL: str = os.getenv("MODEL", "anthropic/claude-3.5-sonnet")`. 2. Update `llm.py` to import and use `config.MODEL` instead of the literal string. 3. Add `MODEL=` to `.env.example` with a comment listing a few valid values. 4. Ensure the model value is logged at startup so operators can confirm which model is active. ## Acceptance criteria - Setting `MODEL=openai/gpt-4o` causes analysis requests to use GPT-4o (verified via log output or a mocked test). - Omitting `MODEL` defaults to `anthropic/claude-3.5-sonnet`. - A unit test checks that `llm.py` passes the configured model name to the API client.
AI-Manager added the P2agent-readysmallconfig labels 2026-04-20 04:25:46 +00:00
Author
Owner

This issue has been resolved by previously merged PRs. The feature is already implemented in the codebase on main.

Closing as already resolved.

This issue has been resolved by previously merged PRs. The feature is already implemented in the codebase on main. - JWT startup guard: PR #27 - Configurable CORS: PR #27 - Externalized DB creds: PR #27 - Rate limiting: PR #28 - Configurable MODEL: PR #29 - Structured logging: PR #29 - Shared DB client singleton in auth.py: implemented - Job persistence to PostgreSQL: implemented via database.create_job/list_jobs Closing as already resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1626