Ollama CLI Commands

The Ollama CLI is the quickest way to manage models. Every command talks to the local server, so the server must be running (it is, by default, after installation).

List and Inspect Models

ollama list
ollama show llama3.2
NAME               ID              SIZE      MODIFIED
llama3.2:latest    a80c4f17acd5    2.0 GB    2 days ago
gemma3:latest      a2af6cc3eb7f    3.3 GB    5 minutes ago

  Model
    architecture        llama
    parameters          3.2B
    context length      131072
    quantization        Q4_K_M

ollama show tells you parameter count, context length and quantization, which helps you judge memory use. Add --modelfile to print the Modelfile the model was built from.

Remove, Copy and Stop

ollama rm gemma3            # delete from disk
ollama cp llama3.2 my-llama  # copy under a new name
ollama stop llama3.2        # unload from memory now
deleted 'gemma3'
copied 'llama3.2' to 'my-llama'

Interactive Slash Commands

Inside ollama run you can type commands that start with a slash:

  • /? - show help
  • /set system "..." - set a system prompt for this session
  • /set parameter temperature 0.2 - change a sampling parameter
  • /show info - show model details
  • /clear - clear the conversation context
  • /save name - save the current session as a new model
  • /bye - exit

Multiline Input

Wrap text in triple quotes to paste several lines at once:

>>> """
... Translate to French:
... Good morning, how are you?
... """
Bonjour, comment allez-vous ?
(Sample response.)

Command Cheat Sheet

  • ollama serve - start the server manually
  • ollama pull <model> - download
  • ollama run <model> [prompt] - chat or one-shot answer
  • ollama list / ollama ps - downloaded / loaded models
  • ollama create <name> -f Modelfile - build a custom model
  • ollama push <user>/<model> - publish to ollama.com

Frequently asked questions

How do I delete a model in Ollama?

Run ollama rm followed by the model name, for example ollama rm gemma3. This frees the disk space.

How do I unload a model from GPU memory?

Run ollama stop <model>, or set keep_alive to 0 in an API request. Models also unload automatically after the keep-alive time.

How do I see which models are running?

Use ollama ps. It lists loaded models, their memory size and whether they run on CPU or GPU.