Can I Run StarCoder 2 on 8 GB system RAM?

Written by Jakub Rusinowski · Last updated February 28, 2024

Yes

Yes — StarCoder 2 7B at Q4_K_M needs about 5.7 GB of the 6.4 GB usable on 8 GB system RAM (~0.7 GB spare), at ~14.1 tok/s (estimated), with room for about 16,384 tokens of context.

Confidence: high · Recommended quantization: Q4_K_M · Estimated speed: ~14.1 tok/s

8 GB system RAM — what it gives a model

Usable memory for models6.4 GB
Memory bandwidth90 GB/s

StarCoder 2 on 8 GB system RAM: memory by quantization

QuantMemory neededFits 6.4 GB?Max contextEst. speedDownload
F1615.7 GB✗ No14.4 GB
Q8_09 GB✗ No7.7 GB
Q6_K7.2 GB✗ No5.9 GB
Q5_K_M6.4 GB✗ No5.1 GB
Q4_K_M5.7 GB✓ Yes16K~14.1 tok/s4.3 GB
Q3_K_M4.4 GB✓ Yes16K~19.3 tok/s3.1 GB
Q2_K3.7 GB✓ Yes16K~24.1 tok/s2.4 GB

Which StarCoder 2 sizes fit

VariantNeeds at Q4_K_MFits?Est. speed
StarCoder 2 15B10.8 GB✗ Too large
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 8 GB system RAM?

Yes — StarCoder 2 7B at Q4_K_M needs about 5.7 GB of the 6.4 GB usable on 8 GB system RAM (~0.7 GB spare), at ~14.1 tok/s (estimated), with room for about 16,384 tokens of context.

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

Q4_K_M — it needs about 5.7 GB of the 6.4 GB available, downloads as roughly 4.3 GB, and runs at an estimated 14.1 tokens/sec with up to 16K of context.

What limits StarCoder 2 on 8 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 8 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