Sub topic 6
Pulling, Listing, Inspecting, and Removing Models
This chapter covers the five commands you use to manage models on disk and in memory. It assumes you have installed Ollama, the server is running, and you have already run a model once. You should also know how model names and tags look, such as llama3.2:3b.
The model lifecycle
Ollama keeps downloaded models in a local store. A model can be absent, stored on disk, or loaded in memory. Each command moves a model between these states or reports on them.
The commands
ollama pull llama3.2
ollama run llama3.2
ollama list
ollama ps
ollama show llama3.2
ollama rm llama3.2Pull
ollama pull downloads a model without starting a chat. Models are split into layers, so a second pull of the same name only fetches layers that changed. If you omit the tag, Ollama uses latest. Pulling ahead of time is useful on a slow connection or before you go offline. ollama run also pulls automatically if the model is missing.
List
ollama list shows every model on disk. The columns are the name with its tag, an ID, the size on disk, and when it was last modified. Use it to check which tags you actually have, because llama3.2 and llama3.2:1b are separate entries.
Show running models
ollama ps shows only models currently loaded in memory. Its output includes the memory used and whether the model runs on the GPU, the CPU, or a split of both. A model leaves this list after its keep-alive period ends, which defaults to five minutes of inactivity. A model can be on disk and not appear here.
Inspect
ollama show llama3.2 prints details about one model. Expect to see the architecture, parameter count, context length, embedding length, and quantization level. It also lists any default parameters and the system prompt. Use it to confirm that a tag has the quantization you expected before you rely on it.
Remove
ollama rm llama3.2 deletes the model from disk. Include the tag if you want to remove only one variant, for example ollama rm llama3.2:1b. Layers shared with other models stay until nothing uses them.
Common errors
- "model not found" on pull: The name or tag is misspelled, or the tag does not exist in the library. Check the model's page for valid tags.
- Model missing from
ollama ps: It was unloaded after keep-alive, or it never loaded. This is normal and does not mean it was deleted. Checkollama list. - Disk fills up: Each model is several gigabytes. Run
ollama list, then remove variants you no longer use. - Removing the wrong tag:
ollama rm llama3.2targetslatest. Other tags remain.
Exercise
You ran a model five minutes ago and now ollama ps shows nothing, but you want to know whether the model is still downloaded. Which command do you use, and why did ollama ps come up empty?
Show answer
Use ollama list, which shows models stored on disk. ollama ps came up empty because it shows only models loaded in memory, and the model was unloaded after the default keep-alive of five minutes of inactivity.