Ollama Model Management: Pull, Create, Copy, and Remove

TL;DR

# Pull a model
ollama pull llama3.2:3b

# List all local models
ollama list

# Show model details (parameters, template, license)
ollama show llama3.2:3b

# Copy/rename a model
ollama cp llama3.2:3b my-llama

# Remove a model
ollama rm llama3.2:3b

# Check disk usage of model storage
du -sh /usr/share/ollama/.ollama/models/

Ollama stores models as layered blobs, similar to Docker images. Understanding how models are stored, tagged, and shared lets you manage disk space effectively and avoid downloading duplicate data.

Pulling Models

Basic Pull

ollama pull llama3.2

This pulls the default tag, which is :latest. To pull a specific size or quantization:

ollama pull llama3.2:3b
ollama pull llama3.2:1b
ollama pull llama3.1:70b

Model Tags

Tags in Ollama follow the format model:tag. The tag typically encodes the parameter count and sometimes the quantization level:

ollama pull qwen2.5:7b
ollama pull qwen2.5:7b-instruct-q4_K_M
ollama pull qwen2.5:72b-instruct-q4_K_M

When no tag is specified, Ollama defaults to the recommended variant for that model family.

Common Models and Their Sizes

ModelTagParametersDownload SizeVRAM Usage
llama3.21b1B1.3 GB~1.5 GB
llama3.23b3B2.0 GB~3 GB
llama3.18b8B4.7 GB~6 GB
llama3.170b70B40 GB~44 GB
qwen2.57b7B4.7 GB~6 GB
qwen2.5-coder7b7B4.7 GB~6 GB
mistral7b7B4.1 GB~5.5 GB
phi414b14B9.1 GB~11 GB
gemma29b9B5.4 GB~7 GB
deepseek-r17b7B4.7 GB~6 GB
nomic-embed-textlatest137M274 MB~0.3 GB

Download sizes are approximate and vary by quantization. VRAM usage includes KV cache overhead at default context length.

Pull by Digest

For exact reproducibility, pull by SHA256 digest:

ollama pull llama3.2@sha256:abcdef1234567890...

This guarantees the exact same model binary regardless of whether the tag has been updated.

Pull Progress and Resumption

Ollama supports resuming interrupted downloads. If a pull is interrupted (network drop, Ctrl+C), run the same ollama pull command again. It picks up where it left off.

To monitor pull progress programmatically via the API:

curl -s http://localhost:11434/api/pull \
  -d '{"name": "llama3.2:3b"}' | jq .

Listing Models

Basic List

ollama list

Output:

NAME                    ID              SIZE    MODIFIED
llama3.2:3b             a80c4f17acd5    2.0 GB  3 days ago
qwen2.5-coder:7b        2b0496514074    4.7 GB  1 day ago
nomic-embed-text:latest 0a109f422b47    274 MB  5 days ago

Listing Running Models

ollama ps

Shows currently loaded models, their VRAM usage, and how long until they are unloaded:

NAME            ID              SIZE    PROCESSOR   UNTIL
llama3.2:3b     a80c4f17acd5    3.2 GB  100% GPU    4 minutes from now

Inspecting Models

The ollama show command reveals detailed model information:

# Full model info
ollama show llama3.2:3b

# Just the parameters
ollama show llama3.2:3b --parameters

# Just the system prompt
ollama show llama3.2:3b --system

# The chat template
ollama show llama3.2:3b --template

# The Modelfile (for custom models)
ollama show my-model --modelfile

# License information
ollama show llama3.2:3b --license

The --modelfile flag is particularly useful for custom models. It outputs a valid Modelfile that can recreate the model, serving as a form of documentation and backup.

Understanding Model Layers

Ollama models are composed of layers, similar to Docker images:

ollama show llama3.2:3b --modelfile

Output includes lines like:

FROM @sha256:...    # The model weights
TEMPLATE "..."      # Chat template
PARAMETER ...       # Default parameters
SYSTEM "..."        # Default system prompt
LICENSE "..."       # License text

Multiple models can share the same weight layer. For example, if you create a custom model from llama3.2:3b, only the new metadata layers are stored. The weights are not duplicated.

Copying and Renaming Models

The ollama cp command creates a new reference to an existing model:

ollama cp llama3.2:3b my-project-llm

This is fast because it does not copy the weight files. It creates a new tag pointing to the same underlying layers. Use this to:

  • Give models project-specific names
  • Create a stable reference before updating the base model
  • Prepare models for pushing to a registry

Removing Models

Remove a Single Model

ollama rm llama3.2:3b

This removes the model tag. If no other tags reference the same layers, the weight files are also deleted, freeing disk space.

Remove Multiple Models

ollama rm llama3.2:3b mistral:7b phi4:14b

Bulk Cleanup

To remove all models matching a pattern (no built-in glob support, use a shell loop):

# Remove all custom models starting with "test-"
ollama list | awk '/^test-/ {print $1}' | xargs -I {} ollama rm {}

Caution: There is no undo for ollama rm. If you delete a model, you must re-pull or re-create it. For large models (70B+), this means re-downloading tens of gigabytes.

Where Models Are Stored

Ollama stores all model data under a single directory:

OSDefault Path
Linux (systemd service)/usr/share/ollama/.ollama/models/
Linux (manual run)~/.ollama/models/
macOS~/.ollama/models/

The directory structure:

models/
  manifests/
    registry.ollama.ai/
      library/
        llama3.2/
          3b          # Tag manifest (JSON)
  blobs/
    sha256-abc123...  # Actual weight files, templates, etc.

The manifests/ directory contains small JSON files that map tags to blob digests. The blobs/ directory holds the actual data. This is why ollama cp is fast – it only creates a new manifest entry.

Changing the Storage Location

To move model storage to a different drive (useful when /usr is on a small SSD):

# Stop Ollama
sudo systemctl stop ollama

# Move existing models
sudo mv /usr/share/ollama/.ollama/models /mnt/data/ollama-models

# Create symlink
sudo ln -s /mnt/data/ollama-models /usr/share/ollama/.ollama/models

# Start Ollama
sudo systemctl start ollama

Alternatively, set the OLLAMA_MODELS environment variable in the systemd unit file:

sudo systemctl edit ollama

Add:

[Service]
Environment="OLLAMA_MODELS=/mnt/data/ollama-models"

Then reload and restart:

sudo systemctl daemon-reload
sudo systemctl restart ollama

Managing Disk Space

Check Current Usage

# Total model storage
du -sh /usr/share/ollama/.ollama/models/

# Per-blob breakdown (largest files first)
du -h /usr/share/ollama/.ollama/models/blobs/ | sort -rh | head -20

# Size per model (from Ollama)
ollama list

Identifying Unused Models

Models loaded into VRAM stay resident for 5 minutes by default (configurable with OLLAMA_KEEP_ALIVE). To see what is currently loaded:

ollama ps

To find models you have not used recently, check modification times:

ls -lt /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/

The timestamp updates when a model is pulled or used.

Pruning Strategy

A practical approach to keeping disk usage under control:

  1. List everything: ollama list and note which models you actively use
  2. Check sizes: Large models (70B) consume 40+ GB each
  3. Remove unused: ollama rm anything not used in the past two weeks
  4. Prefer smaller quants: If you only need a model for testing, use Q4_K_M instead of Q8_0
  5. Share layers: Create custom models from the same base to avoid duplicate weights

Disk Space Recovery Script

#!/bin/bash
# Show model sizes and prompt for cleanup
echo "Current models:"
ollama list
echo ""
echo "Total disk usage:"
du -sh /usr/share/ollama/.ollama/models/
echo ""
echo "Models not used in 14+ days:"
find /usr/share/ollama/.ollama/models/manifests -type f -mtime +14 2>/dev/null | \
  while read -r f; do
    basename "$(dirname "$f")"/"$(basename "$f")"
  done

Pushing Models to a Registry

If you have an account on ollama.com, you can push custom models:

# First, copy with your namespace prefix
ollama cp my-sysadmin yourname/sysadmin

# Push
ollama push yourname/sysadmin

Before pushing, make sure:

  • The model does not contain proprietary data in the system prompt
  • The base model’s license permits redistribution
  • You have authenticated with ollama.com (follow their auth flow)

Pulling from the API

For automation and scripting, use the HTTP API directly:

# Pull a model
curl -X POST http://localhost:11434/api/pull \
  -H "Content-Type: application/json" \
  -d '{"name": "llama3.2:3b"}'

# List models
curl -s http://localhost:11434/api/tags | jq '.models[] | {name, size}'

# Show model info
curl -s http://localhost:11434/api/show \
  -d '{"name": "llama3.2:3b"}' | jq .

# Delete a model
curl -X DELETE http://localhost:11434/api/delete \
  -d '{"name": "llama3.2:3b"}'

Security Note

Models downloaded from any registry execute locally and process your data. While Ollama library models are curated, always verify the source of third-party models. A malicious Modelfile with a crafted system prompt could instruct the model to exfiltrate data from your prompts if the model is exposed on a network. Keep Ollama bound to localhost (the default) unless you explicitly need network access and have a reverse proxy with authentication in front of it.

Quick Reference

TaskCommand
Pull modelollama pull model:tag
List modelsollama list
Running modelsollama ps
Model infoollama show model:tag
Copy/renameollama cp source dest
Removeollama rm model:tag
Push to registryollama push namespace/model
Storage path/usr/share/ollama/.ollama/models/
Change storageSet OLLAMA_MODELS env var