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
- Ollama. The API reports token counts and timing in nanoseconds. Divide each count by its duration in seconds. Load duration stays separate from decode throughput.
- llama.cpp. llama-bench reports prompt and generation trials. Prompt depth and allocation behavior depend on the executable and test flags, so use the recorded workload to compare rows.
- MLX. mlx-lm supplies generation and prompt timing. MLX allocation counters measure backend memory and differ from process resident memory.
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.pyFollow the project README for dependencies and artifact setup. Compare hashes and runtime versions before comparing results. Download the benchmark JSON.