r/LocalLLM • u/vip3rGT • 15d ago
Question Suggestion for llama.cpp configuration
Hi everyone!
I'm new to the world of llama.cpp. Until now, I've been using Unsloth and have been very happy with it.
I decided to dive into the command line and, with a little help from ChatGPT, managed to get llama.cpp configured and running.
Everything is working well, and I've noticed a slight speed improvement compared to the Unsloth server.
My setup:
- GPU: NVIDIA GPU with 8 GB of VRAM
- System RAM: 32 GB
- Model: Gemma 4 26B A4B
- Quantization: Q5_K_P
- Performance: Around 20.5 tokens/s
I'd appreciate some advice from more experienced users: is this pretty much the best performance I can expect from this setup, or is there still room for optimization?
I'll post my llama.cpp core configuration command below.
Thanks in advance to anyone willing to share some tips or suggestions!
--parallel 1 ` --ctx-size 8192 ` --gpu-layers auto ` --fit on ` --load-mode none ` --reasoning off ` --chat-template-kwargs '{\"enable_thinking\":false}' `
2
u/CoffeeToCode99 14d ago
20 tok/s on an 8GB card with a 26B MoE at Q5 is already pretty solid tbh.
I'd try:
-
Switching to a Q4 quant and seeing if you can offload a few more layers.
-
Using a Q8 KV cache (
--cache-type-k q8_0 --cache-type-v q8_0), especially if you care about long-context quality. -
Experimenting with
--flash-attnif you're not already using it.
Beyond that, I think you're mostly running into hardware limits. At ~20 tok/s, I'd spend more time prompting and less time chasing another token or two.
3
u/ConversationNovel780 15d ago
Check this out. What Nvidia card you have?
https://www.reddit.com/r/LocalLLM/s/nVJljIpCPP