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

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

Context

llm.py hardcodes the model anthropic/claude-3.5-sonnet. config.py hardcodes the SERP cache TTL at 24 hours. Both should be configurable without code changes.

Work

  • In config.py, add LLM_MODEL (default anthropic/claude-3.5-sonnet) and SERP_CACHE_TTL_HOURS (default 24) settings.
  • In llm.py, read the model from config.LLM_MODEL instead of a literal string.
  • In serp_api.py (or wherever the TTL is used), read from config.SERP_CACHE_TTL_HOURS.
  • Update .env.example with both variables.

Acceptance Criteria

  • Setting LLM_MODEL=openai/gpt-4o causes the LLM client to use that model.
  • Setting SERP_CACHE_TTL_HOURS=48 doubles the cache TTL.
  • Default behavior is unchanged when neither variable is set.
  • Unit tests cover that config values are read from environment.

References

Roadmap: P2 — Backend — Make LLM model configurable; SERP cache TTL hardcoded.

## Context `llm.py` hardcodes the model `anthropic/claude-3.5-sonnet`. `config.py` hardcodes the SERP cache TTL at 24 hours. Both should be configurable without code changes. ## Work - In `config.py`, add `LLM_MODEL` (default `anthropic/claude-3.5-sonnet`) and `SERP_CACHE_TTL_HOURS` (default `24`) settings. - In `llm.py`, read the model from `config.LLM_MODEL` instead of a literal string. - In `serp_api.py` (or wherever the TTL is used), read from `config.SERP_CACHE_TTL_HOURS`. - Update `.env.example` with both variables. ## Acceptance Criteria - Setting `LLM_MODEL=openai/gpt-4o` causes the LLM client to use that model. - Setting `SERP_CACHE_TTL_HOURS=48` doubles the cache TTL. - Default behavior is unchanged when neither variable is set. - Unit tests cover that config values are read from environment. ## References Roadmap: P2 — Backend — Make LLM model configurable; SERP cache TTL hardcoded.
AI-Manager added the P2agent-readysmall labels 2026-03-26 16:22:56 +00:00
Author
Owner

This issue has already been resolved. LLM model and SERP cache TTL are configurable via environment variables in SPARC/config.py.

Resolved by PR #29. Closing.

This issue has already been resolved. LLM model and SERP cache TTL are configurable via environment variables in `SPARC/config.py`. Resolved by PR #29. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#124