Chatting in the Ollama Terminal: Slash Commands and Tips

JS
Jai Singh
12 Nov, 2026 4 min read 16 views

The interactive ollama run prompt does more than answer questions. It has slash commands for changing settings, viewing model info and saving a customised copy, plus multiline input and file piping. These make it a handy playground for testing a model before you write any code.

Start a session and get help

ollama run llama3.2

At the >>> prompt, type /? or /help to list the available commands. The exact list can differ slightly between versions, so this is the authoritative source for what your install supports.

Commands you will use most

  • /bye ends the session.
  • /clear clears the conversation context, so the model forgets earlier turns without you restarting.
  • /show info prints details about the loaded model. /show modelfile and /show system show other parts of its configuration.
  • /set system <text> sets a system message for the session.
  • /set parameter <name> <value> changes a runtime option such as temperature or context size.
  • /save <name> saves the current session settings as a new model, and /load <name> switches to a model.

Try a parameter change

Ask the same question at two temperatures and compare. Lower values give steadier answers:

>>> /set parameter temperature 0
Set parameter 'temperature' to '0'
>>> Name three colours.
>>> /set parameter temperature 1.2
>>> Name three colours.

At temperature 0 you should get nearly the same answer on every repeat. At 1.2 the answers vary more. Parameters such as num_ctx work the same way, which is how you test a bigger context window before hard-coding it anywhere.

Give the model a role

>>> /set system You are a patient Python tutor. Answer in at most four sentences.
Set system message.
>>> What is a list comprehension?

The system message is applied for the rest of the session. If you like the result, save it so you can reuse it:

>>> /save python-tutor
Created new model 'python-tutor'

You can now start it later with ollama run python-tutor. For a version you can keep in source control, write a Modelfile instead, as post 35 shows.

Multiline input

To paste code or a long prompt, wrap it in triple quotes:

>>> """
... Explain what this function does:
... def f(x): return x * 2
... """

Ollama waits until the closing triple quotes before sending the message.

Non-interactive use

Arguments and pipes avoid the prompt entirely, which suits shell scripts:

git diff | ollama run llama3.2 "Write a short commit message for this diff."
ollama run llama3.2 "Translate to Spanish: Good morning" --verbose

The --verbose flag prints timing statistics after the answer, including tokens per second. This is the quickest speed check available, and the numbers it shows are the same ones the API returns.

Tips

  • Keep the session short. Each turn adds to the context, which uses memory and can push early messages out of the window.
  • Use /clear between unrelated topics.
  • Use up and down arrows to recall earlier prompts.
  • Test prompts here first, then move the working version into code.

Understanding what the model remembers

The terminal session feels like a conversation with memory, but the model itself remembers nothing. The client keeps the list of earlier messages and sends all of them with every new question. That is why long sessions slow down and eventually lose their beginning: the history grows until it no longer fits in the context window, and the oldest messages are dropped. When you see answers that ignore something you said twenty turns ago, this is the reason. Clearing the session, or summarising the key facts into a short system message, restores quality and speed. It is also the reason that parameter changes with /set apply to the session only, and vanish when you leave unless you save them.

Using the terminal to compare models

Because starting a session is cheap, the terminal is a good place for quick side-by-side tests. Open two terminal windows, run a different model in each, and paste the same prompt into both. Notice the style of the answer, the speed, and whether the model follows instructions such as a length limit. Keep notes on which prompts expose differences; those become the first cases of the evaluation set you will build in post 93.

What to read next

When the terminal is no longer enough, the HTTP API is the next step, and the following post shows it with curl.

Was this article helpful?

Comments

No comments yet. Have a question or a tip? Be the first to share it.

Leave a comment

Comments are reviewed before they appear.