Free · no signup · browser-local

LLM Temperature, Top-K and Top-P Sampling Visualizer

Explore how temperature, top-k and top-p change a token distribution. Edit logits, compare probabilities and run repeatable seeded sampling without calling a model.

Browse all tools →

Browser-local calculation · no model calls · no saved input

Input and settings

1–1,000 objects: [{"token":"A","logit":1.8},{"token":"B","logit":0.4}]. Token labels must be unique; logits must be finite numbers.

Sampling: temperature → min-p → top-k → top-p → normalize. Min-p retains tokens with p ≥ min-p × maximum p. Greedy selects the first maximum logit and ignores disabled controls. Top-p uses the distribution after top-k, keeps the threshold-crossing token and retains at least one. Equal logits keep input order. This simulates one token distribution, not a vendor API.

Your output

llm-sampling-playground-report.json

Complete the input to preview and export your result.

Each draw samples independently from the same fixed logits. No context, tokenizer, model or generated text is involved. Very small probabilities may underflow to zero.

Getting started

Paste token and logit objects, choose sampled or greedy mode, set temperature, min-p, top-k, top-p and a uint32 seed, then compare original, temperature and filtered probabilities with sampled counts.

Before you use the result

This simulates one token distribution without a model call. It does not reproduce any vendor API, tokenizer or text-generation process. Temperature must be positive; very small probabilities can underflow to zero.

Try an example

Logits ln(6), ln(3), 0 give .6, .3, .1 at temperature 1; top-p .7 retains the first two tokens and renormalizes to 2/3 and 1/3.

How it works

Sample mode: temperature → min-p relative to the largest probability → stable top-k → top-p including the crossing token → normalization. Greedy chooses the first largest logit. Entropy uses bits; perplexity is 2^entropy. Default min-p is 0 (disabled). Input ties keep their order. Mulberry32 seeded draws; 1–1,000 tokens, temperature (0,5], top-k 0–1,000 (0 disables), top-p (0,1], 1–10,000 draws and 500 KB input.

Frequently asked questions

Explore temperature, min-p, top-k, top-p and greedy selection on your own logits with probability bars and repeatable seeded sampling.

How do I use LLM Sampling Playground?

Paste token and logit objects, choose sampled or greedy mode, set temperature, min-p, top-k, top-p and a uint32 seed, then compare original, temperature and filtered probabilities with sampled counts.

Does this tool upload my data?

Inputs and files are processed in your browser. Page-view analytics do not contain your tool input.

What should I check before using the result?

This simulates one token distribution without a model call. It does not reproduce any vendor API, tokenizer or text-generation process. Temperature must be positive; very small probabilities can underflow to zero.