Skip to content
Updated minutes ago
Meta

Code Llama 13B

Meta · dense · 13B parameters · 16,384 context

Quality
44.0

Parameters

13B

Context Window

16K tokens

Architecture

Dense

Best GPU

A100 40GB SXM

Cheapest API

$0.22/M

Quality Score

44/100

Intelligence Brief

Code Llama 13B is a 13B parameter DENSE model from Meta, featuring Multi-Head Attention (MHA) with 40 layers and 5,120 hidden dimensions. With a 16,384 token context window, it supports code, math. On standardized benchmarks, it achieves MMLU 47, HumanEval 36, GSM8K 35. The most cost-effective API deployment is via together at $0.22/M output tokens. For self-hosted inference, A100 40GB SXM delivers optimal throughput at $807/month.

Architecture Details

TypeDENSE
Total Parameters13B
Active Parameters13B
Layers40
Hidden Dimension5,120
Attention Heads40
KV Heads40
Head Dimension128
Vocab Size32,016

Memory Requirements

BF16 Weights

26.0 GB

FP8 Weights

13.0 GB

INT4 Weights

6.5 GB

KV-Cache per Token819200 bytes
Activation Estimate1.50 GB

GPU Compatibility Matrix

Code Llama 13B is compatible with 82% 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

A100 40GB SXMoptimal

BF16 · 1 GPU · vllm

95/100

score

Throughput

322.9 tok/s

Latency (ITL)

3.1ms

Est. TTFT

1ms

Cost/Month

$807

Cost/M Tokens

$0.95

Use this config →
RTX A6000optimal

BF16 · 1 GPU · vllm

95/100

score

Throughput

159.5 tok/s

Latency (ITL)

6.3ms

Est. TTFT

1ms

Cost/Month

$465

Cost/M Tokens

$1.11

Use this config →
A40optimal

BF16 · 1 GPU · vllm

95/100

score

Throughput

144.5 tok/s

Latency (ITL)

6.9ms

Est. TTFT

1ms

Cost/Month

$399

Cost/M Tokens

$1.05

Use this config →

Deployment Options

API

API Deployment

together

$0.22/M

output tokens

Self-Hosted

Single GPU

A100 40GB SXM

$807/mo

Min VRAM: 13 GB

Scale

Multi-GPU

RTX 3090 x2

319.5 tok/s

TP· $361/mo

API Pricing Comparison

ProviderInput $/MOutput $/MBadges
together$0.22$0.22
Cheapest

Cost Analysis

ProviderInput $/MOutput $/M~Monthly Cost
togetherBest Value$0.22$0.22$2

Cost per 1,000 Requests

Short (500 tok)

$0.15

via together

Medium (2K tok)

$0.62

via together

Long (8K tok)

$2.20

via together

Performance Estimates

Throughput by GPU

A100 40GB SXM
322.9 tok/s
RTX A6000
159.5 tok/s
A40
144.5 tok/s

VRAM Breakdown (A100 40GB SXM, BF16)

Weights
KV
Act
Weights 26.0 GBKV-Cache 13.4 GBActivations 12.0 GBOverhead 2.1 GB

Precision Impact

bf16

26.0 GB

weights/GPU

~322.9 tok/s

fp8

13.0 GB

weights/GPU

int4

6.5 GB

weights/GPU

Quality Benchmarks

Bottom 25%
5th percentile across all models
MMLU
47.0
Bottom 25% (8th pctile)
HumanEval
36.0
Bottom 25% (21th pctile)
GSM8K
35.0
Bottom 25% (6th pctile)
MT-Bench
63.0
Bottom 25% (0th pctile)

Capabilities

Features

Tool Use Vision Code Math Reasoning Multilingual Structured Output

Supported Frameworks

vllmsglangtgitensorrt-llmollama

Supported Precisions

BF16 (default)FP8INT4

Where to Deploy Code Llama 13B

Similar Models

Code Llama 7B

7B params · dense

Quality: 39

from $0.20/M

Similar specsCompare →

Code Llama 34B

34B params · dense

Quality: 55

from $0.78/M

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

Baichuan 2 13B

13B params · dense

Quality: 50

from $0.25/M

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

Frequently Asked Questions

How much VRAM does Code Llama 13B need for inference?

Code Llama 13B requires approximately 26.0 GB of VRAM at BF16 precision, 13.0 GB at FP8, or 6.5 GB at INT4 quantization. Additional VRAM is needed for KV-cache (819200 bytes per token) and activations (~1.50 GB).

What is the best GPU for Code Llama 13B?

The top recommended GPU for Code Llama 13B is the A100 40GB SXM using BF16 precision. It achieves approximately 322.9 tokens/sec at an estimated cost of $807/month ($0.95/M tokens). Score: 95/100.

How much does Code Llama 13B inference cost?

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