Docs/Models/Gemma 4 31B
Models

Gemma 4 31B on a DGX Spark

Samuel Seidel · Published November 26, 2026

Gemma 4 31B-it is Google's 30.7B dense model under Apache 2.0, and it fits one 128 GB DGX Spark at every common precision: 18.3 GB as a Q4_K_M GGUF, 32.6 GB as NVIDIA's NVFP4 build and 62.5 GB in BF16. Fitting is the easy part. Every token reads all of the weights, so third parties report 7.0 tok/s with NVFP4 on vLLM and about 11 tok/s at Q4_K_M on llama.cpp. Google's MTP drafter lifts that to roughly 16 to 24 tok/s single-stream in most reports. GPUwerk has not measured this model and it is not a console preset; every speed below is a third-party figure with its source and date.

What it is

Item Value
Repositorygoogle/gemma-4-31B-it (instruction-tuned; the base model is google/gemma-4-31B)
Parameters30.7B, dense; vision encoder about 550M
Layers60, of which 10 use full global attention and 50 a 1,024-token sliding window
LicenceApache 2.0
Context256K tokens (262,144 in config.json)
InputText and image; text output
Repository created2026-03-11
Downloads, last 30 days5,431,138 on 2026-11-26
Draft modelgoogle/gemma-4-31B-it-assistant, a 0.94 GB MTP drafter

Parameter count, vision encoder size, layer count, sliding window, context, licence and input types are from the Hugging Face model card, checked 2026-11-26; the 10 global layers are counted from layer_types in the repo's config.json. The repository date and download count come from the Hugging Face API on the same day. The API's safetensors metadata lists 31,273,088,876 BF16 parameters, which includes the vision encoder and the embedding table. The assistant card describes the drafter as a Multi-Token Prediction model for speculative decoding and claims speedups of up to 3x; that is Google's claim, not a Spark measurement.

How it fits in 121.6 GiB

A Spark has 128 GB of unified memory, of which about 121.6 GiB is addressable (see which models fit in 128 GB). Weight sizes are the sums of the weight files in each repo's file listing, checked 2026-11-26:

BuildRepositoryWeightsLeft of 121.6 GiB, before KV and OS
GGUF Q4_K_Munsloth/gemma-4-31B-it-GGUF18.3 GBabout 104 GiB
GGUF UD-Q4_K_XLunsloth/gemma-4-31B-it-GGUF18.8 GBabout 104 GiB
GGUF Q4_0, Google QATgoogle/gemma-4-31B-it-qat-q4_0-gguf17.7 GBabout 105 GiB
NVFP4, attention also in FP4RedHatAI/gemma-4-31B-it-NVFP423.3 GBabout 100 GiB
W4A16, Google QATgoogle/gemma-4-31B-it-qat-w4a16-ct23.3 GBabout 100 GiB
NVFP4, attention kept in BF16nvidia/Gemma-4-31B-IT-NVFP432.6 GBabout 91 GiB
GGUF Q8_0unsloth/gemma-4-31B-it-GGUF32.6 GBabout 91 GiB
FP8 dynamicRedHatAI/gemma-4-31B-it-FP8-dynamic (an FP8-block repo is 33.3 GB too)33.3 GBabout 91 GiB
BF16google/gemma-4-31B-it62.5 GBabout 63 GiB

The leftover column is our arithmetic (GB converted to GiB, subtracted from 121.6). NVIDIA's quantization config excludes the self-attention of all 60 layers, the lm_head and the vision tower from NVFP4, which is why its file is 9 GB larger than Red Hat's. The GGUF files hold the language model only; the vision projector is a separate mmproj file of 1.2 GB at BF16 in the same repo, and Unsloth's repo also ships the MTP drafter as a 0.51 GB Q8_0 GGUF. A UD-Q3_K_XL file (15.4 GB) and smaller quants exist, but nothing here needs them for memory.

The context costs little on the sliding-window layers, because they only keep the last 1,024 tokens. By our arithmetic from config.json, with an FP8 cache that stores keys and values separately: the 10 global layers (4 KV heads of dimension 512) take 40 KiB per token, so 32,768 tokens need about 1.25 GiB and the full 262,144 about 10 GiB per sequence, while the 50 sliding layers (16 KV heads of dimension 256) add a fixed 400 MiB or so per sequence. The config sets attention_k_eq_v for the global layers, so an engine that stores one tensor for both would need about half of the global figure. These are estimates for sizing, not measurements; vLLM's actual allocation is what counts, and in the ai-muninn run below it reported 66.95 GiB of KV memory, 146,240 cache tokens and room for 27.57 requests of 32,768 tokens at --gpu-memory-utilization 0.85. We have not reconciled that token count with our per-token arithmetic. To size your own context and cache, use the memory calculator.

Bandwidth is the real limit. Our Gemma 4 26B-A4B guide explains why the 31B dense is about 7x slower than the mixture-of-experts sibling, using an idealised 4-bit file of about 15.4 GB and a ceiling near 18 tok/s. The real files are bigger, because of quantisation scales, layers kept at higher precision and a 262,144-entry embedding table that is read again as the output layer. Dividing 273 GB/s by the actual file sizes gives lower ceilings (our arithmetic, using the whole file, which slightly overstates the bytes read since the vision encoder is not used during text decode):

tokens/sec ceiling ≈ 273 GB/s ÷ bytes read per token

# BF16,          62.5 GB -> ~4.4 tok/s; reported 3.7 to 3.82 (about 85%)
# NVIDIA NVFP4,  32.6 GB -> ~8.4 tok/s; reported 6.8 to 7.0 (about 82%)
# GGUF Q4_K_M,   18.3 GB -> ~14.9 tok/s; reported 10.65 to 11.0 (about 73%)

These ceilings are arithmetic, not measurements. Speculative decoding is the way past them: the drafter proposes several tokens, and the 31B checks them all in one pass over its weights, so each accepted draft token comes almost free. The same logic explains why parallel requests help. One read of the weights serves every sequence in the batch, so aggregate throughput grows with concurrency while each request stays near 7 tok/s.

Run it on GPUwerk

Gemma 4 31B is not a console preset. To run it, rent a Spark, start a base image (DGX OS or Ubuntu 24.04) and install the engine and weights yourself. A Spark is $0.79/hour, billed per minute against a prepaid balance (pricing), and the download is yours to plan for: 18 GB at Q4_K_M, 33 GB for NVFP4 and 63 GB for BF16.

To choose between the two, see choosing an inference engine. GPUwerk has not tested Gemma 4 image input; the multimodal vision models guide covers the general setup.

Run it yourself

We do not publish launch commands for this model, because GPUwerk has not tested any on a fleet node. The recipes below are the sources of the reported speeds, and all of them are not tested by GPUwerk.

Reported speeds

Setup Engine Decode Concurrency Source Date
1 Spark, BF16vLLM, gemma4-cu130 image3.7 tok/s (tg128)1NVIDIA forum, WilliamD2026-04-02
1 Spark, AWQ int4 (cyankiwi)vLLM, gemma4-cu130 image10.6 tok/s (tg128)1NVIDIA forum, WilliamD2026-04-02
1 Spark, NVIDIA NVFP4vLLM, gemma4-cu130 image7.0 tok/s, three 500-token runs1ai-muninn2026-04-05
1 Spark, runtime FP8 from BF16vLLM 0.19.1rc16.79 to 6.93 tok/s1NVIDIA forum, danielkreuzhofer2026-04-07
1 Spark, runtime FP8 from BF16vLLM 0.19.1rc126.82 tok/s aggregate, 6.96 per request (tg32)4NVIDIA forum, danielkreuzhofer2026-04-07
1 Spark, Q4_K_Mllama.cpp 5d3a4a711.0 tok/s (tg128); 9.2 at 32,768 tokens of context1shamily benchmark2026-04-06 (latest changelog entry)
1 Spark, Q4_K_M and BF16 (ggml-org GGUF)llama.cpp b892210.65 tok/s at Q4_K_M, 3.82 at BF16 (tg128)1nabe2030 benchmark2026-04-25
1 Spark, runtime FP8, DFlash speculator, 8 draft tokensvLLM 0.19.2rc1 nightly, patched15.44 tok/s average (range 9.9 to 28.1); 5.53 without the speculator1NVIDIA forum, meanaverage2026-04-21
1 Spark, Intel int4 AutoRound, MTP drafter, 2 tokensvLLM with a pull request applied22.05 tok/s; 11.43 without the drafter (tg128)1NVIDIA forum, serapis2026-05-05
1 Spark, NVIDIA NVFP4, MTP drafter, 4 tokensvLLM 0.20.2rc1 preview18.8 tok/s average (14.8 to 21.9 by task); 6.5 without (advantage)1devsnack2026-05-06 (test date)
1 Spark, NVFP4A16 GPTQ (ebircak), MTP drafter, 7 tokensvLLM, spark-vllm-docker30.9 to 52.0 tok/s by task1NVIDIA forum, joshua.dale.warner2026-05-07
1 Spark, same setupvLLM, spark-vllm-docker118.3 tok/s aggregate, about 30 per request (advantage)4NVIDIA forum, joshua.dale.warner2026-05-07
1 Spark, NVIDIA NVFP4, MTP drafter, 4 tokensvLLM 0.20.2rc1 nightly16.34 to 19.79 tok/s by task; 6.82 to 6.86 without1tsuru_mitsu2026-05-13
1 Spark, Red Hat FP8 dynamic, MTP drafter, 7 tokensvLLM24.8 to 35.5 tok/s by task; 87.0 aggregate at 41 and 4NVIDIA forum, joshua.dale.warner2026-05-20
1 Spark, quant not stated, MTP draft GGUF, up to 4 tokensllama.cpp, PR #2339811.4 to 19.3 tok/s by prompt; 5.9 to 6.2 without1llama.cpp PR, am17an2026-05-20
1 Spark, NVFP4 per the article's chartvLLMabout 6 tok/s single; about 92 aggregate1 and 16Flaviu Vlaicu2026-06-20
1 Spark, NVIDIA NVFP4, assistant draftervLLM v0.29.024.2 tok/s code, 16.6 prose; 6.8 without1BHCC2025 release2026-09-29
2 Sparks, runtime FP8, TP=2vLLM, vllm-node-tf5 container10.96 tok/s single; 56.04 aggregate at 101 and 10NVIDIA forum, raphael.amorim2026-04-07
2 Sparks, NVIDIA NVFP4, TP=2, assistant draftervLLM v0.29.040.6 tok/s code, 28.0 prose; 12.0 without1BHCC2025 release2026-09-29
4 Sparks, BF16, TP=4, MTP drafterSGLang v0.5.11 with a cherry-picked PR26.68 tok/s single (6 steps); 153.24 aggregate at 8 (4 steps); 10.49 single without1 and 8NVIDIA forum, ht122026-05-16

Checked 2026-11-26. Every figure is reported by its author, not measured by GPUwerk, and we have reproduced none. The harnesses differ: some use llama-benchy or llama-bench with short synthetic prompts, others time real prompts through an API, and the speculative rows depend heavily on the task (structured JSON and code accept more draft tokens than creative prose). Do not read the rows as an engine comparison. The two joshua.dale.warner rows are posts in the draft-models thread linked above; the May 20 post names the Red Hat dynamic FP8 build without a repo id. The DFlash thread title says about 2.5x, while the body's averages work out to 2.79x. The 6.9 tok/s figure our 26B-A4B guide cites is a forum reply of 2026-04-03 in the WilliamD thread, which ai-muninn quotes; ai-muninn's own run two days later measured 7.0.

Three things stand out in these reports. Without a drafter, every single-Spark build lands at 70 to 85% of its bandwidth ceiling from the arithmetic above, so changing engines alone will not move much. With a drafter, the single-stream gain runs from about 2x to 3.6x, higher on code and structured output than on prose; in the llama.cpp run, draft acceptance ranged from 40% on short creative prompts to 81% on step-by-step maths. And concurrency scales well on a dense model: the FP8 run held about 7 tok/s per request at 4 parallel requests, and the MTP setup held about 30 per request at 4. A second Spark over tensor parallelism is reported at 1.6x to 1.8x single-stream; for the cabling, see the two-node cluster guide. No SGLang figure for one Spark turned up in our search.

GPUwerk has not measured this model

We have no tok/s, memory or quality figure of our own for Gemma 4 31B at any precision, with or without a drafter. The numbers GPUwerk does publish are for other models on the benchmarks page; the closest dense comparison there is Llama 3.3 70B at 6.0 tok/s (AWQ 4-bit, vLLM), which says nothing direct about this model. Run your own prompts on a rented Spark before relying on any figure here, and if speed matters more than the last bit of quality, compare against the Gemma 4 26B-A4B on the same prompts.

FAQ

Does Gemma 4 31B fit on one DGX Spark?

Yes, at every common precision. The BF16 weights are 62.5 GB, NVIDIA's NVFP4 build 32.6 GB and Unsloth's Q4_K_M GGUF 18.3 GB, per the Hugging Face file listings checked on 2026-11-26. Even BF16 leaves about 63 GiB of the 121.6 GiB a Spark can address for the KV cache and everything else (our arithmetic).

How fast is Gemma 4 31B on a Spark?

Slow without speculative decoding, because a dense model reads all of its weights for every token. Reported, not measured by GPUwerk: 3.7 tok/s in BF16 (NVIDIA forum, 2026-04-02) and 7.0 tok/s with NVIDIA's NVFP4 build on vLLM (ai-muninn, 2026-04-05), and 10.65 to 11.0 tok/s at Q4_K_M on llama.cpp (two GitHub benchmarks, April 2026).

Does speculative decoding help?

Yes, by about 2 to 3.6 times single-stream in the reports we found. With Google's gemma-4-31B-it-assistant MTP drafter, NVFP4 on vLLM is reported at 18.8 tok/s on average (devsnack, 2026-05-06) and at 24.2 tok/s on code and 16.6 on prose (BHCC2025, 2026-09-29). llama.cpp's MTP support reports 11.4 to 19.3 tok/s depending on the prompt (2026-05-20). GPUwerk has not reproduced any of these.

Should I pick the 31B or the 26B-A4B?

For interactive use on one Spark, the 26B-A4B: ai-muninn reports 52 tok/s for it against 7.0 for the 31B with NVFP4 on vLLM (April 2026). Pick the 31B if it answers your prompts better, and plan on a drafter, batch jobs or several parallel requests to make up for its decode speed.

Is Gemma 4 31B a GPUwerk console preset?

No. Rent a Spark at $0.79/hour, billed per minute against a prepaid balance, start a base image and install llama.cpp or vLLM yourself. GPUwerk has not tested a launch command for this model, so start from the community recipes linked on this page.

See alsoWhich models fit in 128 GB See alsoGemma 4 26B-A4B on a DGX Spark See alsoChoosing an inference engine
Top up from $5, billed per minute

Test it on your own prompts.

A dedicated Spark, deployed in seconds.

Create account