Skip to content

refactor(k8s): clean up gpu matrix, eliminate vllm references and extract static json asset #1223

Closed

Description

@dan-petty

Refactor gpu_matrix.py: extract hardcoded dictionaries into structured json asset, remove vestigial vllm references across models and aliases, and derive gateway routing entries from canonical gateway configmap.

Activity

  1. added this to the v0.2.27 milestone on Oct 5, 2026
  2. added
    type/refactor
    scope/k8s
    priority/p1-high
    on Oct 5, 2026
  3. dan-petty-bot commented on Oct 5, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1224, merged into release/v0.2.27 as 09b8d5d.

    Summary

    Closes #1223.

    Refactors the Kubernetes GPU configuration matrix and service alias system (src/devops_cli/k8s/gpu_matrix.py):

    1. Asset Extraction: Extracts hardcoded matrix profiles, provider service aliases, speed tier service aliases, and gateway routes from static Python dictionaries into src/devops_cli/k8s/gpu_matrix.json.
    2. Eliminates Vestigial vLLM References: Purges 12 unused vLLM hardware profiles and 8 unused vLLM service aliases. Retains only the 12 Ollama profiles and 8 Ollama service aliases matching the cluster manifests.
    3. Eliminates Iterative Attribute Loops: Replaces iterative attribute computation (total_vram_gib) in loops with validated schema models (GpuProfile).
    4. Code Reduction: Reduces src/devops_cli/k8s/gpu_matrix.py from 845 lines down to 136 lines, parsing the structured JSON asset once via @functools.cache.
    5. Gateway Routing Alignment: Ensures get_gateway_routing_entries() returns the canonical 19 LiteLLM routes matching k8s/llm/gateway/configmap.yaml.

    8 file(s) changed.

    How it was verified

    Check runs at 4575c4e:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1223-refactor-gpu-matrix.md:

    • Extract profiles, provider_service_aliases, speed_tier_service_aliases, and gateway_routes into src/devops_cli/k8s/gpu_matrix.json.
    • Eliminate all vestigial vllm profiles, service aliases, and backend literals from src/devops_cli/k8s/gpu_matrix.py and src/devops_cli/commands/k8s/gpu_matrix.py.
    • Replace iterative attribute population in loops with validated schema models (GpuProfile).
    • Ensure get_gateway_routing_entries() returns the 19 LiteLLM routes matching k8s/llm/gateway/configmap.yaml.
    • Update test suite in tests/test_k8s_gpu_matrix.py covering all 12 profiles, service aliases, filtering, CLI table/json formatting, and gateway consistency.
    • Pre-push Gated CI validation suite passes with 100% green status.
    • Pending a person: review and merge PR on GitHub.
  4. added a commit that references this issue on Oct 6, 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

    priority/p1-highscope/k8stype/refactor

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions