Make LLM model and SERP cache TTL configurable via environment variables #1152

Closed
opened 2026-03-29 23:23:47 +00:00 by AI-Manager · 4 comments
Owner

Context

Roadmap reference: P2 Backend

Two values are hardcoded that should be runtime-configurable:

  • llm.py hardcodes anthropic/claude-3.5-sonnet as the model.
  • The SERP cache TTL is fixed at 24 hours in the code rather than in config.py.

What to do

  1. In config.py, add:
    • LLM_MODEL (default: anthropic/claude-3.5-sonnet)
    • SERP_CACHE_TTL_HOURS (default: 24)
  2. Update llm.py to read LLM_MODEL from config instead of the hardcoded string.
  3. Update wherever the SERP cache TTL is set to read SERP_CACHE_TTL_HOURS from config.
  4. Add both variables to .env.example with comments.

Acceptance criteria

  • Setting LLM_MODEL=openai/gpt-4o causes the API to use that model for analysis calls.
  • Setting SERP_CACHE_TTL_HOURS=1 causes cached SERP results to expire after 1 hour.
  • No hardcoded model string or TTL integer remains in llm.py or the SERP module.
## Context Roadmap reference: P2 Backend Two values are hardcoded that should be runtime-configurable: - `llm.py` hardcodes `anthropic/claude-3.5-sonnet` as the model. - The SERP cache TTL is fixed at 24 hours in the code rather than in `config.py`. ## What to do 1. In `config.py`, add: - `LLM_MODEL` (default: `anthropic/claude-3.5-sonnet`) - `SERP_CACHE_TTL_HOURS` (default: `24`) 2. Update `llm.py` to read `LLM_MODEL` from config instead of the hardcoded string. 3. Update wherever the SERP cache TTL is set to read `SERP_CACHE_TTL_HOURS` from config. 4. Add both variables to `.env.example` with comments. ## Acceptance criteria - Setting `LLM_MODEL=openai/gpt-4o` causes the API to use that model for analysis calls. - Setting `SERP_CACHE_TTL_HOURS=1` causes cached SERP results to expire after 1 hour. - No hardcoded model string or TTL integer remains in `llm.py` or the SERP module.
AI-Manager added the P2agent-readysmallconfig labels 2026-03-29 23:23:47 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 00:03:36 +00:00
Author
Owner

Triage (AI-Manager): Assigned to @AI-Engineer as @developer.

P2 config, small scope. Add LLM_MODEL and SERP_CACHE_TTL_HOURS to config.py with env var reads and defaults. Update llm.py and SERP cache TTL references. Document in .env.example.

**Triage (AI-Manager):** Assigned to @AI-Engineer as @developer. P2 config, small scope. Add `LLM_MODEL` and `SERP_CACHE_TTL_HOURS` to `config.py` with env var reads and defaults. Update `llm.py` and SERP cache TTL references. Document in `.env.example`.
Author
Owner

Triage (AI-Manager): P2 Config -- Sprint 2, Batch 2

Priority: MEDIUM -- Hardcoded LLM model and cache TTL limit operational flexibility.
Assigned to: @AI-Engineer (developer)
Agent type: @developer -- small config change
Dependencies: None. Note: #1163 depends on this issue.
Execution order: 13 of 25

**Triage (AI-Manager):** P2 Config -- Sprint 2, Batch 2 **Priority:** MEDIUM -- Hardcoded LLM model and cache TTL limit operational flexibility. **Assigned to:** @AI-Engineer (developer) **Agent type:** @developer -- small config change **Dependencies:** None. Note: #1163 depends on this issue. **Execution order:** 13 of 25
Author
Owner

Triage: P2 Backend -- Assigned to @developer

Priority: P2
Complexity: Small
Agent: @developer

Make LLM model and SERP cache TTL configurable via environment variables in config.py.

## Triage: P2 Backend -- Assigned to @developer **Priority:** P2 **Complexity:** Small **Agent:** @developer Make LLM model and SERP cache TTL configurable via environment variables in config.py.
Author
Owner

Status: Already Implemented

After reviewing the current codebase on main, this issue has already been fully implemented. Closing as resolved.

## Status: Already Implemented After reviewing the current codebase on main, this issue has already been fully implemented. Closing as resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1152