- Core commands:
ollama runstarts a model,ollama pulldownloads it,ollama lsshows what’s on disk,ollama psshows what’s loaded in memory. - Key distinction:
lslists all downloaded models;pslists only models currently loaded on GPU/CPU with their VRAM usage. - Management:
ollama rmdeletes models,ollama stopunloads them from memory,ollama createbuilds custom models from Modelfiles. - Server control:
ollama servestarts the API server manually;ollama launchstarts the desktop app on macOS.
Ollama’s command-line interface gives you direct control over local language models. Every command follows the pattern ollama <command> [arguments]. This reference covers each command with working examples and explains what the output means.
Quick Reference Table
| Command | Purpose | Example |
|---|---|---|
run |
Load and interact with a model | ollama run llama3.3 |
pull |
Download a model | ollama pull qwen3:8b |
ls |
List models on disk | ollama ls |
ps |
Show loaded models | ollama ps |
rm |
Delete a model | ollama rm mistral:7b |
stop |
Unload a model from memory | ollama stop llama3.3 |
create |
Build a custom model | ollama create mymodel -f Modelfile |
serve |
Start the API server | ollama serve |
launch |
Open desktop app (macOS) | ollama launch |
ollama run
Loads a model into memory and starts an interactive chat session. If the model isn’t downloaded, Ollama pulls it first.
ollama run llama3.3:70b
Output shows the model loading, then drops you into a chat prompt:
>>> Send a message (/? for help)
Type your prompt and press Enter. The model streams its response. Type /bye to exit, /help for commands, or /clear to reset context.
Use --verbose to see load times and memory usage:
ollama run llama3.3:70b --verbose
For single prompts without interactive mode, pipe input:
echo "Explain async/await" | ollama run mistral:7b
The AI models database shows that Llama 3.3 70B needs ~40 GB VRAM at 4-bit quantization. Check requirements before running large models locally.
ollama pull
Downloads a model from the Ollama library without starting it. Essential for pre-loading models or updating to newer versions.
ollama pull qwen3:8b
Output shows download progress with size and speed:
pulling manifest
pulling 8934d96d3f08... 100% ▕████████████████▏ 4.7 GB
pulling 8c17c2ebb0ea... 100% ▕████████████████▏ 7.0 KB
pulling 7c23fb36d801... 100% ▕████████████████▏ 4.8 KB
pulling 2e0493f67d0c... 100% ▕████████████████▏ 59 B
verifying sha256 digest
writing manifest
success
Specify tags explicitly to control quantization level:
ollama pull gemma3:4b-q8_0
Without a tag, Ollama pulls the default (usually the most compatible quantization for your hardware).
ollama ls
Lists every model stored on disk with size and last modified date. This shows your model library, not what’s currently running.
ollama ls
Output format:
NAME ID SIZE MODIFIED
llama3.3:70b 365c0bd3c000 40 GB 3 hours ago
qwen3:8b 8934d96d3f08 4.7 GB 2 days ago
mistral:7b f974a74358d6 4.1 GB 5 days ago
The SIZE column shows disk space used. The ID is the model’s unique hash. Models with identical IDs are the same weights, even if tagged differently.
Add --json for machine-readable output:
ollama ls --json
ollama ps
Shows models currently loaded in memory (GPU or CPU) with their resource usage. This is the command that answers “what’s running right now?”
ollama ps
Output when models are loaded:
NAME ID SIZE PROCESSOR UNTIL
llama3.3:70b 365c0bd3c000 40 GB 100% GPU 4 minutes from now
qwen3:8b 8934d96d3f08 5.2 GB 100% GPU 4 minutes from now
Output when nothing is loaded:
NAME ID SIZE PROCESSOR UNTIL
Key difference from ls: ollama ls lists downloaded models; ollama ps lists loaded models. A model can be on disk (ls) without being in memory (ps).
The PROCESSOR column tells you if the model is on GPU or CPU. 100% GPU means fully offloaded to GPU. 48% GPU, 52% CPU means split across both. According to the official FAQ, you can also check GPU usage with nvidia-smi (NVIDIA), rocm-smi (AMD), or Activity Monitor (macOS) while a model is loaded.
The UNTIL column shows when Ollama will automatically unload the model from memory due to inactivity (default: 5 minutes).
ollama rm
Deletes a model from disk permanently. Frees up storage but requires re-downloading if you need the model again.
ollama rm mistral:7b
Output confirms deletion:
deleted 'mistral:7b'
To remove multiple models:
ollama rm model1 model2 model3
Ollama won’t delete a currently loaded model. Stop it first with ollama stop, then run rm.
ollama stop
Unloads a model from memory without deleting it from disk. Frees VRAM/RAM immediately.
ollama stop llama3.3:70b
No output on success. Run ollama ps afterward to confirm the model is gone from memory. Useful before switching to a different model on systems with limited VRAM—for example, unloading a 40 GB model before loading another large model.
The VRAM calculator helps determine if you can fit multiple models in memory simultaneously or need to stop one first.
ollama create
Builds a custom model from a Modelfile. Modelfiles define base models, system prompts, parameters, and custom behavior.
ollama create myassistant -f ./Modelfile
Output shows the build process:
transferring model data
using existing layer sha256:8934d96d3f08
using existing layer sha256:8c17c2ebb0ea
using existing layer sha256:7c23fb36d801
writing layer sha256:9f89e0c41b58
writing manifest
success
Example Modelfile:
FROM llama3.3:70b
SYSTEM "You are a code reviewer focused on security."
PARAMETER temperature 0.3
PARAMETER top_p 0.9
After creating, run your custom model like any other:
ollama run myassistant
The Modelfile reference documents all available directives.
ollama serve
Starts the Ollama API server manually. The desktop app starts the server automatically on macOS and Windows, but Linux users or those running headless setups need this command.
ollama serve
Output shows the server listening:
Listening on 127.0.0.1:11434 (version 0.x.x)
The server exposes an OpenAI-compatible API at http://localhost:11434. Run this in a separate terminal or as a background service, then use ollama run, call the API directly, or connect tools like Continue, Open WebUI, or LangChain.
To bind to a different address:
OLLAMA_HOST=0.0.0.0:8080 ollama serve
On Linux, set up a systemd service so serve starts on boot. The installation guide covers systemd configuration.
ollama launch
Opens the Ollama desktop application on macOS. Only available on macOS; not applicable to Linux or Windows.
ollama launch
Launches the native app in your Applications folder. No output—the GUI opens. This is equivalent to clicking the Ollama icon in Finder.
ollama signin / ollama signout
Authenticates with Ollama’s service for private model registries or team libraries. Required only if you’re accessing models hosted on private Ollama registries, not for public models.
ollama signin
Prompts for credentials. After signing in, pull and push commands can access your private models.
ollama signout
Logs out and clears stored credentials. Public models remain accessible after signing out.
Platform Differences
macOS
The desktop app starts the server automatically. The serve command is optional unless running headless. ollama launch opens the GUI app. Ollama uses Metal for GPU acceleration on Apple Silicon (M1/M2/M3/M4) and AMD GPUs.
Windows
The desktop app handles server startup. Manual serve is needed only for custom configurations or running as a service. GPU support requires NVIDIA GPUs with CUDA or AMD GPUs with ROCm (ROCm support is experimental as of late 2024).
Linux
No desktop app exists. Run ollama serve in a terminal or configure it as a systemd service. GPU support requires NVIDIA drivers and CUDA toolkit, or AMD drivers and ROCm. The server runs on 127.0.0.1:11434 by default; set OLLAMA_HOST to bind elsewhere.
Checking GPU Usage
To verify a model loaded on GPU rather than CPU, use ollama ps and check the PROCESSOR column. 100% GPU confirms full GPU offload. If you see a percentage split like 60% GPU, 40% CPU, some layers are on CPU due to insufficient VRAM.
For deeper inspection:
- NVIDIA: Run
nvidia-smiin a separate terminal while a model is loaded. Look for the Ollama process in the process list and its memory usage. - AMD: Run
rocm-smiorradeontop(Linux). Check VRAM usage while the model is running. - macOS: Open Activity Monitor, switch to the GPU tab, and look for the Ollama process. GPU memory usage appears under “GPU Memory” or the separate GPU History graph.
If a model isn’t using the GPU, common causes include insufficient VRAM (the model is too large for your GPU), missing drivers, or incorrect Ollama configuration. The VRAM requirements guide lists memory needs for every major model at different quantization levels.
Frequently Asked Questions
What’s the difference between ollama ls and ollama ps?
ollama ls lists all models stored on disk—your model library. ollama ps lists only models currently loaded in memory (GPU or CPU). A model can be downloaded (ls) but not running (ps). After running ollama stop, a model disappears from ps but remains in ls.
How do I unload a model from memory without deleting it?
Run ollama stop <model-name>. This frees VRAM and RAM immediately without removing the model from disk. Useful when switching between large models on systems with limited memory. For example, ollama stop llama3.3:70b unloads the 40 GB model, freeing space for another.
How do I change the default host or port for the Ollama server?
Set the OLLAMA_HOST environment variable before running ollama serve. For example, OLLAMA_HOST=0.0.0.0:8080 ollama serve binds to all interfaces on port 8080. On Linux, add this to your systemd service file or shell profile to make it persistent. The default is 127.0.0.1:11434.
Can I run multiple models at once?
Yes, if you have enough VRAM or RAM. Each ollama run command in a separate terminal loads another model. Check ollama ps to see all loaded models and their memory usage. For example, you can run Qwen3 8B (~5 GB VRAM) and Mistral 7B (~4.5 GB VRAM) simultaneously on a 16 GB GPU. The self-hosting calculator helps estimate whether local hosting makes sense for your usage pattern.
What happens if I try to run a model that’s too large for my GPU?
Ollama splits the model between GPU and CPU. ollama ps shows the split in the PROCESSOR column, like 60% GPU, 40% CPU. This works but runs slower than full GPU offload because CPU layers create a bottleneck. If you see a split, consider a smaller model or a more aggressive quantization (Q4 instead of Q8). The best local models guide recommends models by VRAM tier.
How do I update an existing model to the latest version?
Run ollama pull <model-name> again. Ollama checks for updates and downloads only new or changed layers, not the entire model. For example, ollama pull llama3.3:70b fetches any updates published since your last pull. Version tags (like llama3.3:70b-v2) are immutable, so pull on a tagged version won’t change unless you specify a new tag.
