Loading
Temperature changes how a model picks the next token. Write `softmax(logits, temperature)` that divides each logit by the temperature and returns probabilities that sum to 1. Subtract the max before exponentiating so large logits do not overflow.
scaled = [x / temperature for x in logits]; m = max(scaled); exps = [math.exp(x - m) for x in scaled].