Ollama cheatsheet

Ollama: Running models

12 common Ollama tasks.

Check the Ollama version

Print the installed Ollama version.

ollama --version

Download a model

Download a model from the Ollama library without running it.

ollama pull llama3.2

Chat with a model

Start an interactive chat. The model is downloaded first if needed. Type /bye to leave.

ollama run llama3.2

Ask a single question

Answer one prompt and exit, which suits scripts.

ollama run llama3.2 "Explain recursion in one sentence."

Summarize a file

Pass the contents of a file inside the prompt.

ollama run llama3.2 "Summarize this: $(cat notes.txt)"

Ask about an image

Use a multimodal model and give the path to an image in the prompt.

ollama run llava "Describe this image: ./photo.png"

List downloaded models

Show the models on this machine with their sizes.

ollama list

See loaded models

Show models currently loaded in memory and whether they use the GPU.

ollama ps

Show model details

Print a model's parameters, template and license.

ollama show llama3.2

Unload a model

Free the memory used by a loaded model.

ollama stop llama3.2

Copy a model

Create another name for an existing model.

ollama cp llama3.2 my-llama

Delete a model

Remove a model from disk.

ollama rm llama3.2

Caution: The model has to be downloaded again to use it. Large models take a long time.

Was this page helpful?