Better HN
topnewbestaskshowjobs
Log inSign up

davidetroiani

6 karma · joined Jun 2, 2026 (5mo ago) · 13 submissions

Creator of MoEShift, to let everyone run larger models on memory-constrained Macs.
Submissions

comment 2d ago · link · parent

I have a Mac and I know I can get better performance out of it than today’s AI inference engines do without hardware upgrades.

Usually running a capable model consumes most of my Mac’s unified memory, leaving little room for everything else. That doesn’t work because people like me need to run models while they use their Mac or agents work on their projects.

So in the last months I developed an approach that uses the Mac’s SSD alongside unified memory to run AI models without monopolizing the machine. The technique already existed but I optimized it specifically to my M-series Mac finally reaching usable performance with less than 9GB RAM consumption. That solved my issue finally. The project is called MoEShift, brings optimized inference on Qwen 3.8 Flash Next, Inkling 2 Mini and Qwen 3.6 35B A3B and all the models that inherit the same architecture. It is free and open source with other Apple users sharing their benchmarks.

My latest benchmark is: Inkling 2 Mini on 24GB M5 Pro: 420 tok/s prefill, 18 tok/s generation, 7.7GB used RAM on a 6k prompt.

Would you use local AI more often or for more things than today if it could run in the background without getting in the way of your everyday work?

comment 2w ago · link · parent

Today I benchmarked Qwen 3.8 Flash Next IQ3 XXS on M4 Pro and M5 Pro (both 24GB unified memory) using the same configuration on MoEShift.

Results (M4 Pro vs M5 Pro):

- Short prompt decode: 9.84 vs 14.69 tok/s (+49%)

- Long prompt prefill (6,060 tokens): 199 vs 374 tok/s (+88%)

- Long prompt decode: 9.57 vs 13.14 tok/s (+37%)

- Long prompt inference time: 83.9 vs 55.1 seconds

- Peak RAM process footprint: 8.5GB on both Macs

The major difference is the prefill speed thanks to the higher SSD throughput of the M5 Pro, which directly impacts the expert streaming.

What impresses me the most is running Flash Next at these speeds on so low a RAM budget, leaving memory also for other apps which is the reason for this project.

For reproduction, I ran the benchmark using the stock benchmark runner included in the repo: https://github.com/davide-troiani/moeshift

3.

M4 Pro vs. M5 Pro (24GB): Qwen 3.8 Flash Next at 374 Tok/S Prefill with MoEShift(github.com ↗)

13 points · by davidetroiani · 2w ago · 1 comment

comment 3w ago · link · parent

Hi HN! I wanted to run an LLM locally on my 24GB M4 Pro Mac mini without needing to kill all other apps to free up the RAM for the inference.

So I built a runtime based on llama.cpp that uses SSD offloading and Lookahead Expert Scheduling. I introduced optimizations like adaptive caching and prefill batching, I/O and GPU work overlap, GPU keepalive to keep frequency high. Turns out that this runtime now lets me run Qwen 3.8 Flash Next (RCO GSQ IQ3_XXS from ISTA DASLab) at 10 t/s decoding, 160 t/s in prefill and keep it 7.5GB peak process memory footprint. That’s double the end-to-end speed and half the RAM footprint compared to Strata with the same model on this machine.

Currently the project is an open-source alpha, I am still optimizing and adding support to more model architectures. Currently tested models are Qwen 3.8 FN and Qwen 3.6 35B A3B (Unsloth’s Q6) that runs at 400+ t/s in prefill.

The project is called MoEShift and I’d love to see how it performs on your Macs: you can share the benchmark as a GitHub issue using the benchmark runner that I prepared. Of course technical feedback is much appreciated.

Link to source code, architecture details, benchmarks and install instructions: https://github.com/davide-troiani/moeshift

Cheers!

5.

Show HN: MoEShift - Faster large MoE inference with half the RAM(github.com ↗)

2 points · by davidetroiani · 3w ago · 1 comment

comment 5mo ago · link · parent

You could allow users pay to recognize their own doc types.

comment 5mo ago · link · parent

Interesting, does it support any kind of document of does it support only specific docs? For example tessera sanitaria in italy

comment 5mo ago · link · parent

I can’t imagine getting logos from websites at scale. But it’s more about business. Technically is simple enough that if you are making money from it, really well done bro.

comment 5mo ago · link · parent

Add a comparison table between your repo and alternatives like rtk. I’m interested.

comment 5mo ago · link · parent

How does this differ from dropping logos to chatgpt and getting the desired shape?