published fresh until

Will this local model fit my GPU? A VRAM worksheet with KV cache

Summary When estimating local-model VRAM, budget checkpoint size, KV cache for configured context and concurrency, runtime workspace, and desktop use; prefill advice is a commenter report, so inspect allocation and offloading with ollama ps.

Not for Ollama running on CPU or quantizing the KV cache; see ollama-gpt-oss-cpu-only-num-gpu-context, kv-cache-quant-q8-vs-f16-long-context

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

As of November 2026, budget weights, KV cache at your configured context and concurrency, runtime workspace and the desktop share. Do first: choose the exact quant and maximum simultaneous requests before estimating memory.

The worksheet. dever121's r/ollama post argues that a card's nominal VRAM is not what you can fill with weights, and gives a checklist: (1) the exact checkpoint size for your quant, (2) the real context you will use (num_ctx), (3) the KV cache at that context, (4) runtime overhead, (5) what the display and desktop already take on that card. For a card that drives a screen, read the actual free memory instead of assuming a flat 10 percent. The post title is provocative; the checklist is the useful part.

What commenters added (user experience, partly low-scored):

  • One user said KV and context math matter: a Q4 27B model with 64k context and a quantised KV cache fit on a 24 GB card for them. One report, one setup.
  • A technical commenter (the comment was heavily downvoted, so treat it with care) said KV cache should be computed from KV heads, not attention heads, because grouped-query attention can make the difference 4 to 8 times, and that peak memory occurs during prefill, not during generation.
  • Another commenter noted that memory for the full num_ctx may be reserved up front, so plan for the context length you set, not the average prompt.
  • Some objected to the title (24 GB is 24 GB); the author clarified in the thread.

A way to apply it. The usual KV size formula is 2 x layers x KV heads x head dimension x context tokens x bytes per element x concurrent sequences (2 bytes for f16, about 1 for q8 before format overhead). The post itself gives this concurrency-aware formula; use layers and KV heads from the model's config. Then add weights, overhead and the desktop share, and leave headroom for the prefill peak.

Caveats. Runtimes differ in overhead and buffer sizes, so inspect actual usage with your runtime's own tools after loading.

Question for readers: which runtime and context settings made your estimated-to-fit model fail on the first long prompt, and what headroom did you need?

Sources

  • dever121's VRAM worksheet and discussion: the formula includes concurrent sequences; the prefill warning is a commenter's claim.
  • Ollama context length: allocated context and CPU/GPU split appear in ollama ps. The page lists 4k below 24 GiB, 32k at 24–48 GiB and 256k at 48 GiB or more.
  • Ollama FAQ: f16 is the default cache type; q8_0 uses roughly half its memory and q4_0 roughly a quarter, with Flash Attention required. The FAQ still names a 4096-token default, so use the allocated context shown by your runtime.

A VRAM budget worksheet counting KV cache, overhead and desktop use. Packaged by WhatWorks editors. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Will this local model fit my GPU? A VRAM worksheet with KV cache
Summary: When estimating local-model VRAM, budget checkpoint size, KV cache for configured context and concurrency, runtime workspace, and desktop use; prefill advice is a commenter report, so inspect allocation and offloading with `ollama ps`.
Copy for agent
get the whatworks thread vram-budget-worksheet-kv-cache-prefill-peak and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread vram-budget-worksheet-kv-cache-prefill-peak
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks