Will It Fit?

Estimate single-GPU text inference VRAM across Transformers and vLLM with a compact, explainable breakdown.

9.2B dense • 8,192 context • 8 KV heads

Official profile: Official BF16 checkpoint. Google's official Gemma 2 9B Instruct release is exported in bfloat16.

Quick mental model: Transformers stays a fixed single-request baseline, while vLLM exposes serving context and concurrency. Runtime presets still change the required card VRAM, and FP8 KV cache cuts the KV term roughly in half versus BF16.

Fits on selected GPU

Gemma 2 9B · vLLM · Official BF16 checkpoint

Required GPU VRAM (0.9 budget)

24.0 GB

Core estimate: 21.6 GB. Against RTX 4090 24GB, this leaves 1.8 GB of headroom.

At 4,096 tokens, the estimated max concurrency is 2 concurrent requests.

Quick read

Selected GPU

RTX 4090 24GB

Runtime

vLLM

KV cache dtype

BF16

Context length

4,096

Current concurrency

1

Max concurrency @ context

2

Class

Consumer

Bandwidth

1,008 GB/s

Nominal VRAM

24 GB

Core estimate

21.6 GB

Required GPU VRAM (0.9 budget)

24.0 GB

Headroom

1.8 GB

Breakdown

Where the memory goes

Weights

9.2B resident parameters at 2.00 bytes each. Calibrated from the official checkpoint profile.

18.4 GB

KV cache

Concurrency 1, context 4,096, 42 KV-bearing layers, 8 KV heads, BF16 cache storage.

1.2 GB

Runtime / safety overhead

Conservative buffer for allocator fragmentation, kernels, and runtime scratch space.

2.0 GB

Weights = parameter count × bytes per parameter.

KV cache grows with context length, KV-bearing layers, concurrent requests, and the selected KV cache dtype.

Hybrid Qwen3.5 layers also keep a static linear-attention state, and runtime presets can inflate the required card VRAM beyond the core estimate.

Show the substituted formulas

Weights

parameter count × bytes per weight

9.2B × 2.00 = 18.4 GB

Google's official Gemma 2 9B Instruct release is exported in bfloat16.

KV cache

batch × effective KV tokens across attention layers × 2 × KV heads × head dim × bytes per KV element

1 × 172,032 × 2 × 8 × 224 × 2 = 1.2 GB

Longer context, deeper models, and larger batches all expand the cache linearly. BF16 controls the bytes per stored KV element.

Overhead

max(1.5 GB, 10% of weights + KV cache + linear state)

max(1.5 GB, 10% of 19.6 GB) = 2.0 GB

This leaves room for runtime buffers instead of claiming an unrealistically exact fit.

Tips

What to change next

This technically fits, but the headroom is thin. Leave extra space for kernels and runtime buffers.

Model

Selected model

Gemma 2 9B

9.2B dense • 8,192 context • 8 KV heads

About model

Architecture

Dense decoder-only transformer

Total params

9.2B

Active params

Dense model

Layers

42

Hidden size

3,584

Attention heads

16

KV heads

8

KV-bearing layers

42

Context length

8,192

Modality

Text

License

Gemma terms

Assumptions

The calculator works in raw bytes, displays decimal GB, and keeps both the core tensor footprint and the runtime-adjusted card requirement explicit instead of pretending every engine uses the full card the same way.