Skip to content

Instantly share code, notes, and snippets.

View zachrattner's full-sized avatar

Zach Rattner zachrattner

View GitHub Profile
@zachrattner
zachrattner / analyze-thermal.py
Created September 6, 2026 06:02
Sustained MLX throughput on a fanless M5 MacBook Air: 6 cells, 487 runs, battery vs mains
#!/usr/bin/env python3
"""
Turn thermal cells into the two things the article needs: retention, and the crossover.
Retention answers "does this machine hold its rate?". The crossover answers the
question a reader actually has, which is "is this machine faster for *my* work?".
The crossover
-------------
Total time for one request is prompt tokens over prefill rate, plus generated
@zachrattner
zachrattner / README.md
Created September 2, 2026 12:03
Rapid-MLX vs vanilla MLX vs Ollama on an M1 Ultra: 54 controlled runs, and the prompt-cache artifact reproducing on a second engine

Rapid-MLX vs MLX vs Ollama on Apple silicon

A three-way follow-up to the MLX vs Ollama harness, run because someone asked a good question in a LinkedIn comment: was I using Rapid-MLX, rather than vanilla MLX?

Rapid-MLX is an OpenAI-compatible server that wraps the same Apple MLX stack mlx_lm exposes as a library. Its README headline claims "4.2x faster than Ollama". Nobody had published it against the thing it wraps, on an invalidated cache, so that is what this measures.

@zachrattner
zachrattner / README.md
Last active September 1, 2026 04:41
MLX vs Ollama on Apple silicon: a benchmark harness that controls for weights, tokenization, quantization and thermal drift

MLX vs Ollama on Apple silicon

A benchmark harness that compares Apple's MLX against Ollama on the same model, the same weights, and the same input tokens.

It exists because most published Apple silicon LLM comparisons are not comparable. They quantize differently on each side, blend prompt processing together with token generation into one number, and time the whole HTTP round trip. The measurement is easy. The methodology is the hard part.

@zachrattner
zachrattner / motion.html
Created February 4, 2022 19:31
Device Motion Analysis
<!doctype html>
<html lang="en-us">
<head>
<title>Yembo Sensor Testing</title>
<!-- Make page show up ok on mobile devices -->
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" name="viewport"/>