KoboldCpp sampler settings: good starting points and what each one does

For the best settings in KoboldCpp, start from the model card's recommended values, or from the starting points below, and change one value at a time. Most problems come from three things: temperature too high or too low, repetition settings that are too strong or too weak, and a maximum output length that is too small. Launcher settings such as GPU layers and context are a different topic, linked below.

Checked against KoboldCpp 1.124.2 · updated 13 Nov 2026
  • lab-lnx: Linux test VM · 4 vCPU · 15 GB · no GPU
How we test
On this page
  1. Two kinds of settings
  2. KoboldCpp best settings: starting points by use case
  3. What we measured
  4. What each sampler does
  5. Temperature
  6. Top-K and Top-P
  7. Min-P (1.48)
  8. Repetition penalty
  9. DRY (1.70)
  10. XTC (1.74), dynamic temperature (1.55), smoothing (1.57), Adaptive-P (1.105)
  11. Sampler order
  12. Where to change them
  13. Replies too short or cut off
  14. Repetition and loops
  15. Model-specific settings

Two kinds of settings

Where each kind of setting lives
Launcher and server settingsBackend, GPU layers, context size, flash attention, KV cacheAt start-up: GPU layers, context, speed
Sampler settingsTemperature, Min-P, DRY, repetition penalty, output lengthPer request: Lite, SillyTavern or the API

If replies are slow or the program fails, look at the first kind. If replies repeat, ramble or feel flat, look at the second.

KoboldCpp best settings: starting points by use case

Starting points to adjust, from community guides
Assistant or coding (precise)0.2 to 0.60.051.0off
General chat0.70.051.0 to 1.05off
Roleplay and story0.8 to 1.00.05 to 0.11.0 to 1.10.8
Creative writing1.00.11.00.8

What we measured

On a prompt built to make a model loop, we measured how much text repeated for each setting F83. Lower means less repetition, which is not the same as better text:

Repeated 4-grams, Qwen2.5-0.5B Q4_K_M, 100 tokens, 4 seeds, KoboldCpp 1.124.2
Request defaults45%The same sentence again and again
rep_pen 1.045%Identical to the default: the default adds no penalty
rep_pen 1.1, range 2566%Moves on to new text
rep_pen 1.3, range 2560%Drifts away from the prompt
DRY 0.8 (base 1.75, length 2)6%Moves on; one run turned the text into a quiz
Temperature 1.0, Min-P 0.0530%Still loops: Min-P alone does not stop repetition
DRY 0.8, temperature 1.0, Min-P 0.0513%Readable, with some repeats
Temperature 2.0, no truncation0%Unreadable: low repetition by being random

The lesson: fix a loop with repetition penalty or DRY, not with temperature alone, and a score of zero is not the goal.

What each sampler does

Versions are from the release notes. Field names are the ones /api/v1/generate takes (API fields).

Temperature

Higher makes unlikely words more likely. At 0 the same prompt gives the same text for any seed F83. Our test showed the other end too: 2.0 with nothing cutting the tail gave unreadable text. A seed is not portable between machines: the same model, prompt and seed gave different text on Linux and on Windows and macOS (F33).

Top-K and Top-P

Top-K keeps the K likeliest words; Top-P keeps the smallest group whose chances add to P. Many guides turn both off when using Min-P.

Min-P (1.48)

Drops every word whose chance is below a share of the likeliest word’s chance, so it adapts to how sure the model is. Field min_p.

Repetition penalty

Makes words used in the last rep_pen_range tokens less likely. We measured 1.1 cutting repeats from 45% to 6% F83, and 1.3 drifting off topic. The server default behaves as 1.0.

DRY (1.70)

Penalises a word that would extend a sequence already in the text. Fields dry_multiplier, dry_base, dry_allowed_length. At 0.8 it matched the repetition penalty’s effect in our test F83.

XTC (1.74), dynamic temperature (1.55), smoothing (1.57), Adaptive-P (1.105)

XTC sometimes removes the likeliest word to add variety. Dynamic temperature (dynatemp_range) varies temperature with the model’s certainty. Smoothing (smoothing_factor) reshapes the chances around the top word. Adaptive-P steers towards a target probability. We did not test these four. The old --usemirostat flag was removed after 1.59; the API still lists a mirostat field.

Sampler order

Keep the default order. Users report that custom orders cause odd output; the field is sampler_order. Change it only if a guide for your model says so.

Where to change them

  • KoboldAI Lite: Settings, then the Samplers tab. On 1.124.2 its preset [Default] (“same as Simple Balanced”) shows temperature 0.75, repeat penalty 1.05, top-P 0.92, top-K 100, Min-P 0, a repetition range of 360 and the sampler order 6,0,1,3,4,2,5; DRY, XTC, Mirostat and the other advanced samplers have their own boxes, and a preset list offers Simple Logical, Balanced and Creative, Basic Min-P, Creative Min-P, Basic DynaTemp and others F104. Lite’s repeat penalty of 1.05 is not the server’s 1.0.
Lite settings, Samplers tab: context size, max output, sampler preset and the default sampler values.gha-u24-lite-settings-samplers-01 · gha-u24 · KoboldCpp 1.124.2 · 14 Nov 2026
Lite Settings Samplers tab: context 16384, max output 2048, temperature 0.75, repeat penalty 1.05, top-p 0.92, top-k 100
  • SillyTavern: the sampler panel (SillyTavern).
  • API: per request (API fields).
  • Server defaults: fills fields a request leaves out. We set {"temperature":0} and two seeds gave identical text when the request omitted temperature; with a request asking for 1.5 was still forced to 0 F83.

Replies too short or cut off

The server default is 2048 tokens (/api/v1/config/max_length, F05; ). A request’s max_length wins: we asked for 20 and got about 10 words F83. In Lite the box is “Amount to generate”. caps what any request can ask for. If a reply ends after a few words with EOS token triggered!, suspect the chat template first (template symptoms).

Repetition and loops

Fix in this order: check the template (chat templates); then DRY or a repetition penalty of 1.05 to 1.1; then temperature. A long chat at the context limit can also look like a loop (context).

Model-specific settings

Use the values on your model’s card for Gemma, Qwen, Mistral or GLM; we do not copy numbers we did not test. Per-family template and thinking facts are in the template finder.

Frequently asked questions

What are the best settings for KoboldCpp?

There is no single best setting. Start from your model's card, or from a community starting point (temperature 0.7 to 1.0, Min-P 0.05 to 0.1, repetition penalty at most 1.1), and change one value at a time with the same prompt.

What does DRY do?

DRY penalises a token that would repeat a sequence already in the text, however long. In our test on a looping prompt it cut repeated 4-grams from 45% to 6% on a 0.5B model.

What temperature should I use for roleplay?

Community guides suggest roughly 0.7 to 1.0 with Min-P 0.05 to 0.1. We did not test roleplay quality; we only measured that temperature 2.0 without truncation produced unreadable text.

How do I make replies longer?

Raise the amount to generate in Lite, or max_length in an API request. The server default is 2048 tokens. Short replies after a few words are often a chat template problem instead.

Should I use Top-K and Top-P with Min-P?

Many guides switch Top-K and Top-P off when using Min-P, because Min-P already cuts the unlikely tail. We did not test the combinations.

What are good settings for Gemma 4?

Use the values on the model card; we do not copy numbers we did not test.