Skip to content

feat(ai): proactive model prewarming and vram eviction guard #127

Closed

Description

@dan-petty

Problem Statement

Local LLMs (Ollama) unload models from GPU VRAM after 5 minutes of inactivity by default (keep_alive). When a developer or automated review command triggers after idle time, loading a 26GB+ model into VRAM takes 15–45 seconds, causing CLI timeouts or perceived freezes. There is currently no standalone command or FastMCP tool to prewarm models across candidate nodes before long-running review, test synthesis, or CI operations.

Proposed Changes

  • Implement devops ai prewarm [--model <name>] [--keep-alive 1h|24h|forever] [--all-nodes].
  • Dispatch asynchronous prewarming calls to /api/generate with empty prompts and explicit keep_alive durations across all candidate cluster nodes.
  • Expose FastMCP tool ai_prewarm_models to allow AI coding assistants to ensure models are warm before heavy tasks.

Acceptance Criteria

  • Prewarms specified models into VRAM with confirmed HTTP 200 responses.
  • Eliminates 15-45s cold-start delays on subsequent review or chat commands.
  • Unit tests in tests/test_ai_prewarm.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2-mediumscope/aitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions