StarCoder2 7B
BigCode · dense · 6.73B parameters · 16,384 context
Parameters
6.73B
Context Window
16K tokens
Architecture
Dense
Best GPU
A10G
Cheapest API
$0.15/M
Quality Score
35/100
Intelligence Brief
StarCoder2 7B is a 6.73B parameter DENSE model from BigCode, featuring Grouped Query Attention (GQA) with 32 layers and 4,608 hidden dimensions. With a 16,384 token context window, it supports code. On standardized benchmarks, it achieves MMLU 38, HumanEval 35.2, GSM8K 24. The most cost-effective API deployment is via huggingface at $0.15/M output tokens. For self-hosted inference, A10G delivers optimal throughput at $285/month.
Architecture Details
Memory Requirements
BF16 Weights
13.5 GB
FP8 Weights
6.7 GB
INT4 Weights
3.4 GB
GPU Compatibility Matrix
StarCoder2 7B is compatible with 95% of GPU configurations across 41 GPUs at 3 precision levels.
GPU Recommendations
BF16 · 1 GPU · vllm
100/100
score
Throughput
240.7 tok/s
Latency (ITL)
4.2ms
Est. TTFT
1ms
Cost/Month
$285
Cost/M Tokens
$0.45
BF16 · 1 GPU · vllm
100/100
score
Throughput
374.3 tok/s
Latency (ITL)
2.7ms
Est. TTFT
0ms
Cost/Month
$332
Cost/M Tokens
$0.34
BF16 · 1 GPU · vllm
100/100
score
Throughput
404.4 tok/s
Latency (ITL)
2.5ms
Est. TTFT
0ms
Cost/Month
$370
Cost/M Tokens
$0.35
Deployment Options
API Deployment
huggingface
$0.15/M
output tokens
Single GPU
A10G
$285/mo
Min VRAM: 7 GB
Multi-GPU
RTX 3080 x2
468.6 tok/s
TP· $266/mo
API Pricing Comparison
| Provider | Input $/M | Output $/M | Badges |
|---|---|---|---|
| huggingface | $0.15 | $0.15 | Cheapest |
Cost Analysis
| Provider | Input $/M | Output $/M | ~Monthly Cost |
|---|---|---|---|
| huggingfaceBest Value | $0.15 | $0.15 | $2 |
Cost per 1,000 Requests
Short (500 tok)
$0.10
via huggingface
Medium (2K tok)
$0.42
via huggingface
Long (8K tok)
$1.50
via huggingface
Performance Estimates
Throughput by GPU
VRAM Breakdown (A10G, BF16)
Precision Impact
bf16
13.5 GB
weights/GPU
~240.7 tok/s
fp8
6.7 GB
weights/GPU
int4
3.4 GB
weights/GPU
Quality Benchmarks
Capabilities
Features
Supported Frameworks
Supported Precisions
Where to Deploy StarCoder2 7B
Self-Hosted Infrastructure
Similar Models
StarCoder2 3B
3.03B params · dense
Quality: 29
from $0.10/M
StarCoder2 15B
15.5B params · dense
Quality: 42
from $0.30/M
DeepSeek Coder 6.7B
6.7B params · dense
Quality: 50
from $0.20/M
MPT 7B
6.7B params · dense
Quality: 36
OLMo 2 7B
7B params · dense
Quality: 50
Frequently Asked Questions
How much VRAM does StarCoder2 7B need for inference?
StarCoder2 7B requires approximately 13.5 GB of VRAM at BF16 precision, 6.7 GB at FP8, or 3.4 GB at INT4 quantization. Additional VRAM is needed for KV-cache (65536 bytes per token) and activations (~1.00 GB).
What is the best GPU for StarCoder2 7B?
The top recommended GPU for StarCoder2 7B is the A10G using BF16 precision. It achieves approximately 240.7 tokens/sec at an estimated cost of $285/month ($0.45/M tokens). Score: 100/100.
How much does StarCoder2 7B inference cost?
StarCoder2 7B API inference starts from $0.15/M input tokens and $0.15/M output tokens. Self-hosted inference costs depend on your GPU configuration — use our ROI calculator for a detailed breakdown.