Inference
prefix caching in llama.cpp with MLX - Printable Version

+- Inference (https://www.datasculpting.ai/inference)
+-- Forum: Inference Engines (https://www.datasculpting.ai/inference/forumdisplay.php?fid=9)
+--- Forum: llama.cpp / GGUF (https://www.datasculpting.ai/inference/forumdisplay.php?fid=35)
+--- Thread: prefix caching in llama.cpp with MLX (/showthread.php?tid=428)

Pages: 1 2


prefix caching in llama.cpp with MLX - thetagrid15 - 09-22-2026

Spent some time on this today and wanted to compare notes.

I've gone back and forth between llama.cpp and PyTorch for FLUX. The interesting difference for me has been long context.

Trying to avoid rebuilding the whole thing twice.


Re: prefix caching in llama.cpp with MLX - embershed99 - 09-23-2026

A couple things I'd check first. Start by verifying the driver/runtime combo, then test with a smaller prompt, then look at quant drift. Once you know the plain path works, then add the faster path back in piece by piece.


Re: prefix caching in llama.cpp with MLX - dockridge - 09-23-2026

What exact setup are you running? What model, what runtime, and roughly what context size?


Re: prefix caching in llama.cpp with MLX - thetagrid15 - 09-23-2026

I don't think that's the whole story. I wouldn't optimize around that first. On my side the bigger swing came from the runtime and not the model. Worth testing the simpler explanation before adopting the more interesting one.


Re: prefix caching in llama.cpp with MLX - vectorport - 09-26-2026

Good point. I ended up in about the same place using llama.cpp. I got better results once I stopped chasing one metric and just looked at whether the workflow felt usable. I keep promising myself this is the last rebuild.


Re: prefix caching in llama.cpp with MLX - vrambandit - 09-26-2026

Quote:Good point. I ended up in about the same place using llama.cpp. I got better results once I stopped chasing one metric and just looked at whether the

I'd approach it in a boring order. If you're on PyTorch, I'd confirm the version first and then reduce variables until the behavior is obvious. A lot of these threads end up being one bad config plus a pile of conclusions drawn from it.


Re: prefix caching in llama.cpp with MLX - kernelmike - 09-26-2026

Maybe, but I had the opposite result. I've seen people blame workstation thermals when the real issue was much more mundane. Worth testing the simpler explanation before adopting the more interesting one.


Re: prefix caching in llama.cpp with MLX - macroforge - 09-26-2026

My first guess would be this: Start by verifying the driver/runtime combo, then test with a smaller prompt, then look at INT4. Once you know the plain path works, then add the faster path back in piece by piece.


Re: prefix caching in llama.cpp with MLX - dockridge - 09-27-2026

Ran a quick check on my box. I couldn't reproduce the slowdown until I pushed context much higher.


Re: prefix caching in llama.cpp with MLX - bytesupply76 - 09-27-2026

Quote:Ran a quick check on my box. I couldn't reproduce the slowdown until I pushed context much higher.

Ran a quick check on my box. The issue went away once I changed one setting and restarted the stack cleanly. I expected the model choice to matter more than it did.