LLM Min-P
The modern filter that quietly replaced a lot of top-k fiddling
- previous
- llm_sampler
LLM Min-P is the relative of top-p that the local-LLM crowd has mostly moved to. Top-p cuts off the tail at a fixed cumulative mass, which means it can slice deeper when one token is dominant and hardly at all when the distribution is flat. Min-p flips the logic: any token whose probability is below min_p times the top token's probability gets thrown out. It's a proportional cutoff, so it adapts to how confident the model is at each step instead of applying a fixed rule. That's why it feels better-behaved than top-k in practice - it keeps the model flexible when it's genuinely unsure, and tight when it's confident.
How it fits the chain
YALLM's samplers are chain links, and this is one of them. Set min_p, wire it after a previous sampler's llm_sampler output if you have one, and feed the result to the pack's LLM Chat node. The node appends ("min_p", value) to an ordered list that goes to the provider as the samplers array - and on llama.cpp, the order you chain these is the order they apply. So if you want min-p running before top-k, chain it first.
The honest caveat, straight from the pack README and visible in the source: min-p is not in the official OpenAI API spec. It travels in extra_body, the pack's catch-all for provider-specific parameters. llama.cpp and its derivatives (ollama, LM Studio) speak the extended dialect and honor it; arbitrary hosted OpenAI-compatible endpoints may just ignore the field. For anything llama.cpp-based, though, this is arguably the most useful sampler in the pack - a modern default that a lot of local users keep on permanently.
The inputs and output
min_p- a float from0to1, default0.05.0.05means a token only survives if it's at least 5% as likely as the current top token. Lower = more filtering (toward0you keep almost everything); higher values like0.1–0.2cut harder toward determinism.previous(optional) - thellm_sampleroutput of an earlier sampler node.- Output:
llm_sampler, intoLLM Chat.
Installing it
Same pack, same install - Manager searching "ComfyUI-YALLM-node", or:
cd ComfyUI/custom_nodes
git clone https://github.com/asaddi/ComfyUI-YALLM-node
cd ComfyUI-YALLM-node
pip install -r requirements.txt
Restart, find it under YALLM/samplers.
Gotchas
Don't combine min-p with top-p at aggressive settings - they're both doing relative trimming and together they can collapse the model into repetitive text. Pick one. And if you're testing against a hosted provider and min-p appears to do nothing, check whether that provider honors nonstandard samplers before assuming the node is broken. When it does work, the 0.05 default is a genuinely good place to start; you'll mostly be nudging between 0.02 and 0.2, and the effect is far more noticeable than a tenth of a temperature point.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| min_p | FLOAT | 0.050–1 | — |
| previousopt | LLMSAMPLER | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| llm_sampler | LLMSAMPLER | — |