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
y421 reply#
Dont want to crash the party here, but I am still sceptic about all those on-premise-llm-approaches.

I think we strongly need something like that (shameless plug, I tried to build something around bitNet for the same reason: https://github.com/nickyreinert/bitNetRTR).
But at the end, all aproaches I saw, however genius they are: the actual results are always a mess. It's a better chat buddy, nothing else. It's e.g. far away from an decent coding assistants. I fine tuned Gemma with domain specific knowledge. Running it on a 16GB VRM GForce. Even then it's okai'sh but far way from a mind blowing experience. I ran some of the promised open source model on my 36GB MBPro M3, in Pi, Hermes, Continue. Can't compare the results to what Claude or Codex are offering.
You need at least something that's far away from consumer hardware, like those 7k'ish GForce machines with 96GB VRAM to get an idea of a good competitive model.
But... please, proof me wrong! =)

TheRealPomax#
This is an odd comment: the project is right there for you to use, so just try it and see if it holds up to the claims? Then you can comment about the fact that it either doesn't hold up, with numbers to back that up, or on how awesome it is because it works =)
sudhirkhanger2 replies#
Is it possible to run Gemma or similar models on Raspberry Pi.
piyh#
Gemma E2B QAT will run on a 4 gig RAM pi.
gitpusher42#
Yeah, must be possible. Not fast, but possible if you have enough ram. I think you can search online for projects, I think I saw something related
KellyCriterion1 reply#
This project will land you a job at either Apple or Google!
gitpusher42#
Uh, maybe, who knows. I am pretty bad solving leetcode, btw
n4pw01f1 reply#
Are you running bare metal or docker? I had to go down to 2 bit on Gemma4 E2B model to run on 8gb on a Jetson

Quality and idempotency is great but it’s still not exactly fast… fast enough and works offline
Is this something that you can get running on Debian?

gitpusher42#
It is Apple platform only implementation because of Metal (and Swift). Other platforms would require CUDA or Vulkan and a complete rework

Load more comments