SafeDisk AI

Local Model Download Disk Preflight

Before pulling a 4 GB, 16 GB, or 70 GB local AI model, check the model cache volume, partial files, temp path, and auth response. Most local-model ENOSPC failures are preventable.

Browser SafeDisk scan

Find the largest model and cache buckets first.

The browser scanner reads storage metadata locally in Chrome or Edge. Use it to find model caches, downloads, Docker, Xcode, and AI-agent storage before deleting anything.

Open free scan Request $29 cleanup order

Preflight The Model Directory, Not Only Root Disk

A local model install can fail even when the top-level disk looks acceptable. Check the exact directory used by Hugging Face, LM Studio, Ollama, llama.cpp, ComfyUI, or your own installer. Also check the temp directory if the model is staged before the final move.

models_dir="$HOME/.cache/huggingface"
df -h "$models_dir" 2>/dev/null || df -h "$HOME"
df -i "$models_dir" 2>/dev/null || true
du -sh "$models_dir" 2>/dev/null
du -sh "$HOME/.cache" "$HOME/Downloads" "$HOME/Library/Caches" 2>/dev/null
find "$models_dir" -maxdepth 4 -type f \( -name "*.gguf" -o -name "*.safetensors" -o -name "*.bin" -o -name "*.part" -o -name "*.tmp" \) -print0 2>/dev/null | xargs -0 du -sh 2>/dev/null | sort -h | tail -30

Use Remaining Bytes For Resumed Downloads

Do not require the full model size again if a valid partial file can resume. Do keep headroom for extraction, metadata, tokenizer files, and failed retries.

required_bytes = selected_variant_size_bytes
existing_part_bytes = size(".part") || 0
remaining_bytes = max(0, required_bytes - existing_part_bytes)
headroom = max(2 GiB, required_bytes * 0.12)
needed = remaining_bytes + headroom

If available bytes on the model volume are below needed, pause before starting the model pull. Free space first, move the model directory, or choose a smaller quantization.

Auth HTML Is Not A Model File

When a gated model or expired token returns an HTML login page, the saved file can look like a corrupted model or a tiny GGUF. Check the first bytes and content type before retrying a huge download loop.

candidate="$models_dir/model.gguf"
file "$candidate" 2>/dev/null
head -c 120 "$candidate" 2>/dev/null | sed 's/[[:cntrl:]]/ /g'
ls -lh "$candidate" 2>/dev/null

If the file starts with HTML or is far smaller than the selected variant, fix auth first. Do not count it as a usable partial model.

Safe, Review, Do Not Touch

Copy-ready GitHub reply

Use this when a local model install fails with ENOSPC.

It keeps the issue focused on disk preflight, resume logic, auth, and safe cleanup instead of broad deletion.

Before retrying the model pull, can we add a disk preflight around the exact model/cache directory?

models_dir="$HOME/.cache/huggingface"
df -h "$models_dir" 2>/dev/null || df -h "$HOME"
du -sh "$models_dir" 2>/dev/null
find "$models_dir" -maxdepth 4 -type f \( -name "*.gguf" -o -name "*.safetensors" -o -name "*.bin" -o -name "*.part" -o -name "*.tmp" \) -print0 2>/dev/null | xargs -0 du -sh 2>/dev/null | sort -h | tail -30

The install should compare available bytes against remaining download bytes plus headroom, not only the full model size. It should also detect auth HTML or tiny files saved as a model before retrying. Failed partials and duplicate variants are cleanup candidates; active weights, tokens, and shared caches should be review-first.
Check $29 fit

When To Use SafeDisk

Use the free browser scan when you need to know which visible folder is actually biggest. Use the $29 Deep Cleanup when the result contains model weights, Docker volumes, AI-agent state, or project caches where deleting the wrong item would cost more than the cleanup.

Deep Cleanup

Need a local-model cleanup order?

Submit one request. We use your browser scan summary or short storage note to separate safe, review-first, and do-not-touch model storage.