r/LocalLLM • u/powerrangersspd • 24m ago
Research How I used real optimization (Mostly Gemini Neon) to take Inkling 2 Mini from 9.6 tok/s @ 16K to 25 tok/s & 192K context on a 6 GB RTX 3060 laptop
I use my predator helios mostly as a gaming rig and all of my office work (think-tank research and events etc, non-tech) is usually done on claude, all my side projects too. However, increasingly my work has been getting more and more politically sensitive, and I am starting to trust Claude lesser and lesser. Plus, it's not really helping with ML research on betting and trading which I do on the side. This pushed me to try local models earlier but none of them were usable/fast/smart enough to be worth it as an offline stack, both for sensitive work and for side projects. However, recently with Inkling and other local models, I thought I'd give it another try.
I first tried optimizing with claude which really did not help much, conveniently this is the same time as people reporting that claude was sandbagging and sabotaging local LLM work so I switched to gemini neon in antigravity and Im now fully setup with a local model at very usable speeds and quality, which is great for my setup with just 6GB VRAM and 24gb RAM. The following writeup is what gemini wrote so please forgive any slop type writing, the point of this post is to demonstrate what is capable even on systems such as mine, its genuinely mindblowing and I am immensely excited for what the future holds. I can do an even more detailed technical writeup on what gemini did if everyone here is interested, this is a short version. It wrote custom kernels and did a shit ton of optimization. I hope y'all like it! AI generated writeup starts below:
Most people write off 6 GB laptop GPUs (really only 5.1 GB usable VRAM on Windows) as "7B-8B toys." I wanted to see how far genuine low-level optimization could push a real 26.4B looped reasoning MoE (Inkling-2-Mini, 10.6 GB GSQ quant) on my Acer Predator RTX 3060 6 GB laptop (i7-10870H, 24 GB RAM).
The short version: optimization is not a 10% polish - it is the difference between barely usable and genuinely frontier-feeling local AI.
Before vs After (same laptop, same 5.1 GB VRAM ceiling)
| Stage | Context | Decode Speed | Prefill Speed | Peak VRAM |
|---|---|---|---|---|
Starting llama.cpp baseline | 16K | 9.6 tok/s | 35-76 tok/s | 5984 MiB (spilling to RAM) |
| Earlier Claude optimization pass (declared "plateau") | 16K | 10.8-11.2 tok/s (9.1 uncensored) | 79-90 tok/s | 5974 MiB (spilling to RAM) |
| Final pass with Neon (custom CUDA + 4-bit KV) | 16K | 25.3 tok/s | ~340 tok/s | <= 5130 MiB (zero spill) |
| Final pass with Neon | 32K | 25.1 tok/s (23.2 @ 29K) | 342.7 tok/s | 5128 MiB |
| Final pass with Neon | 64K | 24.4 tok/s (21.2 @ 58K) | 326.4 tok/s | <= 5130 MiB |
| Final pass with Neon | 128K | 22.9 tok/s (19.5 @ 111K) | 301.9 tok/s | 5126 MiB |
| Final pass with Neon | 192K | 20.8 tok/s (16.7 @ 165K) | 276.1 tok/s | 5128 MiB |
(That is 2.6x faster decode*,* 2.77x faster uncensored*,* 4.5x-9.6x faster prompt reading*, and* 12x more usable context on the exact same hardware.)
Why the earlier pass stalled (Claude vs Neon)
I started this project with Claude, and honestly it left almost all the real performance on the table:
- It stayed stuck tweaking static layer offloading in
llama.cpp, hit 10.8-11.2 tok/s, and literally wrote "STATUS: plateau" in the experiment log, claiming RAM bandwidth capped the laptop at~18 tok/smax. - It accepted VRAM overcommit (
~6.0 GBused on a5.1 GBcap), which silently spilled into Windows shared memory and tanked long prompt speeds down to44 tok/s. - It tried live LoRA uncensoring which wrecked decode speed by -41% (down to
9.1 tok/s), and never figured out how to get past 16K context.
Then I handed the whole optimization stack to Neon, and Neon did all the real heavy lifting from scratch:
- Switched to a dynamic GPU expert cache (
maya-ik2): Instead of dumping whole model layers onto the slow CPU, it keeps ~85-88% of the hottest experts live in VRAM and streams only the rare misses over PCIe inside a single CUDA graph. - Fixed hidden CUDA kernel bottlenecks: Found that the engine's quantized math kernels were spilling registers to slow local memory, rewrote them cleanly to zero spills, and reclaimed ~424 MiB of dead scratch memory that the engine was wasting on unused buffers - feeding every megabyte straight back into GPU expert slots.
- Built a custom 4-bit Hadamard KV cache (TurboQuant style): Cut KV memory in half vs FP8 (
0.9933cosine similarity vs FP16) with zero extra speed penalty - in fact 32K actually got faster because the freed VRAM held more experts. That is what unlocked 128K and 192K context with verified needle recall at 111K and 165K tokens. - Zero-cost uncensoring & smarter caching: Replaced the slow
-41%LoRA with native refusal-direction orthogonalization (zero speed drop), protected the model's 3-pass looped layers from getting evicted from cache, and used streaming PCIe reads so incoming weights don't pollute GPU cache.
Proof it's not just a benchmark toy: an 87K-token offline coding run
I wired the 128K profile into OpenCode alongside a 0 MiB VRAM offline Knowledge Hub (118 Kiwix ZIMs: full Wikipedia with a 41.5M semantic index + 100 DevDocs libraries + StackExchange over local MCP) and gave it a single cold prompt to build a multi-file Python CLI (riskwatch):
- Look up SQLite FTS5 syntax in offline DevDocs and pull real maritime chokepoint stats from offline Wikipedia (zero hallucinated facts).
- Build a trigger-synced FTS5 database with safe query sanitization (so inputs like
Hormuz-2026,oil/gas, or unbalanced quotes don't crash SQLite). - Build a rolling z-score time-series anomaly engine with strict zero look-ahead bias (proven by mutating all future rows after day 45 to
1,000,000and asserting earlier outputs stay bit-identical). - Write a full
pytestsuite, debug its own bugs, and generate an executive Markdown brief.
Result:
- 76 tool calls (including 11 real offline MCP lookups), reaching 87,016 context tokens at
20.1 tok/smedian (23.2peak) and81.1%median expert cache hit. - It caught and fixed its own missing SQL
JOINbug and timestamp parsing bug during the test loop. 20/20tests passing in 1.66s, full CLI pipeline + cited report generated. $0.00 API cost, zero internet.
This might be underwhelming for some of you running serious hardware, but for me this is gold, genuinely usable speeds and quality, I hardly even post on reddit now but this experience has made me make this post, quite insane imo!
1
u/Odd-Customer-7957 21m ago
used Gemini neon on a 6gb 3060 too, got 22 Tok/s at 32k with inkling-2-mini, but needed to cap batch size at 1 to avoid crashes. your 192k context is wild; did you tweak any llama.cpp flags beyond --mmap?