Skip to content

cli: tensorfold models lists what fits this machine, with a rough one-stream speed - #3483

Merged
ashhart merged 7 commits into
mainfrom
lead/models-fit
Nov 19, 2026
Merged

ashhart merged 7 commits into
mainfrom
lead/models-fit

Conversation

@ashhart

@ashhart ashhart commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

tensorfold models used to list only the checkpoints already in the Hugging Face cache. Someone new to TensorFold had to read the README's model table, work out which rows their machine could hold, and guess how fast and how good each would be. Now tensorfold models answers that directly.

$ tensorfold models
Apple M5 Max, 40-core GPU, 128 GiB memory: Metal may hold 107.5 GiB, 614 GB/s.

Models that fit this Mac, largest first:
                                                       memory  quality  speed, one stream
  Qwen3.8 Flash Next, MLX 4-bit + MTP                75.3 GiB      92%  ~103 tok/s, est. from M3 Ultra
      tensorfold pull TensorFold/Qwen3.8-Flash-Next-MLX-4bit-MTP
  Nemotron 3.5 Lightning 30B-A3B, oQ8                33.3 GiB        -  speed not measured yet
      tensorfold pull TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ8
  Nemotron 3.5 Lightning 30B-A3B, oQ6                26.2 GiB        -  speed not measured yet
      tensorfold pull TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ6
  LFM2.5-24B-A2B, MLX 8-bit                          25.7 GiB        -  ~120 tok/s, est. from M3 Ultra
      tensorfold pull LiquidAI/LFM2.5-24B-A2B-MLX-8bit@67ab417dd02d0c9545802a726df668620eae049d
  Recursive Flint 40B-A2.5B, MLX INT4                23.4 GiB        -  speed not measured yet
      hf download RecursiveSI/flint-int4 --revision 3b93f9053b530488405ae9fca51d4900d6ce21f0 --local-dir ~/models/flint-int4
  Gemma 4 31B, MLX 4-bit + DFlash                    22.0 GiB        -  ~77 tok/s, est. from M5 Ultra
      tensorfold pull mlx-community/gemma-4-31B-it-4bit@696d436c404745a59f30e4939a658162b0a9e57f && tensorfold pull z-lab/gemma-4-31B-it-DFlash@eabd648301ce28583cc14757912e5e0f84e152e1
  Qwen3.8-27B, MLX 4-bit + DFlash2                   20.5 GiB      88%  64 tok/s, measured on M5 Max
      tensorfold pull TensorFold/Qwen3.8-27B-MLX-4bit && tensorfold pull z-lab/Qwen3.8-27B-DFlash2
  LFM2.5-24B-A2B, MLX 6-bit                          20.2 GiB        -  ~126 tok/s, est. from M3 Ultra
      tensorfold pull LiquidAI/LFM2.5-24B-A2B-MLX-6bit@1deec53eb49571e21cdcbf82fd5839248f07ed88
  Nemotron 3.5 Lightning 30B-A3B, oQ4                19.3 GiB      84%  speed not measured yet
      tensorfold pull TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4
  Nemotron 3.5 Lightning 30B-A3B, MLX 4-bit + MTP    19.3 GiB      84%  263 tok/s, measured on M5 Max
      tensorfold pull TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit
  LFM2.5-24B-A2B, MLX 4-bit                          14.6 GiB      76%  ~136 tok/s, est. from M5 Ultra
      tensorfold pull LiquidAI/LFM2.5-24B-A2B-MLX-4bit@667408d494bde191c2cb9dd4f4549827816b9275
  Qwen3.5-2B, MLX 4-bit                               3.6 GiB      62%  speed not measured yet
      tensorfold pull mlx-community/Qwen3.5-2B-MLX-4bit@93760be4f1f69842a46bc13dbdc0f19e291392a3

Memory is the weights and any drafter the engine keeps, plus a 2 GiB margin; context and caches take more.
Speed is one stream with drafts as shipped: measured on that chip, or estimated from another by memory bandwidth.
Quality is the share of TensorFold Web's 228-item quality suite the checkpoint gets right (greedy, thinking off);
each score's receipt is in docs/receipts/quality-suite, and - is not rated yet.
12 more need more memory, two machines or the other backend: tensorfold models --all

What it does:

  • zig/src/platform/machine.zig reads the machine: chip, memory and GPU core count on a Mac (sysctl, ioreg), and nvidia-smi's first GPU elsewhere. A GB10, or any GPU nvidia-smi reports without its own memory, gets the same share of RAM that macOS gives its GPU by default. The macOS GPU-limit rule and the chip bandwidth table move here from cluster/node.zig, which now points at them. The table gains the M5 family (Apple's published 153, 307, 460/614 and 1,200 GB/s) and the base and Pro chips, and the smaller-GPU M3, M4 and M5 Max configurations get their narrower buses.
  • zig/src/cli/catalog.zig holds the README's chat checkpoints: 24 entries, each with its Hub safetensors size (drafter included), a resident figure where the README documents one (Flash Next 4-bit's 73.3 GiB, Qwen3.6 NVFP4's 20.9 GiB, Flint's 21.4 GiB), the backends and machine count its row names, every one-stream decode speed our docs record with its source, and its quality score with the receipt. Speech, OCR, decisions and checkpoints that need a conversion step (Gemma 4 12B, Step-5-Preview) are left out.
  • The fit uses the engine's own floor, as tensorfold info prints it: resident bytes plus the 2 GiB runtime margin, against the GPU limit. With less than 4 GiB to spare it says there is little room for context. A Mac that could hold it after raising iogpu.wired_limit_mb (keeping 8 GiB for macOS) is told so, and the serve refusal names the value. Flint is marked untested on M1-M4, as its row says.
  • Speed is a measurement on this chip when we have one. Otherwise it is the nearest measurement on the same backend, preferring the same Apple chip generation, scaled by memory bandwidth and shown with ~. Before M5, Gemma 4 31B's drafters don't run, so its estimate scales the plain number. Models with no recorded number say so instead of guessing.
  • Quality is the share of TensorFold Web's quality suite the checkpoint gets right. tools/quality_suite.py runs the suite's 228 items (web/tensorfold_web/quality.py, digest d21a62442423) against a served model, one request at a time, greedy, with thinking off when /v1/models says the off request works, and scores them with the Bench's own rules. Each receipt sits in docs/receipts/quality-suite with every item's verdict. A host test re-reads each receipt and checks its digest, its checkpoint and the passed and graded counts against the catalog. A checkpoint not rated yet shows -.
  • --all adds what needs more memory, two machines or the other backend. --json keeps schema 1's models array unchanged and adds machine and catalog, each entry with its quality object or null. The cached checkpoints still print last.

Quality scores, greedy with thinking off (100 GSM8K problems, 100 MMLU questions, 20 instruction checks, 8 long-context items):

Checkpoint Chip Score GSM8K MMLU Instructions Long context
Qwen3.8 Flash Next, MLX 4-bit + MTP M5 Ultra 209/228 (91.7%) 93 88 20 8
Nemotron 3.5 Super VL 120B-A12B, NVFP4 GB10 207/228 (90.8%) 96 83 20 8
Qwen3.6-35B-A3B, MLX 4-bit + MTP GB10 204/228 (89.5%) 93 83 20 8
Qwen3.8-27B, MLX 4-bit M5 Ultra 201/228 (88.2%) 92 81 20 8
Kolibri-1, block FP8 GB10 199/228 (87.3%) 94 78 20 7
Nemotron 3.5 Lightning 30B-A3B, NVFP4 GB10 196/228 (86.0%) 91 77 20 8
Nemotron 3.5 Lightning 30B-A3B, MLX 4-bit M5 Max 192/228 (84.2%) 88 76 20 8
Nemotron 3.5 Lightning 30B-A3B, oQ4 M5 Ultra 192/228 (84.2%) 93 72 19 8
LFM2.5-24B-A2B, MLX 4-bit M5 Ultra 173/228 (75.9%) 93 58 20 2
Qwen3.5-2B, MLX 4-bit M5 Ultra 142/228 (62.3%) 70 45 20 7
  • Every receipt names the revision it served. Copies on the test boxes were checked against the Hub: their config.json sha256 and total safetensors bytes match the named revision. The 27B copy is snapshot 70ae7fac, whose config and every shard hash equal today's main (22d8d538), so its score is the 27B that tensorfold pull fetches. The Qwen3.6 copy is f84b054c, whose config and five shard hashes equal 81169a9b, the revision the README pins.
  • LFM2.5's 2 of 8 on long context and its 6 cut MMLU replies are not wrong facts. With thinking off it still reasons in the reply and runs past the suite's 48- and 32-token reply lengths. The Bench scores it the same way.
  • One score per checkpoint holds across backends: Lightning MLX 4-bit at d9d758fb passed 192 items on the M5 Max (Metal) and 191 on a GB10 (CUDA). The three items that differ are GSM8K problems where the backends' rounding takes a long greedy calculation down different tokens. Both receipts are committed, and the catalog cites the first.
  • Queued but not run: Bolt 74B-A9B and Gemma 4 31B. The only test box holding them has its GPU taken by another workload, so they show - until their jobs run and the receipts are added.
  • Not rated yet, for want of a copy on our boxes: Flash Next 6-bit, Lightning oQ6 and oQ8, LFM2.5 6-bit and 8-bit, Qwen3.6 NVFP4, both MiniMax-M3.1-Flash windows, Flint and the three GLM-5.3-Flash formats.

Issue: none. This is a CLI listing and a benchmark tool with no inference, kernel or arithmetic change, so it needs no gate.

Checks on 7b2534b, rebased onto main b4f1bf2 (the only conflict was this PR's CHANGELOG line, kept beside main's new ones). The head, 106a4ed, only adds the Qwen3.6 receipt and its catalog line; the CLI tests pass on it too:

Not run: tensorfold models on a GB10 or other CUDA host (host tests cover the nvidia-smi reader with GB10 and RTX 3090 rows), and Windows beyond CI's host suite (zig-windows passed on the previous head).

…-stream speed

`models` now reads the machine (chip, memory, GPU limit and memory bandwidth) and lists the chat checkpoints from README's model table that fit, largest first. Each line gives the memory the engine keeps (resident weights, any drafter and the 2 GiB runtime margin `info` reports) and a one-stream decode speed with drafts as shipped: measured on this chip, or estimated from the nearest measurement on the same backend, scaled by memory bandwidth. Under it is the command that installs it. `--all` adds what needs more memory, two machines or the other backend. `--json` keeps schema 1's cached checkpoints and adds `machine` and `catalog`. The cached checkpoints still print last.

The macOS GPU-limit rule and the chip bandwidth table move from cluster/node.zig to platform/machine.zig, which cluster now calls. The table gains the M5 family and the base and Pro chips, and the smaller-GPU Max configurations get their narrower buses.
--
2.54.0 (Apple Git-157)
--
2.43.0
…b's quality suite

tools/quality_suite.py runs the suite's 228 items (web/tensorfold_web/quality.py, digest d21a62442423) against a served model: one request at a time, greedy, thinking off when /v1/models says the off request works, scored by the Bench's own rules. It writes a receipt with every item's verdict. docs/receipts/quality-suite holds one receipt per checkpoint measured, each with its revision checked against the Hub. The catalog carries the passed and graded counts, and a host test checks each against its receipt. `tensorfold models` prints the share in a quality column, with `-` for checkpoints not rated yet, and `--json` gives each entry's quality object or null.
…s 192

The same revision (d9d758fb) on CUDA and on Metal: three GSM8K items differ where the backends' rounding takes a long greedy calculation down different tokens. The receipts README says the catalog cites one receipt per checkpoint and how close the backends come.
The copy served is revision f84b054c, whose config.json and five safetensors shards hash the same as 81169a9b, the revision the README pins; the catalog cites the receipt.
@ashhart
ashhart merged commit 7b5c1f2 into main Nov 19, 2026
11 checks passed
@ashhart
ashhart deleted the lead/models-fit branch November 19, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant