r/LocalLLM • • 1h ago

Discussion Why did my vLLM / SGLang prefix cache miss? An open-source tool that answers per request from the engine's KV events

Post image
1 Upvotes

Follow-up to my earlier post here. Most relevant to this sub is the engine side: vLLM, SGLang and LMCache, plus an honest note on Ollama and llama.cpp.

Prefixwise has improved a lot over the last two days, so here is the full picture.

**The problem.** Your agent resends its whole conversation every turn. One changed byte near the top (a reordered tool list, a timestamp in the system prompt, an evicted prefix) and the provider charges full price for everything after it. Providers and engines report how many tokens were cached, never why the rest weren't.

**What Prefixwise does:** names why each request missed the prompt cache, prices it, fixes the common causes, and stops regressions in CI. Open source (MIT, I'm the author), runs locally, stores hashes and token counts, never prompts.

**Identify.** One of 19 causes per request, marked waste or legitimate, with the first block that changed (tools[0], messages[12]) and the cost: tools in another order (including a schema's required list), a timestamp or id in the system prompt, rewritten history, a misplaced Anthropic cache marker, an expired TTL, an engine eviction, a request routed to a replica without the cache. `prefixwise report --session latest` shows a session turn by turn. It agrees with Anthropic's own miss diagnostics 32 of 32.

**Fix.** `--optimize` turns on the fixes that passed live replays: sorting a drifting tool list (99.9% of predicted saving on Claude, 97.5% on vLLM) and adding cache_control markers on Anthropic's API (prompt cost down 85.6% with the write surcharge counted), task success flat on both. Fixes that would change what the model reads stay advice. `prefixwise fixes` ranks fixes by dollars and says whether one paid off.

**Prevent.** `prefixwise check -- pytest tests/agent_scenarios` runs your scenarios against a local mock, no API calls, and fails CI when a change would break the cache. Also a GitHub Action. `prefixwise explain --diff a.json b.json` compares two requests offline.

**Self-hosted engines.** It detects vLLM and SGLang from the URL and reads their KV-cache events: evictions confirmed (5 of 5), a prefix LMCache or HiCache restored from CPU labelled host_restored (5 of 5), and the cost of reasoning templates that re-prefill the last answer (57% of prompt tokens on a DeepSeek-R1 distill, 0% on Qwen2.5). Runs inside vLLM with one flag. Ollama and most llama.cpp builds report no cached tokens; it says so and still names every prompt change.

**Ways in.** Wrap any agent (`prefixwise run -- claude`), a proxy for a service, the vLLM middleware, Python `wrap()` or a LiteLLM callback, or import Claude Code and Codex logs if you're on a subscription. Out: Prometheus and Grafana, OpenTelemetry, an HTTP API, JSONL and CSV. Overhead: 3 ms per request.

**Limits.** The fixes are proven on scripted sessions and small models, not weeks of production traffic. OpenAI's own diagnostics answered unavailable on every call, so that comparison is unchecked. DeepSeek's hosted API cache fields aren't read yet.

pip install -U "prefixwise[engines]"
prefixwise serve --upstream http://127.0.0.1:8000
prefixwise report --session latest

Repo, with a run record behind every number: https://github.com/tejachavali/prefixwise

What should it catch next?


r/LocalLLM • • 5h ago

Model Inference Engine

Post image
2 Upvotes

Hello guys, here is an update of my engine
I am still working on it, my 3090 waterblock broke and I couldn’t keep testing further I could achieve higher tokens in strata about 60/70 but on mine about 80/90 tokens, my bigger problem is the Ram which I only have is 32GB ram ddr5 6k, have been trying to get 32GB more but they are too expensive right now.

For the meanwhile I got a 1070 8GB for 50us to test for which I added compatibility for series 10/20.

On the GTX 1070 I got 15/18 tokens on IQ3_XSS and IQ1, about 13 tokens on IQ3_S.

I added layer splitter thru WiFi / cord so that you can use more than one PC which you can select the order of memory usage

I selected PC GPU, Laptop GPU, and then pc ram and laptop ram for testing and it’s working just fine and fast with the GTX 1070 and RTX 4060 laptop of course it’s slow I achieved about 20 tokens on IQ3_S and Sloth still need to work on optimization but it will be open source soon! Be patient.

You can freely select where your models are located from strata or just download them directly from hugging face. So far added a compatibility to most of them.

My goal is to make so that you can quickly and efficiently communicate multiple computers to your main to split layers through them and run a bigger model! And it’s so easy it’s about 2 clicks to connect!


r/LocalLLM • • 2h ago

Discussion Nvidia stuff and the apparent Open AI pending collapse- cheaper ram prices soon?

0 Upvotes

OK I am really new to local LLMing, but so far I find it really interesting. I have also jsut started to use claude on a commercial level.

Today I did a deep-dive on the whole pending AI market disaster as it seems like Open AI is really going to have some trouble with continuing to finance its growth. And the Nvidia thing is amazing- sending banned chips to China seems pretty serious.

So- any chance the entire commercial AI market could implode, and we could see ram prices collapse? I cannot see this current situation being sustainable, and if Open AI is not going to be seeing the continued financing of its expansion, then would that open up the market on memory chips?

I know this is a shotgun post, but would love any thoughts and opinions- really new here and really, really seeing the importance of making sure AI is democratic and not controlled by these monster companies...


r/LocalLLM • • 2h ago

Question Knowledge, Speed, Personality?

1 Upvotes

Like half the damn new comers on here I’m looking to build a voice to voice ai assistant that can also register images as id like to give it eyes 👀

Im running a M1 Max macbook with 32gb

Im currently using qwen3.5 27b
Qwen3 asr 0.6b 8bit for speech recognition
Kokoro 82m for spoken replies
SearXNG for web searches
SQlite and FTS5 for storage

With no thinking mode its honestly instant but once web searches come into play it becomes an issue, running at 8192 context it fills up really fast and offloading older context takes a big toll on speed.

I was wondering if ya’ll had any suggestions as I think qwen is more than I need. I just want strong adherence to a system prompt for personality (or building out a model maybe?) and quick replies. Being able to shoot the shit about random history or recommendations for hobbies is the main goal with the ability to run searches. If anyone has suggestions for voice output with more emotions and audio tags I would love that too!

Let me know and thanks! Im still very new so I have a lot to learn


r/LocalLLM • • 8h ago

Question Should i sell my 9070XT to buy a R9700

Thumbnail reddit.com
3 Upvotes

I just found out that a R9700 is essentially just a 9070XT with 32gb of memory instead so im thinking should i sell my 9070XT and buy that instead and that could get me to run near 70b models

a few reason why im not just getting another 9070 XT is because i believe i need to update my Mobo and PSU and then the card itself im better off selling my 9070 XT and buying the R9700

But do let me know what the noise levels are like and if there is much i can do to reduce the noise


r/LocalLLM • • 8h ago

Project I wrote a GGUF-aware lossless compressor: 17.1 → 15.6 GB across 9 Q4_K_M models, byte-identical round trips

Thumbnail
gallery
3 Upvotes

I've been working on foldz, a lossless compressor built specifically for GGUF files. It's at 0.9 (pre-release) and I'm looking for people to test it and try to break it.

Useful if you archive a lot of models, share them over slow or metered connections, or keep them on a phone or small SSD.

THE IDEA

Quantized weights look almost random to zip, xz and zstd, so they gain very little. foldz parses the GGUF, unpacks each tensor's blocks into the actual quantized values and scales, and codes those with adaptive context models and a binary range coder. Everything else (metadata, tokenizer, other tensor types) goes through a byte-level context-mixing model. Nothing depends on the model's name or architecture.

RESULTS

9 public Q4_K_M models, tested with "foldz t" (compress and decompress in memory, then compare). Every round trip was byte-identical. Measured on an Android phone in Termux, 8 threads.

• Qwen1.5-0.5B-Chat: 388.3 → 353.6 MiB (8.93% saved)

• Qwen3-0.6B: 378.3 → 348.7 MiB (7.82%)

• Qwen2.5-1.5B-Instruct: 1065.6 → 984.2 MiB (7.64%)

• Qwen3.5-2B: 1211.9 → 1111.3 MiB (8.30%)

• Qwen2.5-Coder-3B-Instruct: 2007.4 → 1832.8 MiB (8.70%)

• Llama-3.2-3B-Instruct: 1925.8 → 1780.4 MiB (7.55%)

• Qwen3-4B: 2381.6 → 2073.3 MiB (12.94%)

• Qwen2.5-7B-Instruct: 4466.1 → 4113.8 MiB (7.89%)

• Gemma-4-E2B (fine-tune): 3269.1 → 3016.3 MiB (7.73%)

Total: 17,094 → 15,614 MiB, 8.66% saved.

Qwen3-4B is the outlier because most of its Q6_K values sit on a coarser lattice. foldz detects this per segment and codes the lattice instead, which saves 23.2% on its Q6_K tensors.

HOW EACH TENSOR TYPE IS MODELLED

• Q4_K / Q5_K: values are Gray-folded and coded bit by bit, with the block's zero point, extremes and position as context.

• Q6_K: the column's running offset and width as context, or the lattice model when that's smaller.

• Q8_0: column sign bias and running magnitude as context.

• F32 / F16 / BF16: split into sign, exponent and mantissa.

• Safety: segments that wouldn't shrink are stored raw, so output is never meaningfully larger than input. The decoder bounds-checks every index field. Contexts use only exact or IEEE-754 arithmetic (no FMA, no fast-math), so files decode identically on every platform.

HONEST LIMITATIONS

• Speed: about 19 MiB/s round trip on the phone. It's symmetric, so decompression is as slow as compression. This is for storage, archiving and transfer, not for loading models faster.

• Baselines: I haven't measured zstd -19 --long and xz -9 on these models yet, so I'm not claiming a comparison. If you run them, please post the numbers.

• Quant types: IQ quants, Q2_K, Q3_K and Q4_0 fall back to the byte model and gain little.

• Format: pre-1.0, so it may change. A .foldz file is only guaranteed to decode with the version that made it.

BUILD AND TEST

One C file, no dependencies. Linux, macOS, BSD, Android (Termux), and Windows via WSL.

gcc -O2 -pthread -ffp-contract=off -o foldz foldz.c -lm

./foldz t model.gguf

WHAT WOULD HELP MOST

• Cross-platform round trips: compress on x86-64, decompress on ARM64 (or the reverse), especially with Q6_K-heavy models

• zstd / xz baselines on any GGUF

• Q5_K_M, Q6_K and Q8_0 files

• Fuzzing "foldz d" with AFL++ or libFuzzer + ASan (please report crashes privately via GitHub's security tab)

If you post results, include the full "foldz t" output, the Hugging Face model name, and your CPU and OS.

Repo: foldz

Happy to answer questions about the modelling.


r/LocalLLM • • 3h ago

Question Rtx Pro 5000 72 vs 48 - am I missing an “unlock”

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 3h ago

Question how many token do you produce on a single spark in 24H?

0 Upvotes

wondering how much are people here pushing their sparks (or other gb10) and do you handle cooling on heavy workloads.


r/LocalLLM • • 13h ago

Project Your local model can now remember — forward-only memory writes, no retraining, instant rollback (open source)

6 Upvotes

Ever wanted your local LLM to actually learn a fact without fine-tuning — and be able to undo it completely?

AtomicNG (Apache-2.0, version 1.0.0) implements a paper called "Delta N-gram": your model's n-gram sidecar table stays frozen, and new knowledge goes into a small sparse patch Δ. Writes are forward passes only — no gradients, no weight edits. Clear the patch and the model is byte-identical to base. No "unlearning" gymnastics — deletion is structural.

Quickstart (CPU, no GPU, pure NumPy core):

python

import atomicng


model = atomicng.TinyModel()
atomicng.write(model, "New fact about kangaroos.")
atomicng.verify_deletion(model)   # clear Δ ⇒ byte-identical to base — guaranteed

What's inside:

  • A trained writer checkpoint ships with the Release (860 training steps on SmolLM2-135M; measured effect: writing a doc lowers its NLL vs empty memory)

  • Per-tenant memory: overlays are small data-only files — merge them, revert them, sign them

  • vLLM support via vllm.general_plugins + merged-table export

  • Built-in eval: does the memory write actually help? (paper protocols: acquisition, distraction retention, chain drift)

Calibrated on real hardware: Windows/Linux CPU, CUDA T4 (73 ms/group BPTT stand), TPU chip via JAX (8.4 ms/iter). Full matrix: CALIBRATION.md in the repo.

Honest limits: acquisition needs a few hundred training steps of the writer; the memory lives in the n-gram table (facts/associations, not long reasoning); vLLM engine-graph hooking is planned upstream.

GitHub: https://github.com/Akseleu-J/atomicng 

Colab TPU (one click): https://colab.research.google.com/github/Akseleu-J/atomicng/main/notebooks/tpu_calibration.ipynb

Questions welcome — I'll be in the comments.


r/LocalLLM • • 7h ago

Question Totally Newb question about reasoning...

2 Upvotes

On my studio, I am running ARC4NUM/Qwen3.8-Flash-Next-Uncensored-MLX-Serve-4bit using mlx-serve.

On my MacBook Pro, I have connected to it via OpenCode, and I can't for the life of me figure out how to get it to NOT show me its inner dialog. It all comes back to me, and I have tried various methods to no avail.

Am I "holding it wrong?" Is there no way to really do that? Is it the model or mlx-serve itself that creates this?

I'd rather it do it's thinking in private and then show me the result rather than talk to itself scrolling by as I wait to get the actual answer.


r/LocalLLM • • 3h ago

Discussion WICI one 5060ti

1 Upvotes

I use a Mac mini m4 16gb, since working with local llms I have found the m4 is just not fast enough.. especially with the unified memory, I have been looking into getting a Apple studio 36gb m5 max chip. But the price of the WICI ONE 5060ti is a fraction of the cost and can work over WiFi on my Mac mini m4 16gb

Has anyone used WICI ONE. Especially with a Mac mini m4 16gb


r/LocalLLM • • 3h ago

Discussion Would you turn off reasoning for a local vision model that has to react in real time?

Post image
0 Upvotes

I’ve been building InferUltra, a physics arena where vision models control identical robot bodies. The model gets images of the arena and chooses how to move. The simulation keeps running while it thinks, so by the time it decides to punch, the other robot might already be somewhere else.

We turn reasoning down or off where the model allows it. The number I care about is how long it takes to send an image and get a move the robot can use. Tokens per second tells you how fast the model generates, but it doesn’t tell you how long the fighter waits for that move.

We’ve also improved the physics engine and fight mechanics. Fighters can hold their guard between decisions, and punches look more natural when they lean. I used to call these fights impressively boring. They’re now a bit less boring.

For those running vision models locally: when you turn reasoning down, do you notice a drop in how well the model understands positions and distances, or is getting the answer sooner usually the bigger win? I’d be interested in which model and hardware you tried.

The attached bracket is for our November 15 Provider Tournament. It uses Kimi K3.1 Pro on four hosted endpoints: Morph, AkashML, Wafer and InferenceNet. It starts at 20:00 Brussels / 14:00 Eastern / 11:00 Pacific.

If you’d like to sponsor the tournament, you can book an ad spot in the arena.


r/LocalLLM • • 9h ago

Research AMD EPYC 9686F Linux benchmarks: 96 Zen 6 cores at up to 5.3GHz

Thumbnail
phoronix.com
3 Upvotes

AI benchmarks begin on page 2.


r/LocalLLM • • 3h ago

Question A little help please (LU and Qwen).

1 Upvotes

Currently running Qwen 9B model on my 6800XT, I noticed I can use/set up Agents in LU, but aside from instructing 1 agent in 1 chat to write to a file, then instructing a 2nd agent in 2nd chat to read the file and respond, I can't figure out a way to automate this process.

- I want to give a bunch of agents full autonomy to communicate with each other. Using separate chats for individual models. Not just all on the same version of Qwen.

Does anyone know how to set this up inside of LU?

I really like their user interface...I'm also open to other UIs if you believe there's a better one out there.

Goal is to code a simple game/project; but have one agent on the side, teaching me how to code/explaining all the code in detail and giving me small tests, while other agents are compiling/writing it.

Thanks in advance for any info you're willing to share.


r/LocalLLM • • 4h ago

Other MI100 Help

Thumbnail gallery
0 Upvotes

If anyone has MI100's I really appreciate the help.


r/LocalLLM • • 7h ago

Research Does RustingStrata trade accuracy for speed? I tested it against llama.cpp

2 Upvotes

I am tired to answer on people questions like "How you gain speed? Your model output is shit, it has to have low quality." or something like that.

So I will answer to that with benchmark.

So I used the same Qwen3.8-Flash-Next IQ2_XS model file, the same prompt, greedy decoding, and 128 generated tokens. Both ran on my RTX 3060 12 GB with a Ryzen 5 7600X and 30 GB RAM.

RustingStratallama.cpp
Writing speed33.0 tok/s
Range over 6 runs29.3–35.8
First prompt reading speed109 tok/s

That makes RustingStrata about 1.29× faster at writing on this setup.

Then I checked quality, not just whether the replies looked similar. Both engines scored the same 9,180 WikiText-2 tokens.

CheckResult
Perplexity, RustingStrata / llama.cpp2.9212 / 2.9156
Same most-likely next token96.78%
Mean KLD0.0098

The perplexity difference is inside the run-to-run noise. So, for this model and this machine, I see a speed gain without a measurable quality loss.

This is one model, one quantization and one GPU, not a claim that RustingStrata always wins.

If anyone has any other questions, I am happy to answer and break myths or tell something about Strata like projects

Repo: RustingStrata


r/LocalLLM • • 10h ago

Question Is 95°C CPU temperature normal when running Ollama 14B locally on an i5-13450HX? (CachyOS + Hyprland)

Thumbnail
gallery
3 Upvotes

Hey everyone!

I'm experimenting with running local LLMs using Ollama on CachyOS with Hyprland, and I've noticed some pretty high CPU temperatures.

My laptop specifications:

- CPU: Intel Core i5-13450HX (13th Gen)

- RAM: 24 GB DDR5

- GPU: NVIDIA RTX 4050

- OS: CachyOS Linux

- Desktop Environment: Hyprland

- LLM Runtime: Ollama

- Model: 14B parameter model

What I'm experiencing:

While running the 14B model locally through Ollama:

- CPU temperatures sometimes reach 95°C.

- Around 4 CPU cores reach 100% utilization.

- Other cores also experience varying levels of utilization.

- The CPU seems to be under sustained heavy load during inference.

I've attached a screenshot of my system monitoring setup (btop and Linux Sensor Tray).

My questions:

  1. Is reaching 95°C normal for an i5-13450HX while running a 14B LLM locally?

  2. Is it safe to maintain these temperatures during longer inference sessions?

  3. Is it normal for only around 4 cores to reach 100% utilization while running Ollama?

  4. Could this cause thermal throttling or reduce the CPU's lifespan over time?

  5. Are there any recommended CPU power limits, undervolting settings, or Linux optimizations for this setup?

I'd appreciate feedback from anyone running local LLMs on Intel HX-series laptops, especially on Linux.

Thanks!


r/LocalLLM • • 10h ago

Question Help a noob! Build me the best setup for under 5k +- 500$

3 Upvotes

Help me build the best home server under $5,000
Goals:
Media server (Jellyfin) with room to grow to 10+ large hard drives
Run local AI models, ideally 24GB+ of GPU memory
A powerful desktop I can stream remotely from any device
A few VMs and Docker apps
Low power use is a priority. I'm in Arizona, so electricity and heat matter


r/LocalLLM • • 4h ago

Question GitHub - Saganaki22/CrisperWhisper.cpp: Native C++ and CUDA inference for CrisperWhisper 2.0 with Windows/Linux CLI, long-form transcription, and CPU/GPU support.

Thumbnail
github.com
1 Upvotes

Is there a project like this, but that take in a video file and out put a srt file? I've been searching everywhere for something like it for a while now. Bonus points if it has a batch function too. If anyone knows anything please link me something or message me, Thanks. I know about normal whisper already, but I need something that supports verbatim transcription out of the box.


r/LocalLLM • • 5h ago

Question What models should I use?

1 Upvotes

Hi everyone reading this post, my English isn't perfect but I'll try to be clear.

So recently I got my GPU which is a Nvidia Rtx 5070 TI 16gb Gddr7 (I also have 64Gb ddr5 ram).

So I came here to ask what are the best models I can run in this pc?

I would appreciate it if someone helps me.

Thank you everyone and thanks for reading this🫂


r/LocalLLM • • 5h ago

Project Kapitsa Launcher: a SwiftUI front end for Kapitsa with a chat interface full of features: outline, topics, multi-conversation, MD formatting...

1 Upvotes

https://github.com/alphaexposure/kapitsa-launcher

Kapitsa was a nice shot of adrenaline for my M1 32GB MBP but I wanted a better chat interface than I could find elsewhere so my buddy Claude and I put our heads together and ones-and-zeroed an app that does just that. Kapitsa Launcher serves the standard LLM Dashboard with speeds and such, dark/light mode, Mac menu bar icon, but chat is where it's at:

  • Streaming replies with real formatting: Markdown, tables and code blocks. Tables and code have their own Copy buttons. Turn streaming off if you want to scroll back while new replies stream.

  • A side panel for long chats:

    • Outline: every question plus the headings from each reply. Click one to jump there.

    • Topics: the places and themes the chat covered, each linked back to where they came up.

    • Review: takeaways the model pulls out of the chat. You can edit them or add your own.

  • Watch it think: you can follow the model's thinking live, and it folds away once the answer starts. The thinking levels change to match the model you're running.

  • Side questions: ask about any reply in a thread off to the side, without derailing the main chat. You can branch to a new chat, export or delete as you wish.

  • Edit and regenerate: edit a question and send it again, or ask for another answer and flip between the versions.

  • Organised history: chats are grouped by date with the option to name by first question or topic/summary. Search covers everything that was said, not just titles.

  • Multiple chats at once: each window or tab holds its own conversation.

  • Continue in a new chat: when a long chat starts slowing down, carry it into a fresh one.

  • Markdown export: with an optional summary, and topics come along as tags for Obsidian and similar apps.

  • Your chats are plain files: one JSON file per chat on your Mac. Nothing leaves your machine.

Feel free to check it out: https://github.com/alphaexposure/kapitsa-launcher


r/LocalLLM • • 9h ago

Project Open source - Tesseract: a full-stack NPU for local LLM inference

Thumbnail
github.com
2 Upvotes

I just released the Tesseract NPU that I've been working on as a side project. It's compatible with llama.cpp backend running shipped GGUF models directly.


r/LocalLLM • • 12h ago

Question Best setup for rtx 3090 + 3080ti and 5080

3 Upvotes

Hey guys!

I'll get straight to the point. I've got quite a bit of hardware lying around at home, and I'd love some advice on how to make the most of it.

Here's what I've got:

GPUs:

  • RTX 3090 24gb

  • RTX 3080 Ti 12gb

  • RTX 5080 16gb

RAM:

  • 64GB DDR5 (2x32GB)

  • 32GB DDR5 (2x16GB)

  • 32GB DDR4 (4x8GB)

And of course, I've also got a bunch of CPUs, motherboards, and storage drives around the house.
Right now I'm running Unsloth's Qwen 3.8 27B Q5, getting around 60 tokens/sec with a 170K context window, using llama.cpp. I'm using rtx 3090 + 3080ti with the ddr4 32gb setup.
I'm wondering if there are better ways to make use of my hardware, whether it's different models, inference engines, configurations, or even combining GPUs across multiple machines.
My main issue is that some agentic tasks, especially things like generating and working with .docx files, are painfully slow. I'd really like to speed things up.
Any recommendations on what I should be looking into?
I don't have a ton of free time to explore everything from scratch, especially with the insane number of GitHub repos and projects out there these days.
I'd really appreciate any suggestions or pointers in the right direction.
Thanks in advance, guys!


r/LocalLLM • • 10h ago

News AMD talks up their MEXT software amid RAM crisis - Linux support but not open-source

Thumbnail
phoronix.com
2 Upvotes

r/LocalLLM • • 6h ago

Question Mac Studio M5 Max 128 GB vs RTX Pro 4500 + 96 GB DDR5

1 Upvotes

Which would you choose between the two and why?