Skip to content
← General VRAM calculator
Code Llama / Model memory planning

Code Llama (70B)

VRAM calculator

70Btotal parameters in this catalog

One model, different memory footprints. Compare weight formats, then explore the context and memory budget that matter to your setup.

01 / Submitted scenario · Compare formats

The same model.
Six ways to hold its weights.

8k-token context
24 GB usable memory entered

Selected / Q4_K_M (4-bit)47.3 GB
Modeled shortfall23.3 GB

Estimate, not a guarantee of fit or performance.

Estimated memory by quantization at 8k tokens. All figures in GB. Select a format to open its scenario.
Weight formatWeightsKV cacheRuntimeTotal24 GB budgetOpen format scenario
FP16 (unquantised)16 effective bits / weight140.03.41.5144.9120.9shortfallUse format
Q8_0 (8-bit)8.5 effective bits / weight74.43.41.579.255.2shortfallUse format
Q6_K (6-bit)6.6 effective bits / weight57.83.41.562.638.6shortfallUse format
Q5_K_M (5-bit)5.7 effective bits / weight49.93.41.554.730.7shortfallUse format
Q4_K_M (4-bit)4.85 effective bits / weight · selected42.43.41.547.323.3shortfallUse format
Q3_K_M (3-bit)3.9 effective bits / weight34.13.41.539.015.0shortfallUse format

This table shows the submitted scenario. Live edits preview in the calculator below; Calculate scenario updates both the table and calculator. Arithmetic over stated assumptions, not measurements. Cache depends on architecture and precision; weight format alone does not establish model quality. The table and reference answer both use an 8k-token context.

02 / Adjust this model scenario

Change the budget.
Keep the model in view.

70B parameters are fixed on this page.
Use a custom model size ↗

01 / Set the scenario

Your model.
Your memory budget.

Model size

The catalog size is fixed for this model. Use a custom parameter count in the general calculator.

Smaller modeled weight footprint; check model-specific quality.

4k–128k is the planning range here, not a model support claim.

Enter memory available after other processes, rather than advertised device capacity.

02 / Read the footprint

Estimated device memory

47.3GBplanning estimate
Model weightsQ4_K_M (4-bit) · 4.85 effective bits / weight
42.4 GB
KV cache8k tokens · generic FP16 cache estimate
3.4 GB
Runtime allowanceFixed allowance in this planning model
1.5 GB
Modeled shortfall23.3 GB

Weights exceed the memory entered

The estimate exceeds your usable memory. Try a smaller model, a different weight format or a shorter context, and check the runtime requirements.

Usable memory entered24 GB
System RAM to load estimate
44 GB
Model file size estimate
44.6 GB
Open this scenario

Arithmetic over stated assumptions, not a benchmark. Architecture, KV heads, cache precision, runtime and offloading can change the actual footprint.

03 / Read the assumptions

A useful estimate
has visible limits.

Fixed reference / 8k-token context

How much VRAM does Code Llama (70B) need?

Code Llama (70B) (70B parameters) needs about 47.3 GB of VRAM at Q4_K_M and about 144.9 GB at FP16, with an 8k-token context. Estimate from parameter count, bits per weight, KV cache and 1.5 GB of runtime overhead — not a benchmark.

These calculations use the catalog's total parameter count: 70B. For mixture-of-experts models, the total counts all expert weights rather than only the parameters active for a token.

Model weights
Parameters × effective bits per weight ÷ 8. Effective bit values include format overhead and represent planning assumptions.
KV cache
A generic FP16 cache estimate from parameter-count bands and context length. This is not a measurement of this model's KV-head configuration.
Runtime allowance
1.5 GB is reserved for runtime overhead. Actual framework allocations, offloading and device workloads can change the requirement.

Memory capacity helps determine whether a scenario fits. Memory bandwidth, compute, architecture and runtime also affect speed. This calculator does not predict tokens per second.

Open compact calculator