Skip to content

cache list should show actual PVC contents, not just Model CRs #56

@Defilan

Description

@Defilan

Problem

The llmkube cache list command currently lists Model CRD resources and their cache keys, not the actual contents of the model cache PVC.

This means:

  • If Model CRs are deleted but cached models remain in the PVC, they won't be shown
  • Users can't see what's actually consuming storage in the cache PVC
  • No way to discover "orphaned" cache entries

Current Behavior

llmkube cache list -n my-namespace
# Only shows Model CRs that have cacheKey in status
# Returns "No models found" if no Model CRs exist, even if PVC has cached models

Expected Behavior

The command should show actual cached models by:

  1. Finding a pod that mounts the llmkube-model-cache PVC in the namespace
  2. Exec'ing into the pod to list /models/ directory contents
  3. Cross-referencing with Model CRs to show which are "active" vs "orphaned"

Example output:

Model Cache Entries (namespace: my-namespace)
═══════════════════════════════════════════════════════════════════════════════
CACHE KEY         SIZE      STATUS      MODELS              SOURCE
a3b8c9d4e5f67890  4.1 GiB   active      llama-2-7b          ...TheBloke/Llama-2-7B-GGUF/...
f1c314277254a2fd  7.2 GiB   orphaned    -                   (unknown)

Total: 2 cache entries (1 active, 1 orphaned), 11.3 GiB used

Additional Improvements

  • Show disk usage from actual PVC
  • Add --orphaned flag to show only orphaned entries
  • Add ability to clean orphaned entries: llmkube cache clear --orphaned
  • Better feedback: "Checking namespace X..." when running

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions