Why KoboldCpp is slow and how to make it faster
Most slow setups have part of the model in system RAM: make sure every layer fits in VRAM and that the log shows GPU buffers, not CPU ones. Next check that you are not reprocessing the whole chat each turn, that you downloaded the right build, and, on CPU, the thread count: in our tests the automatic setting used only half the cores and left up to 30% speed unused. Read the two speeds KoboldCpp prints, processing and generation, to know which one to fix.
Checked against KoboldCpp 1.124.2 · updated 13 Nov 2026
- lab-lnx: Linux test VM · 4 vCPU · 15 GB · no GPU
- gha-w25: Windows Server 2025 test machine · 4 vCPU · 16 GB · no GPU
- gha-w22: Windows Server 2022 test machine · 4 vCPU · 16 GB · no GPU
- gha-u24: Ubuntu 24.04 test machine · 4 vCPU · 16 GB · no GPU
- gha-mac15: macOS 15 test VM (Apple Silicon) · 3 vCPU · 7 GB · paravirtual Metal
On this page
- Why is KoboldCpp slow? Read your speed first
- The speed checklist
- 1. Fit the whole model on the GPU
- 2. Make sure the GPU is really used
- 3. Avoid the shared-memory spill
- 4. Stop reprocessing long chats
- 5. Use the right build and backend
- 6. Threads
- 7. Prompt processing speed: batch size and flash attention
- Quant choice and speed
- Speculative decoding: draft models and MTP
- Loading speed: mmap, mlock and direct I/O
- Benchmark your own setup
- Several users at once
- Speeds we measured
- It got slower after an update
Why is KoboldCpp slow? Read your speed first
KoboldCpp prints a line after every reply. Two speeds matter: Processed is how fast it read your prompt, Generated is how fast it wrote the reply. The first is the wait before the first word, the second is the pace of the words.
[12:40:51] CtxLimit:1682/4096, Init:0.01s, Processed:1650 in 14.84s (111.22T/s), Generated:32/32 in 0.96s (33.16T/s), Total:15.81s1- [12:40:51] CtxLimit:1682/4096, Init:0.01s, Processed:1650 in 14.84s (1: CtxLimit: tokens used out of the context. Processed: the prompt, 1650 tokens at 111 tokens/s. Generated: 32 tokens at 33 tokens/s.
Apps can read the same numbers from /api/extra/perf (last_process_speed, last_eval_speed). A comfortable reading speed is about 5 tokens per second. These lanes show what different speeds look like, measured on one of our four-core Windows machines with a small model, with one, two (the automatic choice) and four CPU threads F07:
The speed checklist
In order of how much they usually matter:
Speed checklist
1. Fit the whole model on the GPU
This is the biggest lever. Every layer left in system RAM runs at CPU speed, and the slowest part sets the pace. Use the calculator to see how many layers fit your card at your context size, then lower the context (context size) or pick a smaller quantisation until they all do. The GPU layers guide has the steps. We have not measured the speed-versus-layers curve on a physical GPU yet, so we publish no number for the cliff. The CPU end we did measure: Llama 3.1 8B on four CPU cores generated 5.3 tokens per second F37.
2. Make sure the GPU is really used
KoboldCpp can start without error on the wrong build and run on the CPU. In our test with no GPU, the log still said offloaded 25/25 layers to GPU F17, and the CUDA build on a PC without an NVIDIA card runs on the CPU without a message F02. The proof is in the lines that end in buffer size: CUDA0, Vulkan0 or MTL0 is the GPU, CPU is not. See GPU layers, step 3 and Not using the GPU.
3. Avoid the shared-memory spill
On Windows, a model that is slightly too big for VRAM can spill into “Shared GPU memory” and slow to a crawl without an error. Watch Task Manager’s shared memory while it generates. We have not measured it yet; users report it widely. How to check and change the driver policy: the shared memory section.
4. Stop reprocessing long chats
If the Processed count equals the whole chat every turn, KoboldCpp is rereading everything. In our 32-turn chat, a full window cost 23 processed tokens a turn with ContextShift and 1,946 with --noshift, and 25,729 against 749 over the whole chat F66. Typical causes are a changing Memory or World Info near the top, --noshift or --nofastforward, and sliding-window models like Gemma. Details and fixes: ContextShift and fast-forward.
5. Use the right build and backend
The file you download decides which engine runs. On our Windows Server 2022 test machine (no GPU, 0.5B model) generation speed was:
Data
| Item | Value (tok/s) |
|---|---|
| koboldcpp-nocuda.exe | 47.4 |
| koboldcpp.exe (CUDA build, no NVIDIA GPU) | 42.3 |
| koboldcpp-oldpc.exe | 28.2 |
| --noavx2 | 31.7 |
| --failsafe | 5.8 |
Download CSV · Results: R-ci1-w22-nocuda-base-q4_k_m, R-ci1-w22-cuda-base-q4_k_m, R-ci1-w22-oldpc-base-q4_k_m, R-ci1-w22-nocuda-fail-noavx2, R-ci1-w22-nocuda-fail-failsafe
The CUDA file on a PC without NVIDIA also took 11.7 s to start against 6.5 s F02. koboldcpp-oldpc always loads the no-AVX2 library, so on a modern CPU it is about 40% slower F03. Uses the slower non-AVX2 library for older CPUs (with Vulkan if requested).Default falseLauncher Quick Launch tab: Backend (dropdown: Use CPU / Use CUDA / Use hipBLAS (ROCm) / Use Vulkan / Use CPU (Old CPU) / Use Vulkan (Old CPU) / Use Vulkan (Older CPU) / Failsafe Mode (Older CPU); only options whose library ships in the binary are listed)Since v1.5All details and Maximum-compatibility mode for very old CPUs (no AVX); implies --noavx2. Very slow.Default falseLauncher Quick Launch tab: Backend (dropdown: Use CPU / Use CUDA / Use hipBLAS (ROCm) / Use Vulkan / Use CPU (Old CPU) / Use Vulkan (Old CPU) / Use Vulkan (Older CPU) / Failsafe Mode (Older CPU); only options whose library ships in the binary are listed)Since v1.80All details are for CPUs that need them: failsafe was 8 times slower F15. Use the download picker if you are unsure. NVIDIA owners can choose between CUDA and Vulkan; we have not measured the difference yet. On a Mac, Metal is the default; on GitHub’s macOS test VM it was slower than the CPU F29, which says nothing about a real Mac.
6. Threads
On the CPU and for the layers left on the CPU, the thread count matters. With no CPU threads used for generation. Default is computed from your physical core count (the value shown in --help is machine-specific).Default 2Launcher Hardware tab: ThreadsSince v1.0.8betaAll details the log said Threadpool set to 2 threads and 2 blasthreads on every four-vCPU machine we tried F07. Four threads gave more generation speed than the automatic two on all of them:
| Linux test VM (lab-lnx) | 11.03 | 18.85 | 24.55 | +30% |
| Windows Server 2022 | 33.82 | 48.41 | 60.78 | +26% |
| Windows Server 2025 | 26.51 | 44.20 | 49.86 | +13% |
| Ubuntu 24.04 | 26.07 | 46.03 | 48.71 | +6% |
These are cloud machines with four virtual CPUs, not desktops. A second run repeated the direction on Ubuntu (31.5 to 43.1) and both Windows machines (46.1 to 56.7 and 43.4 to 48.5), but cloud CPU scheduling is noisy, so treat the size of the gain as approximate. On a desktop with hyper-threading the best value may be the physical core count; try it and compare the Generated speed, because we have not measured that. The launcher fields are Threads and Batch Threads (CPU threads used for generation. Default is computed from your physical core count (the value shown in --help is machine-specific).Default 2Launcher Hardware tab: ThreadsSince v1.0.8betaAll details, Thread count used during batched prompt processing; defaults to the --threads value.Default 0Launcher Hardware tab: Batch ThreadsSince v1.19All details). Threads help much less when every layer is on the GPU. Raises the process CPU priority. Experimental; can cause system lag.Default falseLauncher Hardware tab: High PrioritySince v1.18All details is experimental and can make the PC lag.
7. Prompt processing speed: batch size and flash attention
Logical batch size for prompt processing (default 512). Larger is faster but uses more memory; -1 turns batching off. Formerly --blasbatchsize.Default 512Launcher Hardware tab: Batch Size (slider)Since v1.8All details (default 512, formerly --blasbatchsize) sets how many prompt tokens are processed together, and Physical micro-batch size inside each batch. -1 (default) means same as --batchsize; lower it to save memory.Default -1Launcher Hardware tab: Physical Batch Size (slider)Since v1.122All details (since 1.122) is the inner micro-batch. We tried seven batch sizes with a 1,650-token prompt on our CPU test machine:
| 32 | 135.1 | 33.7 |
| 64 | 146.8 | 32.3 |
| 128 | 149.5 | 25.7 |
| 256 | 180.8 | 32.5 |
| 512 | 170.2 | 29.8 |
| 1024 | 180.0 | 30.9 |
| 2048 | 174.3 | 35.6 |
On this machine prompt processing was about 20 to 25% slower at batches of 32 to 128 (135 to 149 tokens per second) than at 256 and above (170 to 181), and there was no clear gain beyond 256. The differences between 256, 512, 1024 and 2048 are within the run-to-run noise on this shared machine (generation speed, which the batch size should not affect, varied between 26 and 36), so do not read a winner into them. The default of 512 is fine on the CPU.
On a GPU the picture differs, and memory use grows with the batch: the compute buffer is larger for a bigger batch, so lowering it saves VRAM (see GPU layers). Users report that a lower batch size can stop freezes on weak GPUs and with Vulkan; we have not measured that.
Flash attention is on by default since 1.107, so adding Deprecated (1.107): flash attention is on by default; use --noflashattention to disable.Default falseSince v1.64All details changes nothing F09. Turn it off with Turns off flash attention, which is on by default since 1.107.Default falseLauncher Quick Launch tab: Use FlashAttentionSince v1.107All details only when testing a slowdown or garbled output report. Older advice about “BLAS”, “cuBLAS” or CLBlast is out of date: CLBlast was removed in 1.107, and cuBLAS is the old name of the CUDA backend (Selects the NVIDIA CUDA backend (or hipBLAS/ROCm in ROCm builds). Optionally give a GPU index or 'all'; legacy sub-options (mmq/nommq/lowvram/rowsplit) are still parsed and translated into the newer flags.Default noneLauncher Quick Launch tab: Backend (dropdown: Use CPU / Use CUDA / Use hipBLAS (ROCm) / Use Vulkan / Use CPU (Old CPU) / Use Vulkan (Old CPU) / Use Vulkan (Older CPU) / Failsafe Mode (Older CPU); only options whose library ships in the binary are listed)Since v1.33All details became Selects the NVIDIA CUDA backend (or hipBLAS/ROCm in ROCm builds). Optionally give a GPU index or 'all'; legacy sub-options (mmq/nommq/lowvram/rowsplit) are still parsed and translated into the newer flags.Default noneLauncher Quick Launch tab: Backend (dropdown: Use CPU / Use CUDA / Use hipBLAS (ROCm) / Use Vulkan / Use CPU (Old CPU) / Use Vulkan (Old CPU) / Use Vulkan (Older CPU) / Failsafe Mode (Older CPU); only options whose library ships in the binary are listed)Since v1.33All details in 1.96).
Quant choice and speed
On the CPU, a smaller quantisation is not automatically faster. Q8_0 processed a 1,650-token prompt faster than Q4_K_M (for example 133 against 111 tokens per second on Ubuntu) and generated at about the same speed, and Q2_K was no faster to generate F13. F16 generated 25 to 35% slower. The reason to pick a smaller quant is memory, not speed. We have not measured a GPU yet. See quantisation when it is published.
Speculative decoding: draft models and MTP
A small “draft” model can guess several tokens that the big model then checks in one step. Set it with Small model with the same vocabulary as the main model, used for speculative decoding to speed up generation.Default Launcher Loaded Files tab: Draft ModelSince v1.79All details (the draft needs the same vocabulary as the main model) and Number of tokens the draft model proposes per step in speculative decoding (default 4).Default 4Launcher Loaded Files tab: Draft Amount / Splits / LayersSince v1.79All details (default 4), or use Uses a model's built-in multi-token-prediction layers as the draft for speculative decoding, if present.Default falseLauncher Loaded Files tab: Use MTPSince v1.115All details for models that have built-in multi-token-prediction layers (since 1.115). In the launcher these are on the Loaded Files tab.
We tested the mechanism with the models we have: Qwen2.5-0.5B at F16 as the main model and the same model at Q2_K as the draft, on four CPU threads, three runs each:
| No draft | 23.7 | – |
| Draft Q2_K, --draftamount 4 | 7.4 | 208 accepted, 32 rejected |
| Draft Q2_K, --draftamount 8 | 8.1 | 230 accepted, 35 rejected |
The draft model’s guesses were right most of the time (about 84% accepted), and generation still got about three times slower, because the draft model also runs on the CPU and the main model is already tiny: the extra work costs more than the saved steps. Where the main model is big and slow and the draft is small and on a fast GPU, the balance can turn the other way.
This is a tiny main model on a CPU, which is the worst case for a draft, so it says nothing about a real 8B model with a 1B draft on a GPU. Measure yours: the Generated speed with and without the draft is the only test that matters.
Loading speed: mmap, mlock and direct I/O
Start-up time is mostly unpacking the single-file program and reading the model: small builds were ready in 3.5 to 7 seconds with a 0.5B model, the CUDA builds in 9 to 12, and oldpc in up to 25 seconds F04. Memory-mapping (Memory-maps the model file instead of reading it fully. Off by default since 1.82.Default falseLauncher Quick Launch tab: Use MMAPSince v1.3All details) is off by default since 1.82; turning it on lowered the memory Windows reported by about 90 MB and changed nothing on Linux or macOS F12. Locks the model in RAM so the OS cannot swap it out.Default falseLauncher Hardware tab: Use mlockSince v1.18All details locks the model in RAM so the system cannot swap it out. Loads GGUF files with direct I/O, which can speed up cold loads on some disks.Default falseLauncher Hardware tab: Direct I/OSince v1.120All details (since 1.120) loads with direct I/O, which can help cold loads on some disks; we have not measured it.
Benchmark your own setup
Runs a benchmark instead of starting the server; optionally appends results to a CSV file.Default noneLauncher Hardware tab: Run Benchmark (button)Since v1.57All details (or Run Benchmark on the Hardware tab) fills the whole context, generates 100 tokens and writes one CSV row F16. The columns are Timestamp, Backend, Layers, Model, MaxCtx, GenAmount, ProcessingTime, ProcessingSpeed, GenerationTime, GenerationSpeed, TotalTime, Output and Flags. On our Linux test VM it reported 97.8 tokens per second processing and 16.3 generating, lower than chat because the context is full. To compare two settings: use the same context, run it three times, and change one thing.
Several users at once
By default KoboldCpp serves one request at a time and queues the rest. Number of generation slots that can run at once (experimental continuous batching). Default 1.Default 1Launcher Network tab: Parallel Requests / Parallel Total ContextSince v1.113All details lets it work on several together (continuous batching, experimental). Our two tests disagree on how much that helps on a CPU, so measure yours. On a CI runner, two simultaneous requests took 1.69 s and 3.15 s by default and 3.28 s each with two slots: no gain F26. On our Linux test machine, one request took 3.4 s and four simultaneous requests all finished in 6.2 s, which is 41 tokens per second in total against 19 for one request (with --threads 4: 68 against 33), and each request ran slower than it would alone F75. The gain is for several users or tools at once; a single chat does not speed up. We have not measured a GPU.
Speeds we measured
These are our test machines, which are cloud and lab VMs with four virtual CPUs and no GPU, with a 0.5B model. They set expectations for CPU speed, not for a desktop PC or a graphics card. We will add real hardware as we test it.
| Windows Server 2022, nocuda | 47.37 | 133.17 | 6.53 |
| Windows Server 2025, nocuda | 43.18 | 113.42 | 6.55 |
| Ubuntu 24.04, nocuda | 46.34 | 111.22 | 3.51 |
| Linux test VM (lab-lnx), nocuda | 18.49 | 112.86 | 4.01 |
| macOS 15 VM (Apple Silicon), Metal | 6.27 | 92.51 | 6.62 |
| macOS 15 VM, --usecpu | 9.70 | 114.00 | 4.28 |
It got slower after an update
Regressions happen: users report them with Vulkan and flash attention on Windows (issues #1933 and #1826) among others. Keep the previous file, run Runs a benchmark instead of starting the server; optionally appends results to a CSV file.Default noneLauncher Hardware tab: Run Benchmark (button)Since v1.57All details on both with the same settings, and report with both logs. The download page lists the files for every release.
Frequently asked questions
Why is KoboldCpp so slow?
Most often part of the model sits in system RAM instead of video memory, or the chat is being reprocessed each turn, or the build does not match the hardware. Check the buffer lines in the log, the Processed count per turn and which file you run. The checklist on this page goes through them in order of impact.
How many tokens per second is good?
About 5 tokens per second is comfortable reading speed, and anything above that feels fluid. On our four-core cloud machines a 0.5B model generated 18 to 61 tokens per second and an 8B model generated 5.3 on four CPU cores, which is usable but slow. A GPU that holds the whole model is much faster than either, but we have not measured one yet.
How many threads should I use?
On our four-vCPU test machines, four threads beat the automatic choice of two by 6% to 30%. On a real desktop with hyper-threading the best number may be your physical core count, so try that and compare the Generated speed. Threads matter on CPU and partial offload, much less when every layer is on the GPU.
Does flash attention make KoboldCpp faster?
It is already on by default, so adding --flashattention changes nothing. Turn it off with --noflashattention only to test a slowdown or garbled output report.
Why is prompt processing so slow?
Long prompts take time because every token must be read before the first word of the reply. If it happens every turn, the chat is being reprocessed: see ContextShift. On a GPU, check that the model is on the GPU; on CPU, a longer prompt means a longer wait, and a smaller batch size usually does not help.
Does a draft model speed things up?
It can, when a small model from the same family proposes tokens that the big one accepts. We tested only small models on a CPU and publish what that showed in the draft section below. It does not help every model, so measure yours.
What is mmap and should I turn it on?
Memory-mapping loads the model file lazily. It is off by default. In our tests turning it on lowered the memory the system reported on Windows by about 90 MB and changed nothing on Linux or macOS, and speed was the same.