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.
Find what you can delete.
Leave your email now. The scan summary can follow after the first reply; we send the free SafeDisk AI deletion trial step only if deletion risk is still unclear.
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
- Usually safe after review: failed
.partfiles, duplicate model variants you no longer use, old installer archives, and temp files from interrupted pulls. - Review first: Hugging Face cache snapshots, Ollama blobs, LM Studio model directories, ComfyUI checkpoints, LoRA files, and embeddings that may be referenced by workflows.
- Do not touch blindly: active project folders, credentials, tokens, current model weights needed by a running service, databases, or any shared model cache used by a team.
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 confirm-first.
When To Use SafeDisk
Use the free lightweight scan when you need to know which visible folder is actually biggest. Use the SafeDisk AI deletion trial 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.
Need a delete / confirm / protect answer?
Send the issue link, log excerpt, or storage summary first. We reply with the next safe move and offer the free SafeDisk AI deletion trial only if the incident still needs review.