TurboFieldfare: Running Gemma 4 26B on 8GB Macs
The technical core of this approach is a specialized streaming mechanism written in Swift and Metal. Instead of the standard "load everything" approach, the engine keeps the shared model components and the KV cache in RAM, while streaming only the specific routed experts required for each token directly from the SSD. To mitigate the massive speed difference between SSDs and RAM, the runtime implements a small expert cache and utilizes bounded parallel pread. This allows the GPU to process the shared part of the layer while the necessary expert weights are being fetched in the background.
Performance varies significantly based on the hardware's SSD and memory bandwidth, but the results are functional for local use:
- M2 MacBook Air (8GB): 5–6 tokens per second
- M5 MacBook Pro: 31–35 tokens per second
For those looking for a practical tutorial on deployment, the installation is straightforward via the Mac app. Upon the first launch, the system pulls the 15 GB of weights from Hugging Face. Because it's an LLM agent-capable model, the developer also included an experimental OpenAI-compatible local server. This addition is particularly useful for anyone wanting to integrate this into an existing AI workflow, as it supports streaming and tool calls, and optimizes performance by reusing prompt prefixes from the KV cache.
Technical Deep Dive: The Streaming Logic
The efficiency of this setup relies on how it handles the Mixture of Experts (MoE) architecture. In a standard deployment, the entire expert pool resides in VRAM. In this real-world implementation, the engine predicts which experts are needed and fetches them just-in-time.
If you are setting this up from scratch, keep in mind:
1. The initial download is heavy (15 GB).
2. SSD speed is the primary bottleneck for token generation on lower-end M-series chips.
3. The OpenAI-compatible server allows you to point existing LLM clients to localhost to interact with the 26B model.
This is a great example of how prompt engineering and efficient memory management can make massive models accessible on consumer hardware without needing 64GB of Unified Memory.
# Example of how the local server might be interacted with via curl
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gemma-4-26b",
"messages": [{"role": "user", "content": "Explain quantum entanglement"}]
}'