BigCode7B~5 GB VRAM at Q4_K_M

StarCoder 2 7B — VRAM, speed & local setup

Written by Jakub Rusinowski · Last updated

The sweet spot for code generation. Strong multi-language support, good at completing complex functions. Works well on 8GB VRAM GPUs as a lightweight coding assistant.

StarCoder 2 7B needs about 5 GB of VRAM at Q4_K_M — quantized weights plus framework overhead, before any KV cache. On Apple Silicon that figure comes out of unified memory.

Logic72
Creative45
Coding90

VRAM and speed by quantization

Quoted against NVIDIA RTX 4090 (24 GB). Includes the KV cache at 8K context, so it reads higher than the headline figure.

QuantVRAMSpeed (est.)Fit
Q2_K
2.63 bpw
3.7 GB~174 tok/sFits
Q3_K_M
3.41 bpw
4.4 GB~150 tok/sFits
Q4_K_M
4.83 bpw
5.7 GB~120 tok/sFits
Q5_K_M
5.67 bpw
6.4 GB~107 tok/sFits
Q6_K
6.56 bpw
7.2 GB~96 tok/sFits
Q8_0
8.50 bpw
9 GB~79 tok/sFits
F16
16.00 bpw
15.7 GB~46 tok/sFits

Black marker = usable memory on the NVIDIA RTX 4090 (24 GB). Estimates from the memory-bandwidth roofline on the methodology page. StarCoder 2 7B VRAM calculator →

Get StarCoder 2 7B running

The cheapest catalogued GPU that runs StarCoder 2 7B is the Intel Arc B570 (10 GB).

Affiliate disclosure: Some links on this page are affiliate links — if you buy through them, LLM Configurator may earn a commission at no extra cost to you. As an Amazon Associate, LLM Configurator earns from qualifying purchases.
Intel Arc B570 10GB
10 GB VRAM · 150 W board power
2026 prices are volatile — check the current listing.

How to run StarCoder 2 7B

Install Ollama, then run:

ollama run starcoder2:7b
Weights on Hugging Face: bigcode/starcoder2-7b ↗

Specifications

Curated — A hand-written entry from before this catalogue recorded its sources. The figures are long-standing but their provenance is not on file.

Parameters
7 Billion
Context window
16,384
Architecture
Dense
Provider
BigCode
Licence
BigCode Open RAIL-M v1
Practical deployment
Edge device (phone, SBC)
Specified at
Q4_K_M
System RAM
16 GB
Record updated
2024-02-28
LicenceBigCode OpenRAIL-MCommercial use permitted

Weights are downloadable and commercial use is permitted, subject to the licence’s acceptable-use terms.

Quality and use cases

Scores as published by the model’s authors or an independent evaluator — quality, not throughput, and not measured by us.

Best forcode completioncodingmulti language

Can I run StarCoder 2 7B on my GPU?

Other StarCoder 2 sizes

StarCoder 2 7B — frequently asked questions

How much VRAM does StarCoder 2 7B need?

About 5 GB at Q4_K_M — quantized weights plus framework overhead, before any KV cache. The cache grows with context length and is added on top; the table above folds it in. Apple Silicon counts unified memory toward the same figure.

Does StarCoder 2 7B run on an RTX 4090 (24 GB)?

Yes. StarCoder 2 7B needs about 5 GB at Q4_K_M, inside a 24 GB card, at an estimated 120 tokens/sec.

How do I run StarCoder 2 7B locally?

Install Ollama and run `ollama run starcoder2:7b`. That pulls the weights and starts a local OpenAI-compatible endpoint; after the download nothing leaves the machine.

What other sizes does StarCoder 2 come in?

StarCoder 2 3B (3 GB), StarCoder 2 7B (5 GB), StarCoder 2 15B (10 GB). Every size shares the family's training and licence; the larger ones score higher and need proportionally more memory.