Gemma 4 31B on a DGX Spark
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 |
|---|---|
| Repository | google/gemma-4-31B-it (instruction-tuned; the base model is google/gemma-4-31B) |
| Parameters | 30.7B, dense; vision encoder about 550M |
| Layers | 60, of which 10 use full global attention and 50 a 1,024-token sliding window |
| Licence | Apache 2.0 |
| Context | 256K tokens (262,144 in config.json) |
| Input | Text and image; text output |
| Repository created | 2026-03-11 |
| Downloads, last 30 days | 5,431,138 on 2026-11-26 |
| Draft model | google/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:
| Build | Repository | Weights | Left of 121.6 GiB, before KV and OS |
|---|---|---|---|
| GGUF Q4_K_M | unsloth/gemma-4-31B-it-GGUF | 18.3 GB | about 104 GiB |
| GGUF UD-Q4_K_XL | unsloth/gemma-4-31B-it-GGUF | 18.8 GB | about 104 GiB |
| GGUF Q4_0, Google QAT | google/gemma-4-31B-it-qat-q4_0-gguf | 17.7 GB | about 105 GiB |
| NVFP4, attention also in FP4 | RedHatAI/gemma-4-31B-it-NVFP4 | 23.3 GB | about 100 GiB |
| W4A16, Google QAT | google/gemma-4-31B-it-qat-w4a16-ct | 23.3 GB | about 100 GiB |
| NVFP4, attention kept in BF16 | nvidia/Gemma-4-31B-IT-NVFP4 | 32.6 GB | about 91 GiB |
| GGUF Q8_0 | unsloth/gemma-4-31B-it-GGUF | 32.6 GB | about 91 GiB |
| FP8 dynamic | RedHatAI/gemma-4-31B-it-FP8-dynamic (an FP8-block repo is 33.3 GB too) | 33.3 GB | about 91 GiB |
| BF16 | google/gemma-4-31B-it | 62.5 GB | about 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.
- llama.cpp with a GGUF file: the llama.cpp doc covers the
sm_121build and serving. Load themmprojfile as well if you want image input. - vLLM with the NVFP4 or FP8 builds: the vLLM doc covers the install on a base image. New rentals are system containers with their own Docker daemon (see the tenant environment), so the Docker-based recipes below can in principle run inside one; we have not tried them.
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.
- One Spark, vLLM, NVIDIA NVFP4, no drafter: ai-muninn lists its Docker image and serving flags (FP8 KV cache, 32,768-token context,
--gpu-memory-utilization 0.85). - One or two Sparks, vLLM v0.29.0, NVIDIA NVFP4 with the assistant drafter and a 256K context: the BHCC2025 release v0.1.0, with images and model revisions pinned.
- One Spark, vLLM 0.20.2rc1 preview, NVFP4 with the drafter at 4 speculative tokens: the devsnack write-up, which bind-mounts a patched
gemma4_mtp.pyfrom a then-open vLLM pull request. - Other quantisations with the drafter (Intel int4 AutoRound, an NVFP4A16 GPTQ build, Red Hat FP8): the NVIDIA forum thread on Gemma 4 draft models.
- llama.cpp with MTP: pull request #23398, merged 2026-06-07, which pairs the main GGUF with an
mtp-gemma-4-31B-it.ggufdraft file. - A DFlash speculator instead of MTP: the NVIDIA forum DFlash thread, which needed three runtime patches to a vLLM nightly.
Reported speeds
| Setup | Engine | Decode | Concurrency | Source | Date |
|---|---|---|---|---|---|
| 1 Spark, BF16 | vLLM, gemma4-cu130 image | 3.7 tok/s (tg128) | 1 | NVIDIA forum, WilliamD | 2026-04-02 |
| 1 Spark, AWQ int4 (cyankiwi) | vLLM, gemma4-cu130 image | 10.6 tok/s (tg128) | 1 | NVIDIA forum, WilliamD | 2026-04-02 |
| 1 Spark, NVIDIA NVFP4 | vLLM, gemma4-cu130 image | 7.0 tok/s, three 500-token runs | 1 | ai-muninn | 2026-04-05 |
| 1 Spark, runtime FP8 from BF16 | vLLM 0.19.1rc1 | 6.79 to 6.93 tok/s | 1 | NVIDIA forum, danielkreuzhofer | 2026-04-07 |
| 1 Spark, runtime FP8 from BF16 | vLLM 0.19.1rc1 | 26.82 tok/s aggregate, 6.96 per request (tg32) | 4 | NVIDIA forum, danielkreuzhofer | 2026-04-07 |
| 1 Spark, Q4_K_M | llama.cpp 5d3a4a7 | 11.0 tok/s (tg128); 9.2 at 32,768 tokens of context | 1 | shamily benchmark | 2026-04-06 (latest changelog entry) |
| 1 Spark, Q4_K_M and BF16 (ggml-org GGUF) | llama.cpp b8922 | 10.65 tok/s at Q4_K_M, 3.82 at BF16 (tg128) | 1 | nabe2030 benchmark | 2026-04-25 |
| 1 Spark, runtime FP8, DFlash speculator, 8 draft tokens | vLLM 0.19.2rc1 nightly, patched | 15.44 tok/s average (range 9.9 to 28.1); 5.53 without the speculator | 1 | NVIDIA forum, meanaverage | 2026-04-21 |
| 1 Spark, Intel int4 AutoRound, MTP drafter, 2 tokens | vLLM with a pull request applied | 22.05 tok/s; 11.43 without the drafter (tg128) | 1 | NVIDIA forum, serapis | 2026-05-05 |
| 1 Spark, NVIDIA NVFP4, MTP drafter, 4 tokens | vLLM 0.20.2rc1 preview | 18.8 tok/s average (14.8 to 21.9 by task); 6.5 without (advantage) | 1 | devsnack | 2026-05-06 (test date) |
| 1 Spark, NVFP4A16 GPTQ (ebircak), MTP drafter, 7 tokens | vLLM, spark-vllm-docker | 30.9 to 52.0 tok/s by task | 1 | NVIDIA forum, joshua.dale.warner | 2026-05-07 |
| 1 Spark, same setup | vLLM, spark-vllm-docker | 118.3 tok/s aggregate, about 30 per request (advantage) | 4 | NVIDIA forum, joshua.dale.warner | 2026-05-07 |
| 1 Spark, NVIDIA NVFP4, MTP drafter, 4 tokens | vLLM 0.20.2rc1 nightly | 16.34 to 19.79 tok/s by task; 6.82 to 6.86 without | 1 | tsuru_mitsu | 2026-05-13 |
| 1 Spark, Red Hat FP8 dynamic, MTP drafter, 7 tokens | vLLM | 24.8 to 35.5 tok/s by task; 87.0 aggregate at 4 | 1 and 4 | NVIDIA forum, joshua.dale.warner | 2026-05-20 |
| 1 Spark, quant not stated, MTP draft GGUF, up to 4 tokens | llama.cpp, PR #23398 | 11.4 to 19.3 tok/s by prompt; 5.9 to 6.2 without | 1 | llama.cpp PR, am17an | 2026-05-20 |
| 1 Spark, NVFP4 per the article's chart | vLLM | about 6 tok/s single; about 92 aggregate | 1 and 16 | Flaviu Vlaicu | 2026-06-20 |
| 1 Spark, NVIDIA NVFP4, assistant drafter | vLLM v0.29.0 | 24.2 tok/s code, 16.6 prose; 6.8 without | 1 | BHCC2025 release | 2026-09-29 |
| 2 Sparks, runtime FP8, TP=2 | vLLM, vllm-node-tf5 container | 10.96 tok/s single; 56.04 aggregate at 10 | 1 and 10 | NVIDIA forum, raphael.amorim | 2026-04-07 |
| 2 Sparks, NVIDIA NVFP4, TP=2, assistant drafter | vLLM v0.29.0 | 40.6 tok/s code, 28.0 prose; 12.0 without | 1 | BHCC2025 release | 2026-09-29 |
| 4 Sparks, BF16, TP=4, MTP drafter | SGLang v0.5.11 with a cherry-picked PR | 26.68 tok/s single (6 steps); 153.24 aggregate at 8 (4 steps); 10.49 single without | 1 and 8 | NVIDIA forum, ht12 | 2026-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.