r/unsloth • u/liventruth • Aug 18 '26
Show and Tell Open-Source Model-agnostic KV-cache compression (UL-SMF) tested alongside local model execution to smash VRAM limits
Seeing all these massive local model drops (like the recent Qwen releases) got me working hard on the memory side of things.
If you're running models locally via tools like Unsloth and hitting a wall with long-context VRAM consumption, I've been building and open-sourcing UL-SMF (Unified Latent-State Memory Fabric).
It uses a geometry-preserving orthogonal projection bridge and dynamic head-dimension detection to automatically adapt across architectures (Llama, Mistral, Qwen, Gemma) without hardcoded assumptions, achieving extreme KV-cache compression with verified lossless perplexity.
Since it's fully local-first and designed to help fit larger context windows onto consumer hardware, I'd love a technical audit or feedback from this community.
Code and telemetry are up on GitHub: https://github.com/liventruth/UL-SMF-Cache-Compression
(Attached the hardware telemetry stress test output showing Qwen workloads hitting 224x–768x reduction ratios locally.)
15
u/Fun_Jaguar8231 Aug 18 '26
Ah yes, vibecoded slop with the classic qwen2.5, the knowledge cutoff from the model you were using. FYI qwen3..5 has much more advanced KV management
0
6
u/No-Refrigerator-1672 Aug 19 '26
So how exactly are you better than TruboQuant? Did you know that basically any inference engine offers "model-agnostic" KV compression out of the box?
1
2
u/Select-Student-6711 Aug 22 '26
I made an algorithm to compress model weights so they fit in limited memory: run Qwen3.8-27B from 13 GB of RAM (4-bit) with ~1% quality loss https://github.com/reyxv16/nmgc-codec

I suppose my algorithm could also be applied to the KV-cache and other areas
1
u/liventruth Aug 23 '26
This is a brilliant approach to static weight quantization. Using Manhattan distance to bypass trigonometric cost while leveraging a Rust decoder for the heavy lifting is a highly elegant engineering move. Getting a 27B model into 13GB is no joke.
You are absolutely right that a grid codec could mechanically compress the KV cache to save VRAM. However, the reason I built the UL-SMF architecture instead of using standard scalar/vector quantization is because we need to treat the KV cache as a dynamic cognitive state, not just static storage.
By projecting the cache into a specific 16D latent manifold, UL-SMF allows the overarching orchestrator to actively calculate the Shannon entropy of the system. If the entropy spikes (indicating hallucination drift or thermal decoherence), we can dynamically route that compressed tensor to a localized adversarial agent to sever the hallucination vector before it decodes.
NMGC is incredible for the static weights. HROC/UL-SMF is built to govern the live, dynamic logic loop. Let me know if you ever want to benchmark these pipelines side-by-side!
The overarching framework can be found here: https://github.com/liventruth/HROC-Cognitive-Framework
11
4
1
u/Sea-Mode4077 Aug 19 '26
I apreciate your work.. but you should run more extensve tests on the new models
2
26
u/brainExploded99 Aug 18 '26
BS. No detailed benchmarks, seems vibecoded, and you tested Qwen2.5. In the 8th month of 2026.
I will trust after you post actual benchmarks, like KLD on atleast wiki text, if not coding, and top 1 token agreement on a variety of tasks.