Skip to content

feat(models): report per-model disk usage in API and WebUI - #12551

Merged
mudler merged 1 commit into
mudler:masterfrom
blackd:model-storage-index
Oct 7, 2026
Merged

mudler merged 1 commit into
mudler:masterfrom
blackd:model-storage-index

Conversation

@blackd

@blackd blackd commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Description

A new admin endpoint, GET /api/models/storage, reporting the on-disk footprint of the installed model configurations:

  • Per model: total size, the portion shared with other models, the referenced files, and references whose files are missing from disk.
  • Per file: size, the models referencing it, shared/missing status.
  • Totals: deduplicated β€” a file referenced by several models is counted once.

The WebUI (Installed models view) shows:

  • a summary line: total on disk, shared portion, missing-reference count;
  • the full file list with per-file status in the detail pane while no model is selected, with model names linking to their detail;
  • a per-model file table in the selected model's detail panel, including which other models share each file.

Design notes

  • File attribution reuses listModelFiles β€” the same resolution the delete endpoint trusts β€” so a model's reported size is what deleting it would consider, gallery sidecar included. An absent sidecar on a hand-written config is normal and not reported as missing.
  • Missing references are warnings, not errors: a failed/interrupted download or a hand-removed file shouldn't blank the report. Per-config parse failures are likewise reported in an errors field instead of failing the index.
  • Files in the models directory that no configuration references are deliberately out of scope here; an orphan/cleanup view is a natural follow-up.
  • No MCP tool: the report is a read-only diagnostic surfaced in the UI rather than an admin action (install/edit/toggle); happy to add one if preferred.

Testing

  • New ginkgo specs in core/gallery/storage_test.go: sidecar-inclusive attribution, shared-file dedup, missing references per model and per file, and broken-config resilience.
  • Verified live against a 44-model installation (463 GB, shared and multi-file artifact models included).
  • Docs updated (getting-started/models.md, features/api-discovery.md); swagger regenerated.
    Notes for Reviewers

Signed commits

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

New admin endpoint GET /api/models/storage reports disk usage of the
installed models: each model's files and sizes, files shared between
models counted once, and configured files that are missing from disk.
The models WebUI page shows a usage summary, each model's file table,
and the full file list with per-file status.

Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Plamen K. Kosseff <p.kosseff@gmail.com>
@mudler
mudler merged commit c03acb0 into mudler:master Oct 7, 2026
1 check passed
@blackd
blackd deleted the model-storage-index branch October 7, 2026 20:15
@mudler-agent mudler-agent added the enhancement New feature or request label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants