Before this lesson

This lesson assumes you've already run these in a terminal (not Python), as part of this course's setup:

Terminal window
ollama pull llama3.2
ollama pull llama3.2:1b

ollama pull is a CLI command, not a Python function you'd normally call at runtime: pulling downloads gigabytes of model weights, a one-time setup step, not something a running program does on every call. Python code interacts with models that are already pulled.

The model library and tags

Ollama's model library hosts many model families (Llama, Gemma, Qwen, Mistral, and others), each published under multiple tags: variants of the same family at different sizes or quantization levels. llama3.2 with no tag is shorthand for llama3.2:latest; llama3.2:1b pins the 1-billion-parameter variant specifically.

Smaller tags trade answer quality for speed and footprint: 1b runs faster and fits in less RAM than the full 3.2 (3B-class) tag, at the cost of being noticeably less capable. There's no universally "right" tag, it depends on your hardware and what you're building (Lesson 18 covers this tradeoff in more depth, including quantization itself).

The code, piece by piece

info = ollama.show(model_name)

ollama.show() asks the local server for everything it knows about an already-pulled model: its architecture, parameter count, quantization level, and the raw prompt template it uses internally. This is the same information ollama show llama3.2 prints from the CLI, just structured as a Python object.

info.details.family
info.details.parameter_size
info.details.quantization_level

.details bundles the three numbers most people actually care about day to day: which model family it belongs to, how many parameters it has, and how aggressively it's been quantized (compressed, at a cost to precision, covered in Lesson 18).

for model in ollama.list().models:
...
size_gb = model.size / 1_000_000_000

ollama.list(), from Lesson 1, reports the actual bytes on disk, which is a different number from parameter count: quantization and format details mean two models with similar parameter counts can take up different amounts of space.

Checkpoint

  • Model library: Ollama's hosted catalog of model families.
  • Tag: a specific variant of a family (size, quantization), pinned after a colon; no tag means :latest.
  • ollama pull: a one-time CLI download, not a runtime Python call.
  • ollama.show(): inspect an already-pulled model's architecture, parameter count, and quantization from Python.

If anything here still feels unclear, ask before moving to Lesson 3, where you'll send your first real prompt to a local model.