Home / use case

Ollama KV cache quantization on an 8 GB laptop GPU: 5x faster Qwen3-8B, lower accuracy

At a glance
Models & engines
Model: Qwen3-8B Q4_K_M
Backend: Ollama 0.40.13
Key gotcha
The speed gains were real, but the accuracy trade-off was significant

What they built

@Galo2027 wanted his local LLM faster without upgrading the GPU. He kept the same 8 GB RTX 4060 laptop GPU, the same Qwen3-8B model and the same 14,766-token prompt, and changed only the KV cache precision in Ollama.

He ran 155 measured requests across 9 primary configurations, then tested answer quality across 12 paired groundwater engineering cases, because faster did not mean better answers.

Setup

  • RTX 4060 Laptop GPU (8GB)
  • Model: Qwen3-8B Q4_K_M
  • Backend: Ollama 0.40.13
  • 12,288 configured context tokens

How it works

  1. KV cache allocation at 12,288 context tokens was 1,728 MiB at F16, 918 MiB at Q8_0 (-46.9%) and 486 MiB at Q4_0 (-71.9%)
  2. Both quantized formats eliminated CPU layer offload, which he says was the main performance gain
  3. Ollama applies KV cache quantization globally, so it affects every model

Results & numbers

  • F16: 5.77 tokens/sec, Q8_0: 28.95 tokens/sec, Q4_0: 27.48 tokens/sec
  • Q4_0 tripled the largest tested context that fit entirely on the GPU
  • Numerical accuracy on the 12 test cases: F16 25.0%, Q8_0 13.9%, Q4_0 5.6%

Gotchas

  • The speed gains were real, but the accuracy trade-off was significant
  • Because Ollama applies KV cache quantization globally, benchmark each model before settling on a default
  • Q8_0 looked like the better compromise in this test, but that doesn't make it universally optimal
“But there's a catch: faster doesn't mean smarter.”— @Galo2027

Do it yourself

  1. Pick a long prompt the real size of your work and a model that fills most of your VRAM
  2. Measure tokens/sec at the default F16 KV cache
  3. Switch Ollama's KV cache type to Q8_0, then Q4_0, and measure again
  4. Check whether CPU offload disappears at your context size
  5. Score answer quality on your own test cases before keeping the faster setting
Source: X (@Galo2027) · Published 2026-12-03 · Added 2026-12-04. This write-up summarizes the original source; see it for full details.

Similar setups

Getting Ollama onto an Intel Arc integrated GPU on Windows

Federico Navarrete found Ollama running Qwen3 4B entirely on the CPU of his ASUS ZenBook and moved it to the Intel Arc 140T integrated GPU with two environment variables.

Federico Navarrete (DEV Community) · 2026-10-29

Measuring AI slop with Qwen3 4B on a MacBook Air through Ollama

A writer ran Qwen3 4B locally to generate the same LinkedIn post and product blurb 40 times, counting stock phrases and repeated openings, and found that adding four real facts halved the stock phrases.

DEV Community (Vladimir Beskorovainyi) · 2026-12-01

Stress-testing a local 4B search agent in Ollama: it caught fake sources but trusted a stale official page

Prompt Engineer 48 built DeepStress-Mini, a 30-question offline test inspired by the DeepStress paper, and ran it against qwen3:4b in Ollama on an 8 GB RTX 4060 laptop to see how a small search agent handles bad sources.

Prompt Engineer 48 on X · 2026-11-17

A private document assistant on Ollama with Qwen3 1.7B that says when the answer isn't there

Mike Dufour built three standard-library Python scripts that answer questions from a folder of markdown files with citations, using qwen3:1.7b and nomic-embed-text in Ollama, and measured 17 of 20 right with all 5 unanswerable questions refused.

DEV Community (Mike Dufour) · 2026-12-04