Skip to content

feat(serve-ui): integrate cache, flat, and flat-structured storage modes in the Web UI#82

Open
Jellypowered wants to merge 3 commits into
bodaay:masterfrom
Jellypowered:feature/flat-storage-modes
Open

feat(serve-ui): integrate cache, flat, and flat-structured storage modes in the Web UI#82
Jellypowered wants to merge 3 commits into
bodaay:masterfrom
Jellypowered:feature/flat-storage-modes

Conversation

@Jellypowered
Copy link
Copy Markdown

Issue

Implements #77

What this PR does

Adds storage mode support to serve + Web UI, with one consistent flow across Analyze, Download, Plan, Settings, and Cache management.

Storage modes

Web UI downloads can now run in:

  • cache (default): HF-compatible cache layout (hub/... + friendly view)
  • flat: plain files directly in cache root
  • flat-structured: plain files in <cacheRoot>/<owner>/<repo>/

Settings / UX

  • Settings now supports editing:
    • cache directory
    • default storage mode
  • Mode changes apply immediately in the UI (no refresh needed)
  • Analyze command preview reflects the active mode
  • Settings cards were resized/scroll-fixed so content is no longer clipped

Cache page + API coverage

Cache discovery/management now works across all supported layouts:

  • HF cache layout
  • flat-structured layout
  • flat indexed layout

Includes list/info/delete support for each, with fallback resolution across roots.

Flat mode details

  • Added flat index manifests so flat downloads are discoverable/manageable from Cache
  • Index is written for completed and interrupted/canceled runs
  • Flat delete removes indexed files and multipart artifacts (.part, .part-*)
  • Flat naming tweaks to avoid collisions at root:
    • skip .gitattributes
    • README.md -> <repo>.README.md
    • generic mmproj* / imatrix* names are prefixed by repo name

Safety / guards

  • Keeps strict repo/path validation on delete paths
  • Maintains traversal/symlink safeguards
  • Delete paths only clear index state after successful cleanup

Compatibility

  • Default upstream behavior is preserved in cache mode
  • New behavior is additive and opt-in via mode selection
  • No intended behavior changes for existing users who stay on default mode

Testing

Manually validated across:

  • cache, flat, and flat-structured
  • analyze -> download -> cache list/info/delete
  • completed and canceled/interrupted downloads
  • multipart residue cleanup
  • mode switching in Settings and immediate UI effect

DISCLAIMER: I absolutely DID use AI to help prepare the documentation and PR message. I'm LAZY, not stupid ;) Hope this helps!

…des with unified cache management

Integrate storage mode support into serve and Web UI with seamless compatibility for existing cache workflows.

What this adds
- Adds three storage modes for Web UI downloads:
  - cache (default, HuggingFace-compatible layout)
  - flat (plain files at cache root)
  - flat-structured (plain files under owner/repo)
- Adds storage mode and cache directory controls in Settings with persisted defaults.
- Ensures Analyze, Download, and Plan flows all follow the selected storage mode.
- Updates Analyze command preview to reflect active storage mode flags.

Cache management integration
- Extends Cache page and API discovery across all supported layouts:
  - HuggingFace hub cache layout
  - flat-structured owner/repo layout
  - flat indexed layout
- Supports list, info, and delete operations across these layouts from one interface.

Safety and reliability
- Retains strict path validation and repository input safeguards.
- Includes manifest/index tracking for non-cache layouts so cache operations remain deterministic.
- Handles interrupted multipart artifacts in cache cleanup paths.
- Resolves symlinked cache/destination paths to real filesystem paths before file operations.

UI and usability
- Improves Settings card sizing/scroll behavior so content is no longer clipped in the original layout.
- Applies updated storage mode behavior in UI workflows without requiring manual refresh.

Compatibility
- Preserves default upstream cache-mode workflow and Python ecosystem compatibility.
- Integrates new modes without changing the default user path unless explicitly selected.

Validation
- Thoroughly tested across cache, flat, and flat-structured workflows for analyze, download, listing, and deletion scenarios.
- Verified symlinked destination handling in flat-structured mode, including large multipart model artifacts (imatrix and mmproj-* files), with successful completion beyond prior ~95% stall point.

Implements: bodaay#77
@Jellypowered Jellypowered force-pushed the feature/flat-storage-modes branch from 19399ba to e55d1c9 Compare May 14, 2026 15:06
…output roots

Resolve symlinks on cfg.OutputDir (root) instead of destinationBase(job,cfg).
This preserves correct flat-structured layout (owner/repo exactly once)
while keeping symlink-safe file operations for multipart rename/resume paths.
… Add size-first skip path for local/flat downloads\n- Prevent long pre-skip SHA256 hashing on existing GGUF files\n- Keeps behavior consistent with verify=size expectations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant