Controlling and Tuning Model Behavior at Runtime
38%
The /set Command
/set configures session variables inside the Ollama interactive REPL. Changes apply only to the current session and disappear when you /bye.
The main subcommands:
/set parameter # runtime params (temperature, num_ctx, etc.)
/set system # system prompt
/set history # enable history
/set nohistory # disable history
/set wordwrap # enable wordwrap
/set nowordwrap # disable wordwrap
/set format json # force JSON output
/set noformat # clear format
/set verbose # show timings/token counts
/set quiet # hide them
/set think # enable thinking (reasoning models)
/set nothink # disable thinking
Here are some examples (first run ollama run $MODEL to get the REPL prompt):
You want the model to be a Linux sysadmin:
# Set command
/set system You are a terse Linux sysadmin. Answer in commands only.
# Question
Copy all files including hidden ones from folder A to folder B
# Answer
`cp -r /path/to/folder/A/* /path/to/folder/B/`
# Erase the system prompt
/set system ""
You want the model to be more creative:
# Set command
/set parameter temperature 1.5
# Question
Write a poem
# Answer
In Unix kernel deep,
Secrets safely it keeps.
Commands echo with silent might,
Guiding Linux through the night.
# Reset the temperature
/set parameter temperature 1.0
/set parameteronly accepts parameters the model/runner supports (liketemperature,top_p,top_k,num_ctx,num_predict,repeat_penalty,seed,stop
Local AI Engineering with Ollama
Run, understand, customize, fine-tune, and build agentic apps on your own hardwareEnroll now to unlock all content and receive all future updates for free.
