Skip to content
AI Stack Nest
1 min read · updated 17 Nov 2026

Ollama command cheat sheet

The Ollama commands and settings you will use every day, with one-line explanations.

Everyday commands

CommandWhat it does
ollama run MODELChat with a model in the terminal (downloads it first if needed)
ollama pull MODELDownload a model without starting a chat
ollama listShow installed models
ollama psShow loaded models and whether they use the GPU or CPU
ollama stop MODELUnload a model from memory now
ollama rm MODELDelete a model to free disk space
ollama serveStart the server by hand

Inside a chat

InputWhat it does
/byeLeave the chat
/set parameter num_ctx 8192Change the context length for this chat

Settings (environment variables)

VariableEffect
OLLAMA_HOST=0.0.0.0:11434Listen on all network interfaces instead of only 127.0.0.1
OLLAMA_CONTEXT_LENGTHDefault context length (the default is 4096 tokens)
OLLAMA_KEEP_ALIVEHow long a model stays loaded after the last request (default 5 minutes)
OLLAMA_MODELSFolder where models are stored
HTTPS_PROXYProxy for downloads (avoid HTTP_PROXY)

API

The local API is at http://localhost:11434. Endpoints listed in the official documentation include /api/chat and an OpenAI-compatible /v1/chat/completions.

curl http://localhost:11434/api/chat -d '{"model":"llama3.1","messages":[{"role":"user","content":"Say hello"}],"stream":false}'

Source: official Ollama documentation and FAQ, read on 2026-11-17.

More cheat sheets

Not sure your computer can run a model? Use the will-it-run checker.