Gemma 4 31B on RTX 5090 workstation (1x 32 GB)

31.273B on 32 GB at 1,792 GB/s. Hardware details · Model details

Run locally →
Marginal. Gemma 4 31B fits on RTX 5090 workstation (1x 32 GB) at the recommended Q4_K_M configuration, requiring approximately 27.2 GB at 8K context. Practical context capacity is 8K. Measured evidence: 67.31 t/s median across 33 comparable runs at Q4_K_M and 128 context. Aggregated
CompatibilityBorderline
Calculated fit
Yes
Calculated Uses 90-97% of usable memory. Likely to load but fragile under load or long context.
Recommended quantization
Q4_K_M
Calculated gguf
Memory required
27.2 GB
Calculated of 29.4 GB usable — 93%
Max practical context
8K
Calculated model supports 256K
Observed resident fit: Q4_K_M with eng_llama_cpp at 128 context. This is measured evidence for those exact artifacts and settings; it does not change the standard memory calculation above.

Memory budget at 8K context

Model weights ⓘ
18.2 GB Calculated
KV cache ⓘ
7.5 GB Calculated
Runtime overhead ⓘ
1.5 GB Estimated
Total required
27.2 GB Calculated
Headroom ⓘ
2.2 GB Calculated
Only a borderline fit (93% of usable memory). Expect to run headless and keep the context short.
Discrete GPU: 32 GB of VRAM, of which we assume 92% is usable after driver and context overhead.
Borderline fit. It may load, but you will have little room for a longer context, a second process, or a desktop session.
Performance

Measured performance · recommended Q4_K_M

Decode, prefill and TTFT below are measured for Q4_K_M, the recommended configuration.

High7/10
Measured decode
67.3 t/s
Aggregated median; observed 64.7–69.7 t/s
Measured prefill
—
Aggregated not reported
TTFT at 8K
0.19 s
Aggregated median time to first token
Hardware load reference
640 W
Measured machine-level load; not this model run

Measurement evidence

33 measured runs

Rows are kept separate when quantization, runtime, context, workload or execution settings differ.

QuantEngineDecode modeContextRunsMedian decodeMedian prefillLatestSources
Q4_K_Mllama.cppstandard1283367.31 t/s—1 Jul 2026llm-speed.com
How the estimate is calculated
  1. Decode: reading 31.3B active parameters at 4.85 bits/weight takes 13.36 ms at 1792 GB/s x 79% achieved efficiency.
  2. Prefill: 210 TFLOPS (FP16) x 2 for native FP8 tensor cores x 0.71 calibrated against measured prefill on this platform x 32% assumed model-FLOPs utilisation, divided by 2 x 31.3B parameters per token.

  • Prefill throughput is highly engine-dependent. Flash attention, batch size and quantized KV all move this number substantially, and for sparse mixture-of-experts models it is the least reliable figure we produce.
  • This is a calculated estimate, not a measurement. It assumes a single request, a short prompt, no speculative decoding and a warm model already resident in memory.

Estimator version estimator_v1. Stored with every estimated row so old estimates can be regenerated when the model improves.

Why this is rated "High" confidence
  • Independent third-party benchmark: +3
  • 33 measurements: +2
  • Sources agree closely (±1%): +2
  • Incomplete run metadata: +0

Score 7/10. Aggregated with the median, not the mean, so one outlier cannot move the headline figure.

This model at other quantizations on this machine
QuantizationResidentDiskTotal neededUtilisationFitMax context
Q4_K_Mrecommended18.2 GB18.2 GB27.2 GB93%BorderlineResident run observed8K
Q5_K_M21.3 GB21.3 GB30.5 GB104%Does not fit4K
Q8_031.6 GB31.6 GB41.0 GB139%Does not fit0
BF1658.3 GB58.3 GB68.5 GB233%Does not fit0
Cost of running Gemma 4 31B on this machineUnited States (federal) · C corporation · 8h/day
Monthly economic cost
$46
Calculated after tax
Codex/Claude Code
$100/mo
≈ $100/mo · local is $54 less
Net cash at purchase
$3,332
Calculated VAT not reclaimable
Total over 5 years
$2,731
Calculated after tax, after resale
Cost per USD/1M tokens
$5.34
Calculated 8.5M tokens/month

The $100 comparison uses the Codex Pro 5x / Claude Max 5x plans. A fixed planning conversion is used for USD. This compares monthly spend only: subscriptions have usage limits, local hardware has different capabilities and constraints, and taxes or regional pricing may change the charged amount. Prices checked 7 September 2026.

Purchase-price input: $3,332 in United States (federal), tax/VAT excluded · estimated · NL retail (system build) (converted catalogue estimate). This is the localized purchase input; the after-tax economic cost is calculated separately below.

Monthly breakdown

Depreciation
2,832 over 5 years, straight-line to a 500 residual
$47.21
Electricity
32.4 kWh/month at 0.140/kWh
$4.53
Cost of capital
4.0%/yr on 1,916 average capital employed
$6.39
Monthly cost before tax$58.13
Electricity tax shield
Running costs are deductible business expenses
−$0.95
First-year expensing
§179 (100.0%)
−$11.66
Monthly economic cost after tax$45.51

Three different numbers, deliberately

Cash cost
$3,332
Money that leaves the bank account on day one, net of reclaimable VAT.
Accounting depreciation
$47.21/month
$2,832 written down over 5 years to a $500 residual.
After-tax economic cost
$45.51/month
Depreciation plus running costs plus cost of capital, less the tax those deductions save. This is the figure to compare between machines.
Assumptions and sources (verified 2026-09-07)
VAT rate
0% Official spec
VAT recoverable
0% Official spec
Federal C-corporation estimate at the flat 21% rate. Pass-through entities should use the sole-proprietor estimate as a rougher proxy.
Effective deduction rate
21.00% Calculated
Headline marginal rate 21.00%.
Depreciation
5 years, straight-line Assumption
Residual value
$500 (15%) Assumption
Two GPU generations later, the card is worth a fraction of its list price.
Electricity
$0.140/kWh Assumption
Average power draw
184 W Calculated
Load 640 W for 20% of powered hours, idle 70 W for the rest — a machine that is on is not generating tokens the whole time.
Investment allowances
§179 100.0% Official spec
Worth $700 in total — first-year expensing that replaces later tax depreciation.
Cost of capital
$6.39/month Assumption
Assumes the machine generates tokens 20% of its 176 powered hours per month. Cost per token scales inversely with this number — halve the utilisation and the cost per token doubles.
Federal planning estimate only, not tax advice. State and local income tax, sales/use tax and incentives are excluded. It assumes 100% business use, a Section 179 election, enough business income to use it, and that the full annual limit remains available.
Efficiency metrics
Decode per $1,000 spent
20.2 t/s
Calculated purchase price only
Decode per $100/month
147.9 t/s
Calculated after-tax ownership cost
Tokens per joule
0.37
Calculated same as tokens/s per watt
USD per 1M output tokens
$5.34
Calculated at 20% utilisation
Local versus hosted APIs
Hosted modelUSD/1M outputBreak-evenAPI at your volumeVerdictComparison type
Qwen3.8 Flash
Alibaba Cloud
$0.4229.6M/mo$13API cheaperDifferent model
DeepSeek-V4.1 Flash
DeepSeek
$0.6025.3M/mo$15API cheaperDifferent model
DeepSeek-V4 Pro
DeepSeek
$1.986.3M/mo$62Local cheaperDifferent model
DeepSeek V4 Pro (Together)
Together AI
$4.402.1M/mo$181Local cheaperDifferent model
GLM-5.3
Z.ai
$4.402.9M/mo$133Local cheaperDifferent model
Claude Haiku 4.5
Anthropic
$5.003.5M/mo$111Local cheaperDifferent model
Different-model comparison: the hosted model is not the model you would run locally. Treat this as a workload-quality trade-off, not a direct economic equivalence — the frontier model may complete a task in fewer tokens, or complete tasks the local model cannot. Break-even is the monthly output volume at which API spend equals the $46/month economic cost of owning this machine, assuming 8 input tokens per output token. Hosted prices are published in USD. This table is the canonical US default.