Qwen 3 · Q4_K_M · Dense · GGUF v3

Qwen3 4B (Q4_K_M) — Exact VRAM, KV Cache & Tensor X-Ray

4B sweet spot for 6–8 GB GPUs: toggleable hybrid reasoning with a compact GQA 32/8 KV-cache footprint.

⚡ Simulate on Your GPU in Browser (WASM) Benchmark & Sign Ed25519 in Local Cockpit 0.4.0 View File on HuggingFace
Min VRAM (8k · FP16 KV)4.20 GiB32k w/ Q8_0 KV: 5.66 GiB
Binary .GGUF Weights2.32 GiB4.95 effective bits/weight
Parameters (Active / Total)4.02 / 4.02 B398 parsed tensors
KV Cache Growth144.0 MiB/1kQ8_0 KV: 76.5 MiB / 1k tok

1. HuggingFace Binary Provenance

RepositoryQwen/Qwen3-4B-GGUF
Inspected FileQwen3-4B-Q4_K_M.gguf (2.33 GiB)
HF Commit SHAbc640142c66e
Harvested UTC2026-11-29 15:28:14 UTC
Parsed Header5 956 328 bytes (SHA-256 010db535323935faf825…)

2. Transformer & GQA Architecture

GGUF Architectureqwen3 (Dense)
Transformer Layers36 layers (~57.5 MiB / layer)
Dimensions (d_model / FFN)2560 / 9728
Attention Heads (Q / KV)32 Q / 8 KV (GQA 4.0:1, dim 128)
Native Context & Vocab40 960 tokens · vocab 151 936

3. Exact GGML Quantization Mix Inside This Binary

Rather than quantizing every tensor identically, Q4_K_M keeps sensitive embedding, output and attention tensors at higher precision:

GGML TypeTensor CountVolumeWeight ShareDistribution
Q4_K2161.64 GiB70.8%
Q6_K370.68 GiB29.1%
F321450.00 GiB0.0%

4. KV-Cache Context Cliff from 2k to 128k Tokens (FP16 vs Q8_0 vs Q4_0)

Enabling Flash Attention with a Q8_0 KV cache cuts context memory nearly in half without altering model weights:

Context Length KV Only (FP16) KV Only (Q8_0) KV Only (Q4_0) Total VRAM (FP16) Total VRAM (Q8_0)
2k (2 048)0.28 GiB0.15 GiB0.08 GiB3.35 GiB3.22 GiB
4k (4 096)0.56 GiB0.30 GiB0.16 GiB3.63 GiB3.37 GiB
8k (8 192)1.13 GiB0.60 GiB0.32 GiB4.20 GiB3.67 GiB
16k (16 384)2.25 GiB1.20 GiB0.63 GiB5.32 GiB4.27 GiB
32k (32 768)4.50 GiB2.39 GiB1.27 GiB7.57 GiB5.46 GiB
64k (65 536)9.00 GiB4.78 GiB2.53 GiB12.07 GiB7.85 GiB
128k (131 072)18.00 GiB9.56 GiB5.06 GiB21.07 GiB12.63 GiB

5. Layer-by-Layer GPU Offload Matrix Across Hardware Tiers

Deterministic memory placement including OS display VRAM reserve and compute buffers:

Hardware Tier Context & KV Layers in VRAM VRAM Used RAM Spillover Memory Verdict
8 GB GPU + 16 GB RAM8k · KV FP1636 / 363.67 GiB—100% VRAM
8 GB GPU + 16 GB RAM32k · KV FP1636 / 367.18 GiB—100% VRAM
8 GB GPU + 16 GB RAM32k · KV Q8_036 / 365.07 GiB—100% VRAM
12 GB GPU + 32 GB RAM8k · KV FP1636 / 363.67 GiB—100% VRAM
12 GB GPU + 32 GB RAM32k · KV FP1636 / 367.18 GiB—100% VRAM
12 GB GPU + 32 GB RAM32k · KV Q8_036 / 365.07 GiB—100% VRAM
16 GB GPU + 32 GB RAM8k · KV FP1636 / 363.67 GiB—100% VRAM
16 GB GPU + 32 GB RAM32k · KV FP1636 / 367.18 GiB—100% VRAM
16 GB GPU + 32 GB RAM32k · KV Q8_036 / 365.07 GiB—100% VRAM
24 GB GPU + 64 GB RAM8k · KV FP1636 / 363.67 GiB—100% VRAM
24 GB GPU + 64 GB RAM32k · KV FP1636 / 367.18 GiB—100% VRAM
24 GB GPU + 64 GB RAM32k · KV Q8_036 / 365.07 GiB—100% VRAM
32 GB GPU + 64 GB RAM8k · KV FP1636 / 363.67 GiB—100% VRAM
32 GB GPU + 64 GB RAM32k · KV FP1636 / 367.18 GiB—100% VRAM
32 GB GPU + 64 GB RAM32k · KV Q8_036 / 365.07 GiB—100% VRAM
48 GB Dual-GPU + 128 GB RAM8k · KV FP1636 / 363.67 GiB—100% VRAM
48 GB Dual-GPU + 128 GB RAM32k · KV FP1636 / 367.18 GiB—100% VRAM
48 GB Dual-GPU + 128 GB RAM32k · KV Q8_036 / 365.07 GiB—100% VRAM
64 GB Unified Memory8k · KV FP1636 / 363.67 GiB—Unified Memory
64 GB Unified Memory32k · KV FP1636 / 367.18 GiB—Unified Memory
64 GB Unified Memory32k · KV Q8_036 / 365.07 GiB—Unified Memory

6. Ready-to-Run Local CLI Commands

With Ollama:
ollama run qwen3:4b
With llama-server (Flash Attention + Q8_0 KV Cache sized for 16 GB VRAM):
llama-server -m Qwen3-4B-Q4_K_M.gguf -ngl 36 -c 32768 -fa --cache-type-k q8_0 --cache-type-v q8_0

7. Ed25519 Certified Real Hardware Benchmarks

No certified Ed25519 passport recorded for this exact quantization yet (zero synthetic tok/s are ever invented). Run this model in Local Cockpit 0.4.0 to publish the first signed /b/lc-… passport!

8. Related Quantizations & Comparable Models