Back to roadmaps ollama Course

Ollama CLI Commands and Parameters Cheat Sheet

This quick reference guide summarizes CLI actions and Modelfile configurations.


1. CLI Commands Quick Reference

Command Action Description Example Usage
ollama run <model> Pull and start interactive terminal session ollama run qwen2.5:7b
ollama pull <model> Download model from registry ollama pull llama3
ollama list List downloaded local models ollama list
ollama rm <model> Delete local model file ollama rm llama3
ollama create <name> Build custom model from Modelfile ollama create my-bot -f ./Modelfile
ollama show <model> Inspect model parameters info ollama show qwen2.5
ollama ps View currently running model info ollama ps

2. Modelfile Parameters Reference

Define these parameters under the PARAMETER directive to customize model runtime behavior:

Parameter Key Purpose and Description Recommended Default
num_ctx Set the context window token size 4096 or 8192
temperature Control model creativity levels 0.7
top_p Top probability nucleus sampling 0.9
top_k Reduce random word choices 40
num_predict Set maximum tokens response output -1 (infinite) or 1024
num_gpu Set layers to offload to GPU Let Ollama set this
repeat_penalty Prevent model repeating identical words 1.1
Published on Last updated: