Skip to content
Updated minutes ago
BigCode

StarCoder2 3B

BigCode · dense · 3.03B parameters · 16,384 context

Quality
29.0

Parameters

3.03B

Context Window

16K tokens

Architecture

Dense

Best GPU

RTX 4070 Ti

Cheapest API

$0.10/M

Quality Score

29/100

Intelligence Brief

StarCoder2 3B is a 3.03B parameter DENSE model from BigCode, featuring Grouped Query Attention (GQA) with 30 layers and 3,072 hidden dimensions. With a 16,384 token context window, it supports code. On standardized benchmarks, it achieves MMLU 32, HumanEval 28, GSM8K 18. The most cost-effective API deployment is via huggingface at $0.10/M output tokens. For self-hosted inference, RTX 4070 Ti delivers optimal throughput at $237/month.

Architecture Details

TypeDENSE
Total Parameters3.03B
Active Parameters3.03B
Layers30
Hidden Dimension3,072
Attention Heads24
KV Heads2
Head Dimension128
Vocab Size49,152

Memory Requirements

BF16 Weights

6.1 GB

FP8 Weights

3.0 GB

INT4 Weights

1.5 GB

KV-Cache per Token30720 bytes
Activation Estimate0.50 GB

GPU Compatibility Matrix

StarCoder2 3B is compatible with 100% of GPU configurations across 41 GPUs at 3 precision levels.

BF16 (Full)
FP8 (Half)
INT4 (Quarter)
Blackwell(7 GPUs)
B200 NVL (pair)360GB
B300288GB
B100 SXM192GB
GB200 NVL72 (per GPU)192GB
Hopper(7 GPUs)
H100 NVL 94GB (per GPU pair)188GB
H200 SXM141GB
H2096GB
GH20096GB
Ada Lovelace(11 GPUs)
L40S48GB
L4048GB
RTX 6000 Ada48GB
L2048GB
Ampere(16 GPUs)
A100 80GB SXM80GB
A100 80GB PCIe80GB
A1664GB
RTX A600048GB
Legend:No fitVery tightTightModerateGoodExcellent

GPU Recommendations

RTX 4070 Tioptimal

BF16 · 1 GPU · vllm

100/100

score

Throughput

449.1 tok/s

Latency (ITL)

2.2ms

Est. TTFT

0ms

Cost/Month

$237

Cost/M Tokens

$0.20

Use this config →
RTX 3080optimal

BF16 · 1 GPU · vllm

100/100

score

Throughput

677.2 tok/s

Latency (ITL)

1.5ms

Est. TTFT

0ms

Cost/Month

$133

Cost/M Tokens

$0.07

Use this config →
RTX 4070 Superoptimal

BF16 · 1 GPU · vllm

100/100

score

Throughput

449.1 tok/s

Latency (ITL)

2.2ms

Est. TTFT

0ms

Cost/Month

$209

Cost/M Tokens

$0.18

Use this config →

Deployment Options

API

API Deployment

huggingface

$0.10/M

output tokens

Self-Hosted

Single GPU

RTX 4070 Ti

$237/mo

Min VRAM: 3 GB

Scale

Multi-GPU

RTX 4070 Ti

449.1 tok/s

Best available config

API Pricing Comparison

ProviderInput $/MOutput $/MBadges
huggingface$0.10$0.10
Cheapest

Cost Analysis

ProviderInput $/MOutput $/M~Monthly Cost
huggingfaceBest Value$0.10$0.10$1

Cost per 1,000 Requests

Short (500 tok)

$0.07

via huggingface

Medium (2K tok)

$0.28

via huggingface

Long (8K tok)

$1.00

via huggingface

Performance Estimates

Throughput by GPU

RTX 4070 Ti
449.1 tok/s
RTX 3080
677.2 tok/s
RTX 4070 Super
449.1 tok/s

VRAM Breakdown (RTX 4070 Ti, BF16)

Weights
Act
Weights 6.1 GBKV-Cache 0.5 GBActivations 4.0 GBOverhead 0.5 GB

Precision Impact

bf16

6.1 GB

weights/GPU

~449.1 tok/s

fp8

3.0 GB

weights/GPU

int4

1.5 GB

weights/GPU

Quality Benchmarks

Bottom 25%
0th percentile across all models
MMLU
32.0
Bottom 25% (0th pctile)
HumanEval
28.0
Bottom 25% (8th pctile)
GSM8K
18.0
Bottom 25% (0th pctile)
MT-Bench
50.0
Bottom 25% (0th pctile)

Capabilities

Features

Tool Use Vision Code Math Reasoning Multilingual Structured Output

Supported Frameworks

vllmsglangtgiollama

Supported Precisions

BF16 (default)FP8INT4

Where to Deploy StarCoder2 3B

Similar Models

StarCoder2 7B

6.73B params · dense

Quality: 35

from $0.15/M

Higher quality, Larger modelCompare →
Smaller context, Higher qualityCompare →

VILA 1.5 3B

3B params · dense

Quality: 44

from $0.08/M

Smaller context, Higher qualityCompare →
Smaller context, Higher qualityCompare →
Higher qualityCompare →

Frequently Asked Questions

How much VRAM does StarCoder2 3B need for inference?

StarCoder2 3B requires approximately 6.1 GB of VRAM at BF16 precision, 3.0 GB at FP8, or 1.5 GB at INT4 quantization. Additional VRAM is needed for KV-cache (30720 bytes per token) and activations (~0.50 GB).

What is the best GPU for StarCoder2 3B?

The top recommended GPU for StarCoder2 3B is the RTX 4070 Ti using BF16 precision. It achieves approximately 449.1 tokens/sec at an estimated cost of $237/month ($0.20/M tokens). Score: 100/100.

How much does StarCoder2 3B inference cost?

StarCoder2 3B API inference starts from $0.10/M input tokens and $0.10/M output tokens. Self-hosted inference costs depend on your GPU configuration — use our ROI calculator for a detailed breakdown.