Sampling
How a model decodes — its temperature, top_p and top_k — can change whether it emits usable tool calls at all. Larik sends nothing of its own, so each server's defaults stand until you set something.
It ships no built-in values on purpose. Measured against qwen3:4b through Ollama, Qwen's published parameters (0.7 / 0.8 / 20) and Ollama's own defaults (0.8 / 0.9 / 40) gave identical results — 24 of 24 usable tool calls each, none malformed — so a table of vendor recommendations would have claimed a benefit that isn't there. Sampling did matter at the extreme: at temp=2.0 top_p=1.0 top_k=0 the model stopped emitting tool calls altogether and answered in prose instead. The knob is worth having; a default for it is not. Note the failure mode — nothing malformed appeared at any setting, so what bad sampling costs you is the call itself, not its syntax.
/sampling shows what is in force for the model you're using and where it came from. A spec saves it for that model, /sampling default drops the model's own setting, and /sampling none saves an empty one so nothing is sent for it even when a default would otherwise apply:
/sampling temp=0.2 top_k=20 # save for the current model
/sampling default # back to the published or configured default
/sampling none # send no parameters for this model
You can also set it in your personal config:
{
"sampling": { "temperature": 0.3 },
"model_sampling": { "ollama/qwen3-coder": { "temperature": 0.2, "top_k": 20 }, "ollama/qwen3:4b": {} }
}
Keys are provider/model or a bare model id, and provider/model wins. An entry is used as given rather than merged, so an empty entry ({}) sends nothing for that model. Precedence runs model_sampling["provider/model"], then model_sampling["model"], then sampling, then nothing; "Sampling" in /config edits the last of those. Changes apply on the next turn, and subagents resolve their own model's. Parameters a provider won't accept are dropped rather than sent: top_k isn't in the OpenAI API, and Anthropic's extended thinking fixes temperature and rejects top_p and top_k, so none are sent while it is on.
Because sampling shapes the model's output the way execution shapes its actions, a shared .larik/settings.json can't set it; only your personal config can.
Measure a change rather than assuming it, and watch the right number. larik bench --models <model> --runs 5 reports both malformed tool calls and runs that stopped without finishing; compare it against the same command with /sampling none saved for that model. The second figure is the one sampling moves. Through a server that constrains tool arguments to the tool's schema, as Ollama does, malformed arguments are prevented upstream and that count stays at zero however the sampling is set — what bad sampling takes away is the call itself.