Can I Run StarCoder 2 on 16 GB system RAM?

Written by Jakub Rusinowski · Last updated February 28, 2024

Yes, but it is tight

Yes, but it is tight — StarCoder 2 15B at Q5_K_M needs about 12.5 GB of the 12.8 GB usable on 16 GB system RAM, leaving only ~0.3 GB before the runtime starts swapping. Expect ~5.9 tok/s (estimated), with room for about 8,192 tokens of context.

Confidence: medium · Recommended quantization: Q5_K_M · Estimated speed: ~5.9 tok/s

16 GB system RAM — what it gives a model

Usable memory for models12.8 GB
Memory bandwidth90 GB/s

StarCoder 2 on 16 GB system RAM: memory by quantization

QuantMemory neededFits 12.8 GB?Max contextEst. speedDownload
F1632.5 GB✗ No31 GB
Q8_017.9 GB✗ No16.5 GB
Q6_K14.2 GB✗ No12.7 GB
Q5_K_M12.5 GB✓ Yes8K~5.9 tok/s11 GB
Q4_K_M10.8 GB✓ Yes16K~6.8 tok/s9.4 GB
Q3_K_M8.1 GB✓ Yes16K~9.5 tok/s6.6 GB
Q2_K6.6 GB✓ Yes16K~12 tok/s5.1 GB

Which StarCoder 2 sizes fit

VariantNeeds at Q4_K_MFits?Est. speed
StarCoder 2 15B10.8 GB✓ Fits~6.8 tok/s
StarCoder 2 7B5.7 GB✓ Fits~14.1 tok/s
StarCoder 2 3B2.9 GB✓ Fits~32.2 tok/s

What to watch out for

Recommended setup

llama.cpp (CPU build) or Ollama — both run without a GPU

How these numbers are calculated

FAQ

Can I run StarCoder 2 on 16 GB system RAM?

Yes, but it is tight — StarCoder 2 15B at Q5_K_M needs about 12.5 GB of the 12.8 GB usable on 16 GB system RAM, leaving only ~0.3 GB before the runtime starts swapping. Expect ~5.9 tok/s (estimated), with room for about 8,192 tokens of context.

Which quantization of StarCoder 2 should I use on 16 GB system RAM?

Q5_K_M — it needs about 12.5 GB of the 12.8 GB available, downloads as roughly 11 GB, and runs at an estimated 5.9 tokens/sec with up to 8K of context.

What limits StarCoder 2 on 16 GB system RAM?

Nothing binding — the model fits with headroom and generates at a usable speed on this hardware.

Which runtime should I use?

llama.cpp (CPU build) or Ollama — both run without a GPU

Other RAM Capacities

Other Models on 16 GB system RAM

StarCoder 2 on GPUs

What This Model Is Good At

Model & Tools

← Can I Run It? | StarCoder 2 model page | Check your hardware