Sub topic 6
Pulling, listing, inspecting, and removing models
This chapter assumes you have installed Ollama and the server is running. It also assumes you have run a model once with ollama run, and that you know what a tag such as 3b or q4_K_M roughly means. Chapter-level detail on quantization comes later. Here the focus is the lifecycle of a model on disk: how it arrives, how you see it, how you inspect it, and how you get rid of it.
What pulling actually downloads
A model in the Ollama library is not one big file. It is a manifest plus several layers. A manifest is a small JSON document that lists the layers. The layers typically include the weights (a GGUF file), the prompt template, the default parameters, a system prompt if there is one, and the license text.
Each layer is stored as a blob named by its SHA-256 digest. This is content-addressed storage, and it has two practical effects:
- A layer that two models share is stored once. Two tags that differ only in their system prompt reuse the same multi-gigabyte weights blob.
- A pull can be verified and resumed. If a download is interrupted, running the same
pullagain continues from the layers already on disk.
The core commands
These are the six commands you will use most. Run them in a terminal with the server running.
ollama pull llama3.2
ollama run llama3.2
ollama list
ollama ps
ollama show llama3.2
ollama rm llama3.2Pulling
ollama pull NAME[:TAG] downloads a model without starting a chat. If you leave off the tag, Ollama uses latest. The latest tag is a convention chosen by the model's publisher. It usually points to a small, mid-quality quantization, but it is not guaranteed to be the best fit for your machine.
ollama pull llama3.2
ollama pull llama3.2:1b
ollama pull llama3.2:3b-instruct-q8_0Pulling a model you already have is safe. Ollama fetches the current manifest and downloads only layers whose digests changed. This is how you pick up an updated latest. Run ollama run on a name you have not pulled and it pulls first, so an explicit pull is mainly useful for scripting and for downloading ahead of time.
You can also pull from a different namespace, such as a community upload, with user/model:tag. Treat third-party models like any downloaded software. Check the license and who published it.
Listing
ollama list shows every model in the local store.
NAME ID SIZE MODIFIED
llama3.2:latest a80c4f17acd5 2.0 GB 3 minutes ago
llama3.2:1b baf6a787fdff 1.3 GB 2 days agoThe columns mean:
- NAME is the model name and tag. Each tag is its own entry.
- ID is a short form of the manifest digest. Two names with the same ID are the same model under different tags.
- SIZE is the size on disk of that model's layers.
- MODIFIED is when you pulled or created it.
The SIZE column adds up per model. If two models share a layer, the sum of the column is larger than the real disk use.
Checking what is loaded
ollama list is about disk. ollama ps is about memory. It shows models currently loaded for the server to answer requests.
NAME ID SIZE PROCESSOR UNTIL
llama3.2:latest a80c4f17acd5 3.5 GB 100% GPU 4 minutes from nowTwo columns matter most when you diagnose performance:
- SIZE is the memory the loaded model uses, including the context buffer. It is usually larger than the size on disk.
- PROCESSOR shows where the model runs.
100% GPUis the fast case. A split such as40%/60% CPU/GPUmeans the model did not fit in GPU memory and part of it runs on the CPU, which is much slower.100% CPUmeans no GPU is being used.
UNTIL is the keep-alive timer. By default a model stays loaded for 5 minutes after its last request, then the server unloads it. The next request pays the load time again. To unload a model immediately, run ollama stop llama3.2.
Inspecting
ollama show NAME prints the model's metadata without loading it.
Model
architecture llama
parameters 3.2B
context length 131072
embedding length 3072
quantization Q4_K_M
Parameters
stop "<|start_header_id|>"
stop "<|end_header_id|>"
stop "<|eot_id|>"
License
LLAMA 3.2 COMMUNITY LICENSE AGREEMENT
...Read it for these facts:
- parameters and quantization tell you how much memory to expect.
- context length is the maximum the model supports. It is not the context size Ollama uses by default. The server picks its own default
num_ctx, which is often much smaller, and you can override it. Raising it increases memory use. - Parameters lists defaults that ship with the model, such as stop tokens.
Flags print one section in full, which is useful in scripts:
ollama show llama3.2 --modelfile
ollama show llama3.2 --parameters
ollama show llama3.2 --template
ollama show llama3.2 --system
ollama show llama3.2 --license--modelfile is the most useful. It prints a Modelfile that reproduces the model, including a FROM line with the path to the weights blob. You will use that when you build customized models in a later chapter.
Copying and removing
ollama cp SOURCE DESTINATION creates a second name for an existing model. It copies only the manifest, so it uses almost no disk space. It is a cheap way to make a stable alias or to start from a model before customizing it.
ollama cp llama3.2 my-llamaollama rm NAME[:TAG] deletes a model from the store.
ollama rm my-llama
ollama rm llama3.2:1bRemoval deletes the manifest first. It then deletes only the blobs that no other manifest references. After the cp example above, removing my-llama frees nothing, because llama3.2 still points at the same weights. Removing the last name that uses a blob frees the space.
Where the files live
Models are stored in a directory with two subfolders, manifests/ and blobs/. The default location depends on how you installed Ollama.
| Platform | Default model directory |
|---|---|
| macOS | `~/.ollama/models` |
| Linux (systemd service) | `/usr/share/ollama/.ollama/models` |
| Windows | `C:\Users\<user>\.ollama\models` |
Do not edit or delete files in blobs/ by hand. A blob with a missing manifest, or a manifest pointing to a missing blob, leaves the store in an inconsistent state. Use ollama rm. Changing the storage location is a server setting, covered in the configuration chapter.
Common errors
pull model manifest: file does not exist: The name or tag is wrong. Check the library page for the exact tag.no space left on device: Large models need room in the model directory's filesystem, not just your home directory. Check free space on the volume that holds the store, and remove models you no longer use.could not connect to ollama server: The server is not running, so the CLI has nothing to talk to. Start it, then retry.- A pull stalls or fails midway: Run the same command again. Completed layers are kept and the download resumes.
listshows a model you cannot run well: Compare its SIZE with your free RAM or VRAM, then checkPROCESSORinollama pswhile it runs.
Exercise
Exercise
You run ollama cp llama3.2 work-model, then ollama rm llama3.2. Does work-model still run, and how much disk space is freed? What changes if you then run ollama rm work-model?
Show answer
work-model still runs. Both names reference the same weights blob through their manifests, and rm deletes a blob only when no remaining manifest references it. Removing llama3.2 frees almost nothing, since only its manifest goes away. Removing work-model afterwards deletes the last reference, so the blobs are deleted and the full model size is freed.
Exercise
A model is listed by ollama list but ollama ps shows nothing. Later, ollama ps shows PROCESSOR as 30%/70% CPU/GPU while the model is running. What does each observation tell you?
Show answer
The empty ollama ps means the model is on disk but not loaded into memory, either because it has not been requested yet or because the keep-alive timer expired. The 30%/70% CPU/GPU split means the model plus its context buffer did not fit entirely in GPU memory, so part of it runs on the CPU and generation will be slower. Fixes are a smaller model, a lower quantization, or a smaller num_ctx.