Running Large Language Models without a dedicated GPU is no longer a luxury reserved for the cloud elite, but it requires precise memory management. A new utility published on DEV.to by developer nuvemdev offers a straightforward solution to the perennial question: which Ollama models will actually fit into my system's RAM? The script, written in pure Python, bypasses the need for complex dependencies, focusing solely on reading system memory and comparing it against known model sizes.

The Memory Math Behind Local Inference

The core of the tool is a hard-coded dictionary of current Ollama model tags and their approximate download sizes, sourced directly from ollama.com/library as of early December 2026. The script implements a practical heuristic rather than relying solely on official documentation: it adds a 1.5 GB buffer to every model's size to account for system overhead and context window requirements. For instance, while gemma3:12b is listed at 8.2 GB, the script requires over 9.7 GB of available RAM to mark it as viable. This rule of thumb prevents the common failure mode where a model downloads successfully but crashes the OS during inference due to memory exhaustion.

CPU Performance Realities for 7B+ Models

While the script solves the capacity problem, it does not ignore the performance bottleneck inherent in CPU-only inference. The author explicitly notes that while models in the 1-3 billion parameter range (such as llama3.2:3b or phi4-mini) perform adequately for tasks like summarization and classification on CPU, larger models like qwen2.5:7b or gemma3:12b will suffer significant latency. The tool helps users avoid renting expensive VPS instances with insufficient RAM, but it also serves as a warning: if your hardware cannot fit the model, it certainly won't run it fast. The recommended workflow involves installing Ollama via a curl script and pulling the model only after the Python check confirms compatibility.

Key Takeaways

  • The script uses a static list of model sizes from Ollama's library, requiring manual updates as new models are released.
  • A 1.5 GB overhead is added to each model size to ensure system stability and context window allocation.
  • CPU-only inference is viable for models under 3B parameters for basic tasks, but 7B+ models require patience or GPU acceleration.
  • The tool reads /proc/meminfo directly, making it Linux-native and lightweight, with no external Python packages required.

The Bottom Line

This script is a brutal reminder that local LLMs are still a game of resource arbitrage; check your RAM before you commit to a VPS plan, because a model that fits is useless if it runs at a crawl.