If llama.cpp is producing text far more slowly than you expected, the cause is often one of two settings: the model isn't being offloaded to your graphics card, or llama.cpp is using too many CPU threads. The llama.cpp project's own performance troubleshooting notes cover both. cpp developers' own example.
A note on commands: the llama.cpp troubleshooting page uses ./llama-cli, while the current llama.cpp README uses llama cli and llama serve (see our llama.cpp 1.0 news story for what changed in 1.0). The -ngl and -t flags described below are the ones in the troubleshooting page; check --help on your version for the exact names.
Step 1: Make sure the model is on the GPU
The llama.cpp notes say it must be compiled with GPU support, such as CUDA for NVIDIA cards, for the GPU offload flag to work. Our guide to running llama.cpp on Windows covers installation.
Then pass -ngl N (or --n-gpu-layers N). The llama.cpp notes say you can set N very high and llama.cpp will offload as many layers as it can, even if that's fewer than you asked for. Before it starts generating, llama.cpp prints diagnostic lines; the example in the docs shows the number of layers offloaded to the GPU and the total VRAM used. If you see those lines, the GPU is being used.
If only some layers fit, the rest run from system memory and speed drops. A smaller quantisation or a shorter context helps; our guide to running a local LLM on 8GB of VRAM has more.




