Skip to content

feat(install): check free storage before pulling an LLM model - #31

Merged
mukeshkumarcharak merged 1 commit into
mainfrom
claude/serene-turing-yrxky2
Jul 13, 2026
Merged

feat(install): check free storage before pulling an LLM model#31
mukeshkumarcharak merged 1 commit into
mainfrom
claude/serene-turing-yrxky2

Conversation

@mukeshkumarcharak

Copy link
Copy Markdown
Contributor

Ollama models are 1–20+ GB; on a phone that is often more than the free space, so a blind ollama pull wastes a long download and then fails. Gate the pull on available disk.

  • Add _detect_free_disk_mb (df -Pk on the Ollama models dir, walking up to the nearest existing parent), _model_size_mb (per-parameter-size estimate, deliberately a little high), and _largest_model_that_fits.
  • In select_and_pull_llm_model: if the chosen model is already on disk, pull needs no space. Otherwise, if it doesn't fit, downgrade to the largest model that does; if nothing fits, reuse an already-pulled model or skip the download with a clear "free up space, then: ollama pull gemma3:1b" message instead of failing mid-download.
  • verify()'s "model not downloaded" report now notes when the cause is low storage and adjusts the fix hint accordingly.

Ollama models are 1–20+ GB; on a phone that is often more than the free
space, so a blind `ollama pull` wastes a long download and then fails.
Gate the pull on available disk.

- Add _detect_free_disk_mb (df -Pk on the Ollama models dir, walking up to
  the nearest existing parent), _model_size_mb (per-parameter-size
  estimate, deliberately a little high), and _largest_model_that_fits.
- In select_and_pull_llm_model: if the chosen model is already on disk,
  pull needs no space. Otherwise, if it doesn't fit, downgrade to the
  largest model that does; if nothing fits, reuse an already-pulled model
  or skip the download with a clear "free up space, then: ollama pull
  gemma3:1b" message instead of failing mid-download.
- verify()'s "model not downloaded" report now notes when the cause is low
  storage and adjusts the fix hint accordingly.
@mukeshkumarcharak
mukeshkumarcharak merged commit 2a759a8 into main Jul 13, 2026
0 of 6 checks passed
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.

2 participants