Code Llama 7B
Meta · dense · 7B parameters · 16,384 context
Parameters
7B
Context Window
16K tokens
Architecture
Dense
Best GPU
A10G
Cheapest API
$0.20/M
Quality Score
39/100
Intelligence Brief
Code Llama 7B is a 7B parameter DENSE model from Meta, featuring Multi-Head Attention (MHA) with 32 layers and 4,096 hidden dimensions. With a 16,384 token context window, it supports code, math. On standardized benchmarks, it achieves MMLU 42, HumanEval 31, GSM8K 28. The most cost-effective API deployment is via together at $0.20/M output tokens. For self-hosted inference, A10G delivers optimal throughput at $285/month.
Architecture Details
Memory Requirements
BF16 Weights
14.0 GB
FP8 Weights
7.0 GB
INT4 Weights
3.5 GB
GPU Compatibility Matrix
Code Llama 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
231.4 tok/s
Latency (ITL)
4.3ms
Est. TTFT
1ms
Cost/Month
$285
Cost/M Tokens
$0.47
BF16 · 1 GPU · vllm
100/100
score
Throughput
359.9 tok/s
Latency (ITL)
2.8ms
Est. TTFT
0ms
Cost/Month
$332
Cost/M Tokens
$0.35
BF16 · 1 GPU · vllm
100/100
score
Throughput
388.8 tok/s
Latency (ITL)
2.6ms
Est. TTFT
0ms
Cost/Month
$370
Cost/M Tokens
$0.36
Deployment Options
API Deployment
together
$0.20/M
output tokens
Single GPU
A10G
$285/mo
Min VRAM: 7 GB
Multi-GPU
RTX 3080 x2
452.6 tok/s
TP· $266/mo
API Pricing Comparison
| Provider | Input $/M | Output $/M | Badges |
|---|---|---|---|
| together | $0.20 | $0.20 | Cheapest |
Cost Analysis
| Provider | Input $/M | Output $/M | ~Monthly Cost |
|---|---|---|---|
| togetherBest Value | $0.20 | $0.20 | $2 |
Cost per 1,000 Requests
Short (500 tok)
$0.14
via together
Medium (2K tok)
$0.56
via together
Long (8K tok)
$2.00
via together
Performance Estimates
Throughput by GPU
VRAM Breakdown (A10G, BF16)
Precision Impact
bf16
14.0 GB
weights/GPU
~231.4 tok/s
fp8
7.0 GB
weights/GPU
int4
3.5 GB
weights/GPU
Quality Benchmarks
Capabilities
Features
Supported Frameworks
Supported Precisions
Where to Deploy Code Llama 7B
Self-Hosted Infrastructure
Similar Models
Code Llama 13B
13B params · dense
Quality: 44
from $0.22/M
OLMo 2 7B
7B params · dense
Quality: 50
Command R 7B
7B params · dense
Quality: 68
from $0.15/M
Falcon 7B
7B params · dense
Quality: 37
from $0.15/M
Zephyr 7B
7B params · dense
Quality: 50
Frequently Asked Questions
How much VRAM does Code Llama 7B need for inference?
Code Llama 7B requires approximately 14.0 GB of VRAM at BF16 precision, 7.0 GB at FP8, or 3.5 GB at INT4 quantization. Additional VRAM is needed for KV-cache (524288 bytes per token) and activations (~1.00 GB).
What is the best GPU for Code Llama 7B?
The top recommended GPU for Code Llama 7B is the A10G using BF16 precision. It achieves approximately 231.4 tokens/sec at an estimated cost of $285/month ($0.47/M tokens). Score: 100/100.
How much does Code Llama 7B inference cost?
Code Llama 7B API inference starts from $0.20/M input tokens and $0.20/M output tokens. Self-hosted inference costs depend on your GPU configuration — use our ROI calculator for a detailed breakdown.