An Ollama model name without a tag resolves to :latest, and :latest can change under you when the publisher updates the model. Pulling with an explicit tag pins the version, so a script or a demo runs the same model next week as it did today.
What you need
- Ollama installed and running
- The model name you want to pin
- The tag list for that model from ollama.com/library
Step 1: Find the exact tag
Open the model page on ollama.com/library and note the tag you want, for example qwen2.5-coder:7b or llama3.2:3b. Tags usually carry the size or the quantization.
Step 2: Pull with the explicit tag
Run ollama pull with the full name and tag, for example ollama pull qwen2.5-coder:7b. The download is a one-time cost; later runs reuse the file.
Step 3: Confirm the pinned model is installed
Run ollama list and check the exact tagged name appears. Use that full tagged name in every script and command, never the bare model name.
Worked example: synthetic pinned pull
The table below is a synthetic example. It shows the expected result of pinning a tag; no pull was run.
| Name used | Resolves to | Stable later? |
|---|---|---|
| llama3.2 | :latest at pull time | No, may change |
| llama3.2:3b | The 3B tagged release | Yes |
| qwen2.5-coder:7b | The 7B coder release | Yes |
Expected result (UNTESTED). the bare name resolves to whatever :latest points at, while the tagged pulls resolve to fixed releases that stay the same on later runs. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- A pinned tag does not freeze the weights if the publisher re-uploads under the same tag; check the model page if an answer changes.
- Tags differ between models, so copy the tag from the library page rather than guessing it.
- Old tags can be removed from the library, so keep a note of which tag a project depends on.
