Local AI Bench

Measurement methodology

The unit of comparison is a model artifact, on one device, under one runtime and test configuration.

The test rig

The first device is a Mac Studio with M4 Max, 40 GPU cores and 64 GB of unified memory. Each record carries its observed OS, runtime version and artifact identity. View this device.

Test protocol

The standard matrix requests prompts of 512, 4,096 and 16,384 tokens followed by 128 output tokens in one sequence. Shorter prompts use an 8,192-token window and the longest prompt uses a 32,768-token window where the backend exposes that control. Inspect each record for the effective test settings.

The runner discards warm-up, records three timed repetitions and spaces measured trials with a cooldown. Prompt throughput is reported separately from decode throughput. Failed allocations retain their outcome. Backend-specific definitions and memory measurement methods appear in each raw record.

Backend instruments

Unavailable fields are null. Time to first token requires an observed first-token event. Average power requires an enabled sampler. A zero would describe a measurement and is never used as a missing value.

Memory estimates

Weight memory in decimal GB equals billions of total parameters multiplied by effective bits per weight and divided by eight. The generic estimates use representative encoding densities, which vary with group size and mixed-precision tensors. For example, Q4_K_M uses approximately 4.85 bits per weight here.

For a conventional FP16 cache, multiply twice the layer count by KV-head count, head dimension, context length and two bytes. Divide by one billion. Where published metadata identifies sliding layers, the calculator caps those layers at their sliding window. Hybrid models use their conventional attention layers; unmodeled recurrent state and multimodal components can change actual allocations.

The calculator adds 10% of weights plus cache and a fixed 0.75 GB runtime allowance. Full-GPU fit on Mac uses a 65–75% working budget. The actual Metal recommendation depends on hardware, system load and any changes to iogpu.wired_limit_mb. Apple Metal working-set guidance.

Speed estimates

The starting throughput is rated memory bandwidth divided by active weight bytes per output token. We fit an efficiency coefficient through the origin using at least three distinct model–quantization observations from the same device, backend, architecture class and prompt conditions. The displayed range covers their observed multiplicative residuals. This empirical range is not a statistical confidence interval.

When evidence is too sparse, the calculator shows “Awaiting calibration.” A measured run overrides estimates only when model, device, runtime, quantization, prompt length, allocated context, generated tokens and sequence batch match. The newest matching export supplies the runtime version and date.

Reproduce a run

python bench.py --models models.yaml --backends llamacpp,mlx,ollama --resume
python export.py

Follow the project README for dependencies and artifact setup. Compare hashes and runtime versions before comparing results. Download the benchmark JSON.

Frequently asked questions

How many repetitions make a measurement?

The runner requests one warm-up and three measured repetitions per configuration. The record includes sample counts, mean throughput and sample standard deviation.

What does an out-of-memory record mean?

The workload returned a memory-related failure when attempted. A calculated over-budget condition is labeled Estimated instead.

Can I use speed from one backend for another?

Each calibration group is specific to the hardware and backend. The calculator requires comparable observations before displaying an estimated range.