Skip to content

Expose LLM sampling temperature as an admin-configurable setting #70

Open

Description

@prometheusgr

Context

docs/CONFIG_AUDIT_2026-09-04.md found that backend/app/core/llm_client.py:94 hardcodes temperature=0.7 on the ChatOpenAI construction, with no env var or DB override at all — conspicuously the one LLM parameter left out of the otherwise-complete resolve_llm_config resolver, which already covers provider/url/model/timeout via system_settings_service.py.

Scope

  1. Add nullable SystemSettings column llm_temperature (float), env-default fallback in backend/app/core/config.py, resolved via the existing resolve_llm_config (extend it — this is the same resolver, not a new one).
  2. Wire into llm_client.py's ChatOpenAI construction, replacing the literal 0.7.
  3. Add to the existing Settings UI LLM section (no new section needed) with a tooltip explaining the tradeoff (lower = more deterministic/factual, higher = more varied).
  4. Audit-log on change, folded into the existing LLM config audit event if one exists, or "llm_config.temperature_update" if scalar fields are audited individually.

Definition of Done

  • llm_temperature nullable column + Alembic migration.
  • resolve_llm_config extended, unit-tested.
  • Wired into llm_client.py.
  • Settings UI field + tooltip added to the existing LLM section.
  • Audit logging on change.
  • RBAC call-out per AGENTS.md TDD Discipline step 0: admin feature.
  • Standard merge gate from AGENTS.md's Definition of Done applies in full.

Activity

  1. added
    polishAdmin/UI surfacing or refinement of existing capability, not new functionality
    type:improvementMakes an existing capability better/safer/more complete
    effort:SSmall: single file/component, hours not days
    area:chat-uxChat UI/agent runtime behavior visible to users
    on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:chat-uxChat UI/agent runtime behavior visible to userseffort:SSmall: single file/component, hours not dayspolishAdmin/UI surfacing or refinement of existing capability, not new functionalitypriority:P2Valuable, not urgenttype:improvementMakes an existing capability better/safer/more complete

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions