New Tool Radar

Local AI

How to Change Temperature Inside a Running Ollama Chat

Use the in-session set command to change sampling temperature, then confirm the next answer changes.

Schematic with three steps: Ask the test question once; Change the temperature in the session; Ask the same question again and compare.

Temperature controls how adventurous a model answers are: low values give steady, repeatable answers, high values give varied ones. You do not need to restart the session to change it; the /set parameter command changes it inside a running chat.

What you need

  • Ollama installed with a model already pulled
  • A chat session open with ollama run
  • One repeatable test question to ask twice

Step 1: Ask the test question once

In the session, ask a short open question and note the shape of the answer: how long it is and how many options it gives.

Step 2: Change the temperature in the session

Type /set parameter temperature 0.9 at the >>> prompt to raise it, or /set parameter temperature 0.1 to lower it. The change applies to the rest of the session.

Step 3: Ask the same question again and compare

Ask the same question again. A higher temperature should give a longer or more varied answer; a lower one should give a shorter, steadier answer. If nothing changes, check the value was accepted before the second question.

Worked example: synthetic temperature change

The table below is a synthetic example. It shows the expected result of changing temperature; no chat was run.

Temperature Question Answer shape
Default Give me three names Three plain names
0.1 Give me three names Same three names, short
0.9 Give me three names Three varied names with notes

Expected result (UNTESTED). the low-temperature answer is short and steady, and the high-temperature answer is longer and more varied, for the same question. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • One question is not a measurement; repeat the test before concluding the setting did nothing.
  • The in-session change lasts only for that session; for a permanent change, bake it into a Modelfile.
  • Temperature and top-p interact, so change one at a time when you compare answers.

Sources

See all