<?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: Yo</title>
    <description>The latest articles on DEV Community by Yo (@_3b0a699f706f194486871).</description>
    <link>https://dev.to/_3b0a699f706f194486871</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3968552%2Fe513802a-5945-4752-bd07-bd5314166510.jpg</url>
      <title>DEV Community: Yo</title>
      <link>https://dev.to/_3b0a699f706f194486871</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_3b0a699f706f194486871"/>
    <language>en</language>
    <item>
      <title>Why most LLM VRAM calculators are wrong on modern models (and an open-source MIT fix)</title>
      <dc:creator>Yo</dc:creator>
      <pubDate>Thu, 04 Jun 2026 16:05:03 +0000</pubDate>
      <link>https://dev.to/_3b0a699f706f194486871/why-most-llm-vram-calculators-are-wrong-on-modern-models-and-an-open-source-mit-fix-56o6</link>
      <guid>https://dev.to/_3b0a699f706f194486871/why-most-llm-vram-calculators-are-wrong-on-modern-models-and-an-open-source-mit-fix-56o6</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46y47i1jfjj0x7sq1g60.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46y47i1jfjj0x7sq1g60.gif" alt="FitLLM&amp;lt;br&amp;gt;
  demo" width="480" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://fitllm.run" rel="noopener noreferrer"&gt;🔗 Try it — free, no signup: fitllm.run&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github&amp;lt;br&amp;gt;%0A%20%20.com/click6067-ship-it/fitllm-engine" rel="noopener noreferrer"&gt;⭐ Open source (MIT, one file): github.com/click6067-ship-it/fitllm-engine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most "can I run this LLM?" calculators estimate the KV cache with the textbook formula:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  KV ≈ 2 × layers × kv_heads × head_dim × context × bytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It assumes &lt;strong&gt;every layer keeps a full-context KV cache with one head shape&lt;/strong&gt;. True for&lt;br&gt;
  Llama-1/2 — wrong for most 2025–2026 models:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4&lt;/strong&gt; is a 5:1 sliding-window:global interleave — most layers only hold the last
1024 tokens, and global layers use a different head shape.
token-proportional KV.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MoE&lt;/strong&gt; keeps every expert resident even if only a few activate per token.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the naive number overcounts the &lt;strong&gt;KV-cache term&lt;/strong&gt; — ~4× on Qwen 3.6, ~11× on Gemma 4 31B&lt;br&gt;
  at long context — enough to flip "won't fit" into "fits". (A second common slip: applying&lt;br&gt;
  the GGUF &lt;em&gt;weight&lt;/em&gt; quant to the KV cache — llama.cpp keeps KV at f16 by default; weight bits&lt;br&gt;
  ≠ KV bits.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://fitllm.run" rel="noopener noreferrer"&gt;&lt;strong&gt;FitLLM&lt;/strong&gt;&lt;/a&gt; reads each model's official &lt;code&gt;config.json&lt;/code&gt; live and models&lt;br&gt;
  sliding-window / linear / global / MoE layers separately — it reproduces Gemma 4 31B's&lt;br&gt;
  published 20.78 GiB full-context KV. Covers &lt;strong&gt;Apple Silicon and NVIDIA RTX&lt;/strong&gt;, and you can&lt;br&gt;
  paste any Hugging Face model id. It's an estimator, not ground truth (tok/s especially is&lt;br&gt;
  bandwidth-bound). &lt;/p&gt;

&lt;p&gt;The whole calculation engine is &lt;strong&gt;one readable MIT file&lt;/strong&gt;, so you can audit the math, fork&lt;br&gt;
  it, or PR a correction:&lt;br&gt;
  👉 &lt;a href="https://github.com/click6067-ship-it/fitllm-engine" rel="noopener noreferrer"&gt;https://github.com/click6067-ship-it/fitllm-engine&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try it: &lt;a href="https://fitllm.run" rel="noopener noreferrer"&gt;https://fitllm.run&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>llm</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
