Skip to content
C.W.K.
Stream
Lesson 02 of 05 · published

Pull and Run Models

~22 min · ollama, models

Level 0Downloader
0 XP0/41 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

The model:tag namespace

Every Ollama model is addressed as name:tag. The default tag (whatever ollama pull qwen2.5 resolves to) is a sensible quantization picked by the model maintainers. To pin a specific quantization or size, use the explicit tag form.

Example: qwen2.5:7b-instruct-q5_K_M reads as:

  • qwen2.5 — model family
  • 7b — parameter size
  • instruct — variant (instruction-tuned, not base)
  • q5_K_M — quantization

Pulling and running

ollama pull downloads the model blobs (layered like Docker layers — same blob shared across tags is downloaded once). ollama run starts an interactive chat REPL and pulls the model first if you don't have it. Both commands resume on partial downloads.

Where models live

On macOS: ~/.ollama/models/. On Linux: /usr/share/ollama/.ollama/models/. Move them to an external drive with the OLLAMA_MODELS environment variable — useful when your boot drive is small.

Code

Pull, run, list, inspect·bash
# Pull the default tag
ollama pull qwen2.5

# Pull a specific quant
ollama pull qwen2.5:7b-instruct-q5_K_M

# Run interactively (pulls if missing)
ollama run qwen2.5
# /bye to exit, /? for help

# List installed models with sizes
ollama list

# Inspect a specific model
ollama show qwen2.5:7b
ollama show qwen2.5:7b --modelfile

# Currently loaded models + memory usage
ollama ps
Move models to external storage·bash
# The daemon reads this at startup, so the order matters:
# set it, restart Ollama, and only then pull.

# 1. Persist it where the daemon will see it (macOS / launchd)
launchctl setenv OLLAMA_MODELS /Volumes/ExternalSSD/ollama-models
#    Linux (systemd):
#      sudo systemctl edit ollama.service
#      Environment="OLLAMA_MODELS=/mnt/ssd/ollama-models"

# 2. Restart the daemon so it picks the new store up. Use the line that
#    matches how you installed it — the install lesson's macOS path is
#    Homebrew, and the osascript form only works for the desktop app.
brew services restart ollama                    # Homebrew (macOS)
# osascript -e 'tell application "Ollama" to quit'; open -a Ollama   # app
# sudo systemctl daemon-reload && sudo systemctl restart ollama       # Linux

# 3. Confirm the store moved, THEN re-pull
ollama list                 # expect an empty list at the new location
ollama pull qwen2.5:7b

# `export` alone only affects the shell you typed it in — the daemon
# is a separate, already-running process and never sees it.

External links

Exercise

Pull two flavors of the same model: the default tag and an explicit larger quantization. Run ollama list and ollama show on both. Note the size difference, and the context length each one reports. That number is the architecture's maximum, not the window a single request gets: Ollama's runtime default is far smaller unless the model or your options raise it, which is why num_ctx has its own lesson in the API track.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign in — Please sign in to comment.

No comments yet — be the first.