<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hamza</title>
    <description>The latest articles on DEV Community by Hamza (@hferrahoglu).</description>
    <link>https://dev.to/hferrahoglu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1281261%2F38760c36-b5a3-4d51-8ca2-588a99f98797.jpg</url>
      <title>DEV Community: Hamza</title>
      <link>https://dev.to/hferrahoglu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hferrahoglu"/>
    <language>en</language>
    <item>
      <title>Will that 70B model fit on your machine? My CLI answers before you download 40 GB</title>
      <dc:creator>Hamza</dc:creator>
      <pubDate>Sat, 18 Jul 2026 14:12:29 +0000</pubDate>
      <link>https://dev.to/hferrahoglu/will-that-70b-model-fit-on-your-machine-my-cli-answers-before-you-download-40-gb-450j</link>
      <guid>https://dev.to/hferrahoglu/will-that-70b-model-fit-on-your-machine-my-cli-answers-before-you-download-40-gb-450j</guid>
      <description>&lt;p&gt;Every local LLM user knows this cycle: find a promising model, download 40 GB of GGUF, watch it OOM - or worse, watch it &lt;em&gt;almost&lt;/em&gt; fit and crawl at 2 tokens/s while your context gets silently evicted. The information to predict all of this exists. It's just annoying math nobody wants to do by hand.&lt;/p&gt;

&lt;p&gt;So I built a CLI that does it. But first, a confession.&lt;/p&gt;

&lt;h2&gt;
  
  
  The version nobody could install
&lt;/h2&gt;

&lt;p&gt;Four months ago I posted a weekend hack called &lt;strong&gt;llm-neofetch-plus&lt;/strong&gt; - a neofetch-style hardware tool with local-LLM extras. People actually tried it, which is how I learned two embarrassing things:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The PyPI package was fundamentally broken.&lt;/strong&gt; My &lt;code&gt;pyproject.toml&lt;/code&gt; used &lt;code&gt;packages.find&lt;/code&gt; with directories that had no &lt;code&gt;__init__.py&lt;/code&gt;, so the wheel shipped &lt;em&gt;without the main module&lt;/em&gt;. &lt;code&gt;pip install llm-neofetch-plus&lt;/code&gt; → &lt;code&gt;ModuleNotFoundError&lt;/code&gt;. It only ever worked from a repo clone. For months. 🙃&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. YAML has no &lt;code&gt;\033&lt;/code&gt; escape.&lt;/strong&gt; My config stored ANSI colors as &lt;code&gt;"\033[1;34m"&lt;/code&gt;. YAML parses that as &lt;code&gt;\0&lt;/code&gt; (a NUL byte!) followed by the literal text &lt;code&gt;33[1;34m&lt;/code&gt; - so on any machine where the config actually loaded, the "colors" were printed as visible garbage: &lt;code&gt;33[1;36m╔════...&lt;/code&gt;. This bug shipped on day one and I never saw it, because a &lt;em&gt;separate&lt;/em&gt; encoding bug prevented the config from loading on my Windows machine at all. Two bugs in a trench coat, hiding each other.&lt;/p&gt;

&lt;p&gt;Enough people cared despite all this that I did a full rewrite. Here's what it became.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Can I run it?" - answered properly
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;llm-neofetch can-run llama3.1:8b &lt;span class="nt"&gt;--context&lt;/span&gt; 8192
&lt;span class="go"&gt;
┌──────────────────────────────────────────────────────────┐
│  ✓ llama3.1:8b (8B) can run on this system               │
└──────────────────────────────────────────────────────────┘
  Context: 8,192 tokens • VRAM: 2.0 GB (2.0 free) • RAM: 15.7 GB (3.8 free)

  Quant   Memory  Capacity  Right now  ~Speed    Max ctx
  Q2_K    4.0 GB  ✓ CPU     ✗ not now  25 tok/s  75K
  Q4_K_M  6.0 GB  ✓ CPU     ✗ not now  14 tok/s  60K
  Q8_0    9.4 GB  ✓ CPU     ✗ not now  8 tok/s   32K
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Two verdicts per quantization, because they answer different questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Capacity&lt;/strong&gt; - can this hardware run it at all? (totals)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Right now&lt;/strong&gt; - does it fit in the memory that's &lt;em&gt;actually free at this moment&lt;/em&gt;, counting VRAM used by other apps and RAM held by your 47 browser tabs?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That second column exists because a commenter on my original post pointed out that a 24 GB GPU with 4 GB already in use should not get a "70B fits" verdict. They were right. It took me four months, but it's fixed.&lt;/p&gt;

&lt;p&gt;Exit code is 2 when nothing fits, so you can script it.&lt;/p&gt;
&lt;h2&gt;
  
  
  The math (the fun part)
&lt;/h2&gt;

&lt;p&gt;Total memory is estimated as &lt;strong&gt;weights + KV cache + overhead&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Weights:&lt;/strong&gt; &lt;code&gt;params × bits_per_weight / 8&lt;/code&gt;. Q4_K_M is ~4.5 effective bits, so an 8B is ~4.2 GiB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KV cache:&lt;/strong&gt; &lt;code&gt;2 × n_layers × n_kv_heads × head_dim × 2 bytes&lt;/code&gt; per token, from a lookup table of common architectures. This is GQA-aware - it matters enormously. Llama-2 13B (full MHA) burns ~25× more KV memory per token than Qwen2.5 14B (GQA with 8 KV heads), despite similar parameter counts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context scales linearly:&lt;/strong&gt; an 8B at 4K context needs ~0.5 GiB of KV cache; at 64K it needs ~8 GiB. Same model, wildly different memory story - which is why every verdict is computed &lt;em&gt;at a specific context length&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Speed estimates use the memory-bandwidth bound: generating one token reads every weight once, so &lt;code&gt;tok/s ≈ 0.7 × bandwidth / weight_bytes&lt;/code&gt;. It's labeled as an upper bound, because that's what it is. If you want truth instead of estimates, &lt;code&gt;--bench-llm&lt;/code&gt; runs a real generation through the Ollama API and reports actual tok/s from &lt;code&gt;eval_count / eval_duration&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  It also knows what you already have
&lt;/h2&gt;

&lt;p&gt;The tool detects installed backends (Ollama with version + running state + model count, LM Studio, llama.cpp, vLLM), scans your downloaded models, and renders a verdict for each one:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Model                     Size     Source   Fits
  qwen2.5:14b-q4_K_M        8.4 GB   Ollama   ✓ CPU (RAM)
  llama3.1:70b-q4_K_M       39.6 GB  Ollama   ✗ too big
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Plus: running LLM processes with per-process VRAM, AI runtime detection (CUDA/ROCm/Vulkan/DirectML/Metal), a &lt;code&gt;--watch&lt;/code&gt; live monitor, &lt;code&gt;--json&lt;/code&gt; for scripts, HTML export, and themes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;llm-neofetch-plus   &lt;span class="c"&gt;# and it genuinely works now&lt;/span&gt;
llm-neofetch                     &lt;span class="c"&gt;# full hardware report&lt;/span&gt;
llm-neofetch can-run llama3.1:70b &lt;span class="nt"&gt;--context&lt;/span&gt; 16384
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/HFerrahoglu" rel="noopener noreferrer"&gt;
        HFerrahoglu
      &lt;/a&gt; / &lt;a href="https://github.com/HFerrahoglu/llm-neofetch-plus" rel="noopener noreferrer"&gt;
        llm-neofetch-plus
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      LLM-Neofetch++ is an advanced system information tool designed specifically for local LLM (Large Language Model) usage. It provides detailed hardware detection with personalized recommendations for running AI models on your system.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/HFerrahoglu/llm-neofetch-plus/assets/banner.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FHFerrahoglu%2Fllm-neofetch-plus%2FHEAD%2Fassets%2Fbanner.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🚀 LLM-Neofetch++&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/82607e69abe99314712caaca3e9c3d804b6290df91f9771848c2c84b1d6bf4b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e312e302d626c75652e737667"&gt;&lt;img src="https://camo.githubusercontent.com/82607e69abe99314712caaca3e9c3d804b6290df91f9771848c2c84b1d6bf4b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e312e302d626c75652e737667" alt="Version"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/a39c4fcb54aabaa865f98d2160d6ae6e237feb054ac19c4d7204ffbc14245141/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d332e392b2d677265656e2e737667"&gt;&lt;img src="https://camo.githubusercontent.com/a39c4fcb54aabaa865f98d2160d6ae6e237feb054ac19c4d7204ffbc14245141/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d332e392b2d677265656e2e737667" alt="Python"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/2c35df2da25b9f18c8db9916b00354a485470a77c6b52eeaa3c9ca691c64f259/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6f72616e67652e737667"&gt;&lt;img src="https://camo.githubusercontent.com/2c35df2da25b9f18c8db9916b00354a485470a77c6b52eeaa3c9ca691c64f259/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6f72616e67652e737667" alt="License"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/b891e206e3acad06209d02c9cce09c1aed81ba15805b21bbbeb73ab6cf606980/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d57696e646f77732532302537432532304c696e75782532302537432532306d61634f532d6c69676874677265792e737667"&gt;&lt;img src="https://camo.githubusercontent.com/b891e206e3acad06209d02c9cce09c1aed81ba15805b21bbbeb73ab6cf606980/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d57696e646f77732532302537432532304c696e75782532302537432532306d61634f532d6c69676874677265792e737667" alt="Platform"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Advanced System Information Tool for Local LLM Usage&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Show detailed hardware specs optimized for running local AI models&lt;/p&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;✨ Features&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🔍 &lt;strong&gt;Comprehensive Hardware Detection&lt;/strong&gt;
&lt;/h3&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;CPU&lt;/strong&gt;: Model, cores, threads, frequency, temperature, usage&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;GPU&lt;/strong&gt;: NVIDIA (nvidia-smi/pynvml), AMD (amd-smi/rocm-smi), Intel Arc&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;VRAM&lt;/strong&gt;: Total, used, and available video memory&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;NPU&lt;/strong&gt;: Intel AI Boost, AMD XDNA, Apple Neural Engine&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;RAM&lt;/strong&gt;: Capacity, module speed, and bandwidth estimate&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Storage&lt;/strong&gt;: Disk type (NVMe/SSD/HDD), capacity, speed benchmarks&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Battery&lt;/strong&gt;: Charge level, power status, time remaining (laptops)&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Apple Silicon&lt;/strong&gt;: M1-M4 variants with GPU cores and memory bandwidth&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;AI Runtimes&lt;/strong&gt;: CUDA, ROCm, Vulkan, DirectML, Metal versions&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Environment&lt;/strong&gt;: WSL, Docker, and cloud VM (AWS/GCP/Azure) detection&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;🎯 &lt;strong&gt;Smart AI/LLM Features&lt;/strong&gt;
&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;🤖 &lt;strong&gt;Context-Aware Recommendations&lt;/strong&gt;: max context length and token/s
estimates per model tier, computed from weights + KV cache on your hardware&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/HFerrahoglu/llm-neofetch-plus" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Honest caveats:&lt;/strong&gt; the estimates are heuristics with clearly-marked assumptions, and the AMD / Apple Silicon detection paths are written defensively but untested on real hardware - if you run either, a bug report (or even a "works fine") would genuinely help. Tell me where the math is wrong. That's how the last version got better.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>python</category>
      <category>opensource</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
