HeadlinesBriefing favicon HeadlinesBriefing.com

Gemma 4 26B Inference on Mac with 2GB RAM

Hacker News •
×

A new project, Turbo Fieldfare, enables running the Gemma 4 26B-A4B-IT model on any M-series MacBook with approximately 2 GB of RAM. Developed in Swift and Metal, it addresses the challenge of fitting the model's ~14 GB of 4-bit quantized weights into limited memory, which is often impossible on Macs with 8 GB or 16 GB RAM due to OS and application usage.

The core innovation involves keeping the shared model components and KV cache in RAM while streaming only the necessary 'routed experts' from SSD for each token. This technique, combined with a small expert cache and bounded parallel reads, allows the GPU to process the shared layers while data is being fetched from slower storage.

Turbo Fieldfare achieves 5–6 tokens/s on an 8 GB M2 MacBook Air and 31–35 tokens/s on an M5 Pro. It also includes an experimental OpenAI-compatible local server supporting streaming and tool calls. The project provides a native Mac app, a CLI, and a local server, with an easy installation process that downloads ~15 GB of weights from Hugging Face on first run.