frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Open-source engine running Gemma 4 26B in 2 GB RAM on any M-series Mac

https://github.com/drumih/turbo-fieldfare
70•gitpusher42•43m ago
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

yakupov_bulat•20m ago
Wow, amazing!

What if there is enough RAM to fully load the model? I assume in that case I shouldn’t use your engine.

0gs•17m ago
you could use mine ... github.com/0gsd/enough (it has other stuff too)
gitpusher42•10m ago
It depends on the use case.

I measured this exact model with a 4k context on the mlx engine. It runs at 75 tok/s on my M5 Mac Pro and using 14 GB of RAM. For my engine the same model uses 2 GB of RAM and produces 31–35 tok/s.

The project is still experimental so performance may vary as it continues to improve. If you want to save around 12 GB of RAM for other tasks and you are ok with 35 tok/s (afaik it is roughly comparable to ChatGPT’s speed for basic responses) my engine may be a good fit.

If you need maximum speed and flexibility just use MLX

addaon•19m ago
> It currently generates 5–6 tok/s on an 8 GB M2 MacBook Air and 31–35 tok/s on an M5 MacBook Pro.

Where does this big a performance spread come from? I wouldn't naïvely expect SSD performance difference to be that big, and I would expect SSD performance to dominate...

afzalive•15m ago
The M5 MBP has 24GB of RAM, more context in RAM perhaps?
wongarsu•13m ago
My suspicion is that this is simply due to the M5 having more memory, and the OS already having most of the file cached. The M2 has more memory pressure and would cache fewer of the SSD reads

If that's true, inference speed would be even lower if you have only 2GB total, including OS caches

GeekyBear•4m ago
The M5 SSD's performance uplift was fairly substantial, even compared to the prior generation.

https://www.tomshardware.com/laptops/macbooks/m5-macbook-pro...

mxmlnkn•16m ago
This sounds really cool. My intuition was that the selected experts might change heavily for each token, resulting in slow SSD loads for each token. This seems to be wrong. Did you create some statistics on how often the experts need to be changed? What is the longest token run without any expert change? What does such a token run look like? In which cases do experts change frequently?
znpy•16m ago
I wonder if i can run this on my MacBook Neo!
gitpusher42•6m ago
I haven't tried it but it should work! You can try it and share your results, it would be really appreciated

I tried it on my wife's M1 MacBook Air 512GB and it gets 4–5 tok/s

Also, it must be easy to adjust for iPhones and iPads in theory

WithinReason•13m ago
Nice job implementing expert caching!
gitpusher42•3m ago
Thank you! Under good conditions it achieves approx a 67% cache hit rate with 16 expert slots
h2aichat•12m ago
Hope you can do it for Windows users also (and small graphics cards). Thanks
gitpusher42•1m ago
Uh, I’m afraid it is Apple only. It is written using Apple’s GPU language, Metal, and heavily relies on the Apples’s shared memory architecture

Windows PCs would require a completely different approach

touwer•5m ago
Cool! Is there any info on this doing harm to the SSD? (Or other parts?)
wtallis•3m ago
Reads don't wear out flash memory to any meaningful extent.
sscarduzio•1m ago
How does this compare to DwarfStar4?

Ask/Tell HN: use the flag button instead of complaining about AI slop articles

1•rglullis•1m ago•0 comments

The Great Lakes' most emblematic fish could be consigned to history books

https://www.theguardian.com/us-news/2026/jul/29/lake-whitefish-great-lakes-invasive-mussels
1•mitchbob•1m ago•0 comments

Pangram Image Detection

https://www.pangram.com/blog/introducing-pangram-image-detection
1•pipluppp•1m ago•0 comments

Ask HN: My domain registrar (Hover) rug-pulled me for $3000

3•shrinks99•2m ago•0 comments

A disturbing thought. A world where the marginal cost of software is free

1•toddh•3m ago•0 comments

Superlogical – Mitchell Hashimoto

https://mitchellh.com/writing/superlogical
2•tambourine_man•3m ago•0 comments

A/B Testing and Analytics Inside Your CMS (In 2026)

https://focusreactive.com/blog/cms-with-built-in-ab-testing-and-analytics/
1•katyadrozd•3m ago•0 comments

For 55

https://makoism.com/55-for-55/
2•speckx•3m ago•0 comments

Show HN: AI LeetCode side panel that gives Socratic hints, not solutions

https://leetcopilot.dev
1•alexwang24•4m ago•0 comments

Show HN: On-prem-deployable voice agent simulation and evals

https://usemarker.ai/blog/hello-world/
1•lorenphillips•5m ago•0 comments

Show HN: Uvr – a uv-style package and environment manager for R, written in Rust

https://github.com/nbafrank/uvr
1•nbafrank•5m ago•1 comments

Show HN: Tokimeter – open-source usage meter for Claude, Codex, Cursor and more

https://github.com/toshipepe/tokimeter
1•toshipepe•6m ago•0 comments

Show HN: Sitrep - AI Copilot For Incidents

https://github.com/dj9889/sitrep
1•davidajackson•6m ago•0 comments

KindaRails2Shell – Critical RCE in Rails via Active Storage

https://ethiack.com/info-hub/research/kindarails2shell-rails-rce-cve-2026-66066
2•tenderlove•6m ago•0 comments

Tallest timber tower reaches full height in Sydney with design by SHoP

https://www.designboom.com/architecture/worlds-tallest-timber-tower-reaches-full-height-sydney-sh...
1•surprisetalk•7m ago•1 comments

Show HN: A new engine to run Kimi K3 on a laptop

2•marcobambini•7m ago•1 comments

Mitchellh starts a new company: Superlogical

https://www.superlogical.com/
4•yan•7m ago•0 comments

Baseload Is a Myth (2024)

https://cleanenergyreview.io/p/baseload-is-a-myth
1•thecopy•8m ago•0 comments

Show HN: Inkspan – one API for the PDF/doc plumbing I kept rebuilding

https://inkspan.dev
1•upword•8m ago•0 comments

Develop Cross-Platform CLI and GUI Tools with Tcl/Tk

https://cgicoffee.com/blog/2026/04/tcl-tk-develop-cross-platform-cli-gui-tools-tutorial-guide
1•birdculture•9m ago•0 comments

K3 on Mac Studio M3 Ultra with 512GB

https://www.reddit.com/r/LocalLLM/comments/1v9iyhe/k3_on_mac_studio_m3_ultra_with_512gb/
1•tito•10m ago•0 comments

FDA panel recommends loosening regulations for some peptides

https://www.cbsnews.com/news/fda-peptides-review-regulations-unapproved-therapies/
1•gmays•11m ago•0 comments

The Great Chinese Oil Mystery

https://www.theatlantic.com/economy/2026/07/china-iran-usa-oil-prices/688086/
1•samizdis•11m ago•0 comments

Show HN: Phixo – AI Phishing Protection for Gmail and Outlook

https://phixo.app/
1•tech_builds•12m ago•0 comments

Shackle: A pre-execution ALLOW/DENY/HITL gate for AI agents (open source)

https://github.com/Fame510/SHACKLE
2•SHACKLE-PRO-•13m ago•0 comments

Show HN: ClaudeFS – Give claude.ai access to a local folder, no local process

https://github.com/vincentping/claudeFS
2•vincentping•13m ago•0 comments

The harness is the capability multiplier

https://www.medley.sh/blog/the-harness-is-the-capability-multiplier
5•akshay_budhkar•14m ago•0 comments

What NPU Tops Doesn't Tell You: How Memory Bounds Local LLM Performance

https://capytoolkit.com/blog/buying-guides/npu-tops-vs-memory-bandwidth-local-llm-ai-pc/
2•CapyToolkit•14m ago•0 comments

DeepsecBench: Evaluating model performance in finding cybersec vulnerabilities

https://vercel.com/blog/deepsecbench-evaluating-model-performance-in-finding-cybersecurity-vulner...
2•smokeeaasd•14m ago•0 comments

We accidentally built an LLVM compiler for Jax

https://iza.ac/posts/2026/07/accidental-llvm-compiler-for-jax/
2•infinitewalk•14m ago•0 comments