Ollama CLI Cheatsheet - Local LLM Runtime Full Reference

All Ollama local-model commands in one place — from pull/run to custom Modelfiles, serve, and multi-model management — organized by scenario. Copy and go.

AI CLI·25 commands·Last updated 2026-08-21

Run & Chat 5

ollama run llama3.1
Pull and enter interactive chat
ollama run llama3.1 "summarize in one line"
Single prompt then exit
ollama run -m
Set run parameters (e.g. context)
ollama serve
Start the local inference server (default 11434)
ollama ps
Show models currently running

Model Management 5

ollama pull <model>
Pull a model locally
ollama push <model>
Push a model to the registry
ollama list
List installed models
ollama rm <model>
Remove a local model
ollama cp <src> <dst>
Copy a model (rename/branch)

Modelfile 5

FROM llama3.1
Base model in a Modelfile
PARAMETER temperature 0.7
Set sampling temperature
SYSTEM "You are a rigorous assistant"
Set the system prompt
TEMPLATE """{{ .Prompt }}"""
Custom chat template
ollama create mymodel -f Modelfile
Build a model from a Modelfile

Serve & Port 5

ollama serve
Start the inference server in foreground
OLLAMA_HOST=0.0.0.0 ollama serve
Allow LAN access
curl http://localhost:11434/api/generate
Call the generate API
ollama show <model>
Inspect model metadata/template
ollama embeddings
Generate text embeddings

Tips 5

ollama run llama3.1 -c 4096
Cap context to save VRAM
ollama list | head
Quick peek at installed models
ollama run --verbose
Show token-speed diagnostics
ollama ps to watch VRAM
Monitor VRAM with ollama ps
ollama run <m> "translate..."
Use a local model as an offline translator

Tips

  • Ollama is the de-facto local runtime; a "local model" entry covers privacy/offline/zero-API-cost cases that complement cloud CLIs.
  • Bake behavior into a Modelfile SYSTEM/PARAMETER — more stable and versionable than repeating system instructions in prompts.
  • Tight on VRAM? Cap context with `-c` or watch parallel usage with `ollama ps` to avoid OOM.
  • For programmatic use run `ollama serve` + the REST API instead of interactive mode.

Official References

Commands are compiled from the official docs below. Click to verify the latest usage.

Maintained by LaoHand

Publicly updated on Aug 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us