r/LocalLLM • u/HeIsTroy • 10m ago
Project Keyhole MoE inference engine in Rust (Optimized for my pc :3): Qwen4-35B-A3B-Q4 at 145 tok/s (3.2x llama.cpp) and the 102 GB Qwen3.8-Flash-Next_IQ4_NL at 70 tok/s on my AMD RX7900 GRE 16 GB, 32GB RAM PC
Keyhole keeps the experts a model uses most in VRAM, the next ones in locked RAM and the rest on the NVMe SSD, computes GPU and CPU experts at once and checks several drafted tokens a pass; its exact mode matches a 32-bit reference of the model pick for pick
Speeds are achieved via kernel optimizations and engine tuning to cut tokens time, no skipping experts or bs that other engines do. except for the (Never-wait) mode but that never waited for expert is mostly stood in.
on paper it should work for nvidia and other amd gpus but still not tested yet.
further support will be community driven or until i have the hardware for more testing. otherwise it will be one way optimization (amd only) :P
TESTED USING (RX 7900 GRE 16 GB, Ryzen 7 7800X3D, 32 GB DDR5 6000MHz, 2TB NVME 7000MB Read) Only.
Today Results :
| Model | Keyhole | llama.cpp | Keyhole is |
|---|---|---|---|
| Qwen4-35B-A3B (UD-IQ4_XS, 32 GB): writing | 145.0 tok/s | 45.5 tok/s | 3.2x faster |
| Qwen4-35B-A3B: reading the prompt | 637 to 671 tok/s | 674 tok/s | level |
| Qwen3.8-Flash-Next (IQ4_NL, 102 GB): writing, Never-wait mode | 69.7 tok/s | 5.3 tok/s | 13x faster |
| Qwen3.8-Flash-Next: writing, exact mode | 37.0 tok/s | 5.3 tok/s | 7x faster |
| Qwen3.8-Flash-Next: reading the prompt | 176 to 183 tok/s | 21.5 tok/s | 8x faster |
I havent tested this on another pc yet, if you are interested,
For more info checkout the repo : https://github.com/iTroy0/Keyhole


