Skip to content

Ten seconds to a fit

What can this machine run, before you install anything?

onpar fit reads the hardware it is on and sizes every model in the catalogue at the context and concurrency you name. A model fits when its weights, its KV cache and a runtime overhead together stay inside the memory the accelerator may use. Everything else is listed with the reason it does not.

Nothing is downloaded and nothing is started. The answer is arithmetic over the catalogue’s published architectures, so it comes back before a model could finish loading.

$ onpar fit --context 32k --concurrency 8
M4 Max · 16 cores · 128 GB · 546 GB/s
usable for inference: 96 GB
raise to ~118 GB with: sudo sysctl iogpu.wired_limit_mb=120586
FEASIBLE at 32,768 context, concurrency 8
model quant weights kv total free ~tok/s license
----------------------------------------------------------------------------------------
Qwen3 32B q4 17.2G 64.0G 84.1G 11.9G 15 slow Apache-2.0 OK
Qwen3 30B-A3B (MoE) q8 28.4G 24.0G 56.2G 39.8G 60 Apache-2.0 OK
Mistral Small 24B q8 22.0G 40.0G 65.2G 30.8G 14 slow Apache-2.0 OK
Phi-4 14B q8 13.7G 50.0G 66.3G 29.7G 18 MIT OK
Llama 3.1 8B q8 7.5G 32.0G 41.6G 54.4G 32 Llama 3.1 !
NOT FEASIBLE
Gemma 3 27B weights fit (14 GB) but KV at 32,768 ctx x8 (124 GB) puts it 45 GB over the 96 GB available
Llama 3.3 70B weights fit (37 GB) but KV at 32,768 ctx x8 (80 GB) puts it 25 GB over the 96 GB available
Qwen3 235B-A22B (MoE) weights alone need 123 GB at q4 — MoE sparsity (22B of 235B active) cuts compute, not memory
DeepSeek V3 (MoE, MLA) weights alone need 352 GB at q4 — MoE sparsity (37B of 671B active) cuts compute, not memory
GLM-5.2 weights alone need 186 GB at q4 — MoE sparsity (32B of 355B active) cuts compute, not memory
Kimi K2.7 Code weights alone need 524 GB at q4 — MoE sparsity (32B of 1000B active) cuts compute, not memory
Kimi K3 (2.8T MoE) weights alone need 1,467 GB at q4 — MoE sparsity (50B of 2800B active) cuts compute, not memory
DeepSeek V4 Pro weights alone need 838 GB at q4 — MoE sparsity (45B of 1600B active) cuts compute, not memory
MiniMax M3 weights alone need 239 GB at q4 — MoE sparsity (46B of 456B active) cuts compute, not memory
runtime -> mlx
Apple silicon: the CUDA engines cannot run here at all. MLX has the better
batching story of the two Metal options.
~tok/s is a memory-bandwidth roofline, not a measurement — `onpar measure` measures.
onpar fit --explain <model-id> # show the arithmetic
# recorded 2026-11-03 on M4 Max · 128 GB · onpar 1.5.2

The first three lines describe the machine. On Apple silicon, macOS lets the GPU wire down 75% of unified memory by default, which is the usable for inference figure. The raise to ~118 GB line is the 92% ceiling and the sysctl that reaches it. Both fractions are named constants in src/onpar/hardware.py. Once you raise the limit, the next run reads it back and sizes against it.

Each row is one model at one quantisation:

  • quant is the highest precision that fits, capped at 8-bit.
  • weights is parameters times bits per weight.
  • kv is the cache for every token of context, for every concurrent request.
  • total adds a runtime overhead to those two, and free is what is left.
  • ~tok/s is single-stream decode speed, a roofline estimate, not a measurement. The footer of every run says so.
  • license reads OK when the licence is clean for commercial use and ! when it carries caps or restrictions you need to read first.

Two marks can follow a row. slow means the model fits but the roofline estimate is under 15 tok/s, the threshold in Fit.slow. A ? after the name means the catalogue has not verified that model’s architecture, so its KV figure is an estimate. The run above has no ? rows, because every model in it is verified.

The solver exists because the common shortcuts are wrong in ways that cost money or crash a server:

  • Mixture of experts. All experts must be resident, so weights count total parameters. Sparsity cuts compute per token, not memory. Look at the NOT FEASIBLE rows above: each MoE line says exactly that.
  • Grouped-query attention. KV grows with kv_heads, not with attention heads. Counting attention heads overstates the cache.
  • Multi-head latent attention. DeepSeek-family models store one compressed latent of kv_lora_rank per layer. For DeepSeek V3, the grouped-query formula overstates the cache 64 times. Fit shows the arithmetic.

Three ways KV cache sizing goes wrong

Look at the direction of each bar: the MoE error says a model fits when it does not, while the other two make you buy hardware you did not need.

Every model that does not fit is printed with its reason, never dropped. A reason names the term that broke the budget. weights alone need 123 GB is a different purchase from puts it 25 GB over, which a shorter context or lower concurrency may fix.

--explain shows the arithmetic for one model, line by line:

$ onpar fit --explain qwen3-30b-a3b --context 32k --concurrency 8
Qwen3 30B-A3B (MoE) @ q8, 32,768 ctx, concurrency 8
weights 30.5B params x 8 bits / 8 = 28.4 GB (MoE: ALL experts resident)
kv cache 98,304 B/tok x 32,768 tok x 8 = 24.0 GB (GQA)
overhead 8% of weights + 1.5 GB floor = 3.8 GB
--------------------------------------------------------------
required 56.2 GB
usable 96.0 GB
headroom 39.8 GB
decode is bandwidth-bound, and reads both:
weights 3.1 GB/token (3.3B active)
kv cache 3.0 GB/token (the whole cache, every token)
total 6.1 GB/token at 72% of peak
~60 tok/s single-stream (roofline estimate, not measured)
! MoE at batch 8: the weight read above is held at 3.3B, which is exact only at batch 1.
Sequences route to different experts, so the real read is between 3.3B and 26.4B — up to 8.0x.
The aggregate throughput and $/Mtok figures take the low end, so they flatter rather than warn.
verdict: FITS
# recorded 2026-11-03 on M4 Max · 128 GB · onpar 1.5.2

The MoE warning at the bottom is the honest part. At batch 1 the weight read is exact. At batch 8 each sequence routes to its own experts, so the real read sits in a range, and the throughput figures take the optimistic end.

onpar where asks the question from the other side. It sizes one model against every hardware profile in the catalogue, cheapest capable first:

$ onpar where qwen3-30b-a3b --context 32k
Qwen3 30B-A3B (MoE) · 30.5B (3.3B active, MoE) · Apache-2.0 OK
at 32,768 context, concurrency 1
hardware quant total ~tok/s $/hr $/Mtok
------------------------------------------------------------------
NVIDIA RTX 5090 q4 21.8G 254 0.55 0.60
NVIDIA L40S q8 35.2G 95 0.80 2.33
NVIDIA A100 40 GB q8 35.2G 172 1.10 1.78
NVIDIA A100 80 GB q8 35.2G 225 1.80 2.22
AMD MI300X 192 GB q8 35.2G 585 2.50 1.19
NVIDIA H100 80 GB SXM q8 35.2G 370 2.90 2.18
NVIDIA H200 141 GB q8 35.2G 530 3.60 1.89
NVIDIA B200 192 GB q8 35.2G 883 5.50 1.73
2× NVIDIA H100 q8 35.2G 684 5.80 2.35
TPU v5e (8 chips) q8 35.2G 659 9.60 4.05
4× NVIDIA H100 q8 35.2G 1313 11.60 2.45
TPU v5p (4 chips) q8 35.2G 1084 16.80 4.31
TPU v6e Trillium (8 chip q8 35.2G 1257 21.60 4.77
8× NVIDIA H200 q8 35.2G 3683 28.80 2.17
Apple M3 Ultra 512 GB q8 35.2G 90 - -
Apple M4 Max 128 GB q8 35.2G 60 - -
Apple M4 Pro 48 GB q8 35.2G 30 - -
CPU only (64 GB DDR5) q8 35.2G 7 - - slow
WILL NOT RUN
NVIDIA L4 short by 160 MB — weights fit, but KV at 32,768 ctx x1 does not
NVIDIA RTX 4090 short by 160 MB — weights fit, but KV at 32,768 ctx x1 does not
$/Mtok assumes the machine is busy at the requested concurrency;
a box at 10% utilisation costs about ten times this per token.
Throughput figures are roofline estimates, not measurements.
# recorded 2026-11-03 on M4 Max · 128 GB · onpar 1.5.2

The WILL NOT RUN section keeps the near misses. A machine short by 160 MB is a config change away, not a different purchase.

$ onpar models
id params active ctx license
------------------------------------------------------------------
llama-3.1-8b 8.03B - 131,072 Llama 3.1 !
phi-4-14b 14.7B - 16,384 MIT OK
mistral-small-24b 23.6B - 32,768 Apache-2.0 OK
gemma-3-27b 27.4B - 131,072 Gemma !
qwen3-30b-a3b 30.5B 3.3B 131,072 Apache-2.0 OK
qwen3-32b 32.8B - 131,072 Apache-2.0 OK
llama-3.3-70b 70.6B - 131,072 Llama 3.3 !
qwen3-235b-a22b 235B 22B 131,072 Apache-2.0 OK
glm-5.2 355B 32B 1,000,000 MIT OK
minimax-m3 456B 46B 1,000,000 MIT OK
deepseek-v3 671B 37B 131,072 MIT OK
kimi-k2.7-code 1000B 32B 262,144 Modified MIT !
deepseek-v4-pro 1600B 45B 1,040,000 MIT OK
kimi-k3 2800B 50B 1,000,000 Modified MIT !
# recorded 2026-11-03 on M4 Max · 128 GB · onpar 1.5.2

onpar catalog <model-id> prints one entry in full, including the fields the KV arithmetic reads.

  • --context 32k and --concurrency 8 set the workload. The defaults are 32k and 1, and one request at a time is rarely what you serve.
  • --explain MODEL_ID prints the arithmetic for one model.
  • --json emits the same answer for a script, including the basis of every throughput estimate.
  • --quiet hides the NOT FEASIBLE section.

Next: your first proof, in ten minutes.