okAI-helper

← okAI-helper

// Benchmarks

Measured on a 16 GB Mac.

Speed of okAI-helper's engines (llama.cpp, MLX) on the Mac mini M4, 16 GB, the target machine. Every figure is in the measurement log with how it was taken.

21.7 tokens/sMinistral 3 8B on MLX, 4 bit
6.66 tokens/sQwen3-30B-A3B (18.5 GB) streamed from the external SSD on a 16 GB Mac
+1.5 msthe gateway to the first token
0.97 GB/sread from the external USB SSD

Models that fit into memory: answer speed

Generation of 128 tokens after a prompt of 512, three runs. The two Ministral files are quantized differently, so the engines compare only roughly.

tokens/s, 0 to 50

Table
ModelEnginePrompt t/sGeneration t/s
Ministral 3 8B, Q4_K_Mllama.cpp, Metal211.919.7
Ministral 3 8B, MLX 4 bitmlx-lm22021.7
Qwen3-4B, MLX 4 bitmlx-lm434.241.1

Source: docs/MEASUREMENTS.md, Spike 2026-11-05: models that fit into memory

Bigger than memory: streamed from the SSD on the CPU

The first spike: llama-bench, prompt 32, 8 tokens generated, CPU only (never Metal: a model bigger than memory on the GPU wired all memory and froze the Mac), with llama.cpp's weight repacking still on (see the next chart). A dense model gave no token within 20 minutes.

tokens/s, 0 to 2

Table
ModelDiskPrompt t/sGeneration t/s
Qwen3-30B-A3B Q4_K_M, MoEexternal SSD3.021.24
Qwen3-30B-A3B Q4_K_M, MoEinternal SSD (partly cached)3.121.5
Qwen3-32B Q4_K_M, denseexternal SSD0.32–
Qwen3-32B Q4_K_M, denseinternal SSD (partly cached)0.28–

Source: docs/MEASUREMENTS.md, Spike 2026-11-05: models bigger than memory (mmap streaming)

Streamed from the SSD: without weight repacking

llama.cpp copies the weights into memory of its own by default; for a model bigger than memory macOS then swaps them to the internal SSD (writing about 210 MB/s) and never reads the model's drive. Without repacking the weights stay mapped and are read from their own drive.

tokens/s, 0 to 10

Table
SettingTokens/sLoad sSwap written MB/sFile read MB/s
repacking on (llama.cpp default)2.891092130
--no-repack (okAI-helper)6.66300205

Source: docs/MEASUREMENTS.md, Streaming a model bigger than memory: llama.cpp's weight repacking, 2026-11-06

The gateway: time to the first token

Ministral 3 8B Q4_K_M, 128 tokens, temperature 0, five runs in each of two rounds. Throughput stays the same (19.35 / 19.3 tokens/s).

ms, 0 to 70

Table
PathFirst token msTokens/s
direct to llama-server5919.35
through the gateway60.4519.3

Source: docs/MEASUREMENTS.md, Spike 2026-11-05: gateway overhead

Speculative decoding with n-grams: all six tasks

Ministral 3 8B Q4_K_M, llama.cpp b12131, temperature 0, six different tasks once per mode. Not built in: no reliable gain, and ngram-cache gave other answers in four of six tasks.

tokens/s, 0 to 25

Table
Tasknonengram-modngram-map-kngram-cache
Java refactor1818 =17.4 =21.9 ≠
Python, new19.218.4 =18 =18.3 ≠
SQL change19.418.7 =18 =24.8 =
JSON extract19.318.6 =18 =18.5 =
Summary (German)19.419.1 =18 =21.1 ≠
Free text (German)19.318.3 =18 =18 ≠

= the same answer as without, ≠ another answer.

Source: docs/MEASUREMENTS.md, Speculative decoding without a draft model (n-gram), 2026-11-05