Lurker News
Hi HN,

I built a specialized inference engine for running 4-bit Gemma 4 26B-A4B-IT on any M-series Mac using about 2 GB of RAM. It is called TurboFieldfare and is written in Swift and Metal.
I have always adored on-device AI. It feels like magic that you can run a powerful NN on your Mac or iPhone. So I wanted to push the limits a bit and run a model whose weights don’t fit in memory.
The model’s 4-bit quantized weights occupy roughly 14 GB, which makes running it with conventional inference tools almost impossible on an 8 GB or even 16 GB Mac once the OS, applications, and KV cache are included.
The trick is to keep the shared part of the model and the KV cache in RAM, then stream only the routed experts needed for each token from SSD. An SSD is way slower than RAM, so the runtime uses a small expert cache and bounded parallel `pread`. While those reads are in flight, the GPU runs the shared part of the layer.
I ran more than 100 experiments. Most didn’t work. A few got me here. The experiments are described in the GitHub repo.
It currently generates 5–6 tok/s on an 8 GB M2 MacBook Air and 31–35 tok/s on an M5 MacBook Pro.
I also added an experimental OpenAI-compatible local server. It supports streaming and tool calls, and reuses one prompt prefix from the KV cache.
Try it! The Mac app is easy to install. On the first run, it will download 15 GB of weights from Hugging Face. The model is surprisingly capable.
I would love any kind of feedback!

Comments (342) 81 threads

Earlier comments
rob3131 reply#
Could you do this for the new DeepSeek please?
gitpusher42#
I think there is a limit based on MoE number of active parameters and quantisation, bytes count for active experts. But I believe we will see more project like this for different models.
zkmon1 reply#
Please find a way to run Kimi K-3 on a 16 GB mac.
AussieWog931 reply#
Apparently Kimi K3 has 104B parameters active at a time. So at 4 bits you'd need 52GB just to hold the active params.

That said, in theory this same technique should be able to run it on a 64GB Macbook, probably at <1 tps.

zozbot234#
Only the sparse experts are 4-bit in native precision, and those take up ~25GB of active params. The dense parameters' native footprint is ~115GB. So in order to infer that natively on a 16GB machine you'd need to reload around ~135GB from disk at every token, which will take around 20.5 seconds at maximum 6.6 GB/s reading speed. This gives you a maximum theoretical performance of 176 tok/hr or 4224 tok/day when inferring at native precision. (Batching would be highly effective in aggregate since the bulk of what you're reloading is dense parameters, but your speed for any single session would still go down somewhat.) Of course all bets are off if you quantize the model highly; people are finding ways of fitting the whole thing in less than 600GB using extreme Q1 quants.

Mind you, the outlook for a 64GB RAM machine isn't that different. You'd get a faster SSD (around 2.2x performance) and be able to cache more of your dense params. So your performance would probably be around 4x compared to the 16GB case.

sifarhub_com#
it looks good!!! now what I feel is showing map is fine but why to have confusing things around like rivers garden etc .It would be great if it can be kept minimum and simple so highlight would be food place and roads. also if possible try to integrate local delivery partner with transparent price of delivery charges. so user should not have to open multiple apps to see where is what price. I tried to login with email but it never reached to my mail the magic link.
febed1 reply#
Can the same be done with qwen3.6-35b-a3b?
gitpusher421 reply#
Yeah, the same ideas should work for qwen. You can try porting this engine to use Owen.

Owen 3.6-35b-a3b was my initial idea, but I switched to Gemma because of its simpler architecture and kernels

febed1 reply#
Curious if the same idea could work with gpt-oss-120b? So one could run at least slowly on a Mac
gitpusher42#
Yeah, gpt-oss-120b is also MoE, so the same ssd-streaming and caching ideas should work. Feel free to fork and try implementing it!

Load more comments