Squeezing Every Drop of Speed Out of a Laptop CPU: Recompiling ik_llama.cpp for Gemma 4 E2B + MTP + Pi
After my previous findings, I almost called it quits on running models locally on my hardware: an AMD Ryzen 5 5625U with 16 GB dual-channel 3200 MHz RAM , locked to "Cool" mode with max processor state capped at 99% (~10–12W power limit, no turbo spikes).
Before giving up, I looked into ternary models. I tried running Ternary Bonsai 2 9B , and it gave me similar performance to my Qwen 3.5 4B & 2B setup—around 6–10 tokens/sec (specifically ~6 tok/s on Bonsai). Token generation was still pretty slow. It wasn't horrible, but it wasn't great either.
Then I saw a YouTube video about Gentoo Linux —the distro where you compile almost all software directly on your own hardware for a small performance boost. It reminded me of Formula 1: in F1, even shaving a few hundredths of a second off a lap time can be the difference between winning and losing.…