Running Laguna S 2.1 locally on Apple Silicon: 52 tok/s with 38.5 GB peak memory The mlx-community/Laguna-S-2.1-oQ2e quantized model running in-process through mlx-vlm on a 128 GB Apple M5 Max achieved a perfect overall score of 1.000 across six tasks, with 40.85 generation tok/s and 37.77 GB peak MLX memory, finishing the suite in 87.38 seconds. The benchmark, sponsored by DWS LLC and published by developer tanishq-dubey, found oQ2e passed all 38 hidden assertions and all long-context retrieval tests through 256K tokens, outperforming the official NVFP4 MLX build and other tested paths. This repository contains a reproducible local harness for comparing Laguna S 2.1 MLX quantizations on Apple Silicon. Each run records the raw output and task score along with token and prefill throughput, peak MLX memory, load time, package versions, model revision, and machine metadata. This work was sponsored by DWS LLC https://dws.rip . On the M5 Max used for these tests, the smallest quant, mlx-community/Laguna-S-2.1-oQ2e , running in-process through mlx-vlm was the fastest option. It passed all six tasks and finished the suite faster than the tested llama.cpp, DFlash, official NVFP4 MLX, and serial oMLX paths. The measurements are in BENCHMARK RESULTS.md . These results were measured on a 128 GB Apple M5 Max using macOS 27.0, Python 3.13.12, MLX 0.32.0, and mlx-vlm 0.6.6. The score combines three generation tasks and three agentic coding tasks. Throughput is weighted across the generation tasks. The left panel reproduces the Terminal-Bench 2.1 figures in Poolside's model card https://huggingface.co/poolside/Laguna-S-2.1 benchmark-results . The right panel comes from this repository's committed CSV. They use separate scales and are not the same evaluation. Regenerate the SVG with: uv run --frozen laguna-bench chart | Quant | Overall score | Generation | Agentic | Generation tok/s | Peak MLX GB | Suite time | |---|---|---|---|---|---|---| mlx-community/Laguna-S-2.1-oQ2e | 1.000 | 1.000 | 1.000 | 40.85 | 37.77 | 87.38s | mlx-community/Laguna-S-2.1-oQ3e | 0.625 | 0.417 | 0.833 | 48.58 | 50.69 | 84.79s | poolside/Laguna-S-2.1-NVFP4-mlx | 0.875 | 0.750 | 1.000 | 7.25 | 73.47 | 301.77s | The oQ2e conversion was the clear default for this machine. It passed all 38 hidden assertions while using about 38 GB of peak MLX memory. oQ3e decoded faster in the controlled profile, but its exact-format and implementation errors lowered its task score. The official NVFP4 MLX build was functional but much slower in this runtime. Long-context retrieval also passed at every tested size through 256K tokens on oQ2e: | Prompt tokens | Prefill tok/s | Decode tok/s | Peak MLX GB | Retrieval | |---|---|---|---|---| | 1,016 | 1411.42 | 60.86 | 37.23 | pass | | 16,376 | 1613.07 | 52.48 | 38.46 | pass | | 65,528 | 1088.75 | 32.03 | 41.19 | pass | | 131,064 | 771.80 | 23.48 | 45.09 | pass | | 262,136 | 566.31 | 12.16 | 52.87 | pass | For a local coding setup, use oQ2e through in-process mlx-vlm with temperature 0, top-p 1, the default unquantized KV cache, and a prefill step of 2048. Staying at or below 64K gives a much better latency balance. The 128K and 256K cases fit and passed retrieval, but decode speed fell sharply. The full benchmark report /tanishq-dubey/macos-laguna-s2.1/blob/main/BENCHMARK RESULTS.md includes the standardized quant profile, sampling search, KV cache and prefill search, engine bake-off, revisions, and compatibility failures. The machine-readable source is the combined CSV /tanishq-dubey/macos-laguna-s2.1/blob/main/results/laguna s21 full results.csv . The helper creates the environment and uses the fastest quant from our tests by default: git clone https://github.com/tanishq-dubey/macos-laguna-s2.1.git laguna-s21-bench cd laguna-s21-bench scripts/laguna.sh download scripts/laguna.sh prompt 'Write a Python LRU cache with tests' Start an interactive chat or a local OpenAI-compatible server: scripts/laguna.sh chat scripts/laguna.sh server The server binds to 127.0.0.1:8080 . Set LAGUNA MODEL , LAGUNA HOST , or LAGUNA PORT to change the defaults. For example: LAGUNA MODEL=mlx-community/Laguna-S-2.1-oQ3e scripts/laguna.sh server The suite has six fixed tasks: | Kind | Tier | What it measures | |---|---|---| | generation | small | exact structured-output instruction following | | generation | medium | single-function Python synthesis against hidden tests | | generation | large | larger algorithm/module synthesis against hidden tests | | agentic | small | inspect files, derive an answer, and write an artifact | | agentic | medium | diagnose and repair a tested Python bug | | agentic | large | implement a multi-file feature and satisfy tests | Generation uses greedy decoding temperature=0 with a fixed MLX seed. Each agent task starts in a fresh temporary workspace. The agent has access only to an allowlist of tools, and the harness records every turn. Task prompts and tests are versioned in source. Here, "deterministic" means that the decoding settings and fixtures are repeatable. Metal kernels and new model or runtime revisions can still change the results. --agent-prompt-cache enables experimental MLX KV reuse. It improves throughput within each turn, but mlx-vlm 0.6.6 changed a greedy Laguna trajectory during testing because Laguna mixes global caches with rotating sliding-window caches. The option stays off by default until cold and cached runs produce exactly the same output. uv sync --extra dev --python 3.13 --locked Laguna support currently comes from mlx-vlm , even though these are text-only models. List tasks and the curated quant ladder: uv run --frozen laguna-bench list Run the complete suite on the smallest quant: uv run --frozen laguna-bench run \ --model mlx-community/Laguna-S-2.1-oQ2e \ --output results Run a cheap smoke test first: uv run --frozen laguna-bench run \ --model mlx-community/Laguna-S-2.1-oQ2e \ --task generation-small \ --output results Every run creates results/