Reclaimed Node logoRECLAIMED NODE
← Back to Blog Local AI

DeepSeek V4.1 Flash on a Mac Studio with TensorFold: 2 to 3x llama.cpp's Speed

Nov 12, 2026 · Reclaimed Node · 10 min read

The short version

Same Mac Studio M5 Ultra, same DeepSeek V4.1 Flash, a different engine. In DeepSeek V4.1 Flash on a Mac Studio: DSpark at 8 Users and a One-Line llama.cpp Fix the Mac ran llama.cpp and wrote 41 to 43 tokens/sec for one user. With a TensorFold build made for this model, the same Mac writes 69 to 72 tokens/sec, reads prompts at about 1,650 to 1,730 tokens/sec instead of 550 to 580, and puts out 2 to 2.5 times as many tokens in total when several users share it.

That roughly halves the gap to our four CMP 170HX cards. One user is now 1.7x slower than the CMP box instead of 3x, and with 16K prompts and 8 users the Mac reaches 30 tokens/sec against the CMP box's 36. Tool calls, JSON-schema replies and image input all worked on the first try.

Credit where it is due

This setup is not ours. TensorFold is Ash Hart's inference engine; the DeepSeek V4.1 Metal support is a fork by BobClawblaw (deepseek-v41-main), with a one-Mac recipe and a converted checkpoint. We followed the recipe as written and only changed the port, the API key and two settings, listed below. The fork is not part of upstream TensorFold yet.

Setup

Mac, llama.cppMac, TensorFold4x CMP 170HX
Enginellama-server (Unsloth's build b12246 plus a one-line Metal fix)TensorFold fork, commit 72a552ed (native Metal engine)vLLM 0.32.1rc1, tensor parallel 4
Model buildUD-Q2_K_XL (2-bit GGUF)2-bit experts, 3-bit in layers 10 to 29, 4-bit block projections, 8-bit head (418 GB on disk)Hybrid EXL3 + FP8
Engram tablesSSDSSD (189 GiB, memory-mapped)System RAM
Requests at once84 (the engine's limit for this model)8
Context262,144 tokens, shared1,048,576 tokens, shared262,144 tokens per request
Speculative decodingDSpark, 5 draft tokensDSpark head, draft depth chosen by the engineDSpark, up to 7 draft tokens
Memory in useabout 200 GiBabout 202 GiB4 x 32 GB cards plus RAM

Test settings were the same for every setup: LLM-Super-Bench from a second Mac on the network, thinking off, temperature 0, replies capped at 512 tokens, prompts tagged so no cache could help. Prompt sizes were short (about 40 tokens), 4K and 16K, with 1, 2, 4 and 8 users and 3 runs each: 36 races, none failed. The CMP numbers come from DeepSeek V4.1 Flash Head to Head: 4x CMP 170HX vs Mac Studio M5 Ultra.

How we set it up

1. What the Mac needs

Full Xcode with its Metal toolchain (the Command Line Tools alone are not enough), Zig 0.17.0, Python 3.11 or newer, cmake and the Hugging Face hf tool. The checkpoint is 418 GB, so plan for about 440 GB free. Installing the Metal toolchain is one command once Xcode is in place:

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -downloadComponent MetalToolchain

2. Get the recipe, the engine and the weights

git clone https://github.com/BobClawblaw/deepseek-v41-flash-mlx-m5-ultra
git clone -b deepseek-v41-main https://github.com/BobClawblaw/TensorFold ~/github/TensorFold
hf download BobClawblaw/DeepSeek-V4.1-Flash-1017-TensorFold-e2e3-p4-h8 \
    --local-dir ~/models/DeepSeek-V4.1-Flash-1017-TF-mix23-d8b4

3. This Mac's settings

The recipe reads local.toml for anything that differs from its defaults. Ours serves the network on the port our benchmark already used, sets the same API key, turns thinking off by default for the benchmark and opens the model's full million-token window:

[engine]
zig = "~/.local/zig-0.17.0/zig"
developer_dir = "/Applications/Xcode.app/Contents/Developer"

[local]
host = "0.0.0.0"
port = 8001

[serve]
api_key = "..."
parallel = 4
context = 1048576
thinking = false

4. Build, start and check

python3 -m mac up builds the pinned engine once and starts the server; it refuses to start if free memory is short of the weights plus a 6 GiB margin. Qwen had to be stopped first: two models of this size do not fit in 256 GB together. Before benchmarking we sent four checks:

CheckResult
Plain chatCorrect, 0.1 s once warm (3.9 s for the very first request, which reads the Engram tables from the SSD)
Tool callget_weather with {"city": "Kansas City"}
JSON schemaA valid reply that fit the schema: first iPhone, 2007
ImageA solid red test image named correctly in 0.3 s
8 requests at onceAll 8 finished; the server held 202 GiB throughout

One user

Bar chart: one-user speed. Mac llama.cpp 43, 42, 41; Mac TensorFold 69, 69, 72; 4x CMP 170HX 120, 128, 123 tokens per second for short, 4K and 16K prompts

TensorFold writes 1.6 to 1.75 times as fast as llama.cpp on the same Mac and holds that speed as prompts grow, which matches the recipe's own figures (70.7 tokens/sec on prose). The CMP box is still 1.7 to 1.8 times faster for one user.

Reading prompts and the first word

Bar chart: prompt reading speed. Mac llama.cpp 577 and 554; Mac TensorFold 1,655 and 1,730; 4x CMP 170HX 3,579 and 3,785 tokens per second for 4K and 16K prompts

Prompt reading moved the most. The recipe runs the prompt's expert layers as int8 on the M5's GPU tensor units, about twice the speed of the plain path, and reads prompts in chunks of up to 3,968 tokens when one user has the Mac to itself. The result is about 3 times llama.cpp's rate, and the CMP box's lead shrinks from 6 to 7 times to about 2.2 times.

Two line charts, log scale: median seconds to the first word by users at once. With 4K prompts, llama.cpp 6.2 to 37 seconds, TensorFold 2.2 to 21, CMP 1.0 to 11. With 16K prompts, llama.cpp 26 to 133 seconds, TensorFold 8.4 to 76, CMP 3.8 to 43

Faster reading shows up directly as less waiting: a single 16K prompt starts answering in 8.4 seconds instead of 26, and with 8 users each sending 16K, the median wait drops from 133 seconds to 76.

Several users at once

Three line charts of total tokens per second by users at once. Short prompts: TensorFold 69 to 95, llama.cpp 43 to 55, CMP 120 to 294. 4K: TensorFold 69 to 59, llama.cpp 42 to 29, CMP 128 to 81. 16K: TensorFold 72 to 30, llama.cpp 41 to 12, CMP 123 to 36
Total tokens/secMac, llama.cppMac, TensorFold4x CMP 170HX
Short prompts, 4 users4695226
Short prompts, 8 users5595294
4K prompts, 4 users315880
4K prompts, 8 users295981
16K prompts, 4 users133242
16K prompts, 8 users123036

With short prompts the CMP box still runs away, to 294 tokens/sec at 8 users against the Mac's 95. Once prompts get longer, every machine spends most of its time reading them, and that is where the Mac's faster reading pays off: at 16K and 8 users it is within 20% of the CMP box.

Dumbbell chart: the CMP box's result divided by the Mac's. One user at 16K: 3.0x with llama.cpp, 1.7x with TensorFold. Prompt reading at 16K: 6.8x to 2.2x. Total with short prompts at 8 users: 5.4x to 3.1x. Total with 4K prompts at 8 users: 2.8x to 1.4x. Total with 16K prompts at 8 users: 3.1x to 1.2x

Why 8 sessions did not help

We also reran the 4 and 8 user races with the server set to 8 sessions and the full million-token window. The numbers came back within run-to-run noise of the first run:

Total tokens/sec (first word)Set to 4 sessionsSet to 8 sessions
Short prompts, 8 users95 (2.0 s)95 (2.2 s)
4K prompts, 8 users59 (21.5 s)62 (20.4 s)
16K prompts, 8 users30 (75.7 s)30 (72.1 s)

Reading the engine's source explained it: the DeepSeek host clamps sessions to four (@min(o.lanes, 4) in native/deepseek_v41.zig), so requests five to eight wait for a free session whatever the setting says. It would not have mattered much anyway. All users share one prompt reader, and eight 16K prompts are about 116,000 tokens, roughly 68 seconds of reading at 1,700 tokens/sec, which is most of the 72 to 76 second wait we measured. The million-token window cost nothing measurable: the server held 202 GiB either way.

Where this sits among our Mac results

DeepSeek, llama.cppDeepSeek, TensorFoldQwen3.8-Flash-Next, llama.cpp
Parameters used per tokenabout 16Babout 16Babout 6B
One user (tok/s)41 to 4369 to 7283 to 100
Prompt reading (tok/s)about 560about 1,700about 1,950
Total, short prompts, 4 users4695164
Total, 16K prompts, 8 users123027

This is the best DeepSeek result we have had on a Mac, but not the fastest Mac result overall. Qwen3.8-Flash-Next on a Mac Studio M5 Ultra is still quicker for one user and with short prompts, because it does less than half the work per token. DeepSeek on TensorFold pulls even with long prompts and several users, and it is the larger model. The fastest machine we have tested is still the CMP box.

Could it go faster?

We read through the fork's DeepSeek code for settings left on the table. Nothing is a quick win; these are the candidates:

What this shows, and what it does not

Next

Related: DeepSeek V4.1 Flash on a Mac Studio: DSpark at 8 Users and a One-Line llama.cpp Fix · DeepSeek V4.1 Flash Head to Head: 4x CMP 170HX vs Mac Studio M5 Ultra · Qwen3.8-Flash-Next on a Mac Studio M5 Ultra · Race Your Local AI Machines and Trust the Numbers: LLM-Super-Bench

Building Something Like This?

Tell us what you are trying to run — local models, passthrough labs, bulk storage — and we will tell you honestly what it takes and what we have on the bench.

Get Sourcing Help
More Posts Shop Inventory