ollama(1)
Ollama is a command-line tool to run large language models locally on your machine.
Synopsis
ollama [COMMAND] [OPTIONS]Description
Ollama lets you download, run, and interact with large language models (LLMs) like Llama, Mistral, and others directly on your local machine without requiring cloud services. It provides both a command-line interface and a REST API for programmatic access.
Models are stored locally and run with GPU acceleration when available. You can pull pre-built models from the Ollama library, customize them with Modelfiles, and manage multiple model versions.
Common options
| Flag | What it does |
|---|---|
serve | Start the Ollama API server (listens on localhost:11434 by default) |
run <model> | Download and start an interactive chat session with a model |
pull <model> | Download a model from the registry without running it |
push <model> | Upload a model to a registry (requires authentication) |
list | Show all locally installed models and their sizes |
rm <model> | Delete a model from local storage |
show <model> | Display model information, parameters, and template details |
create -f <file> <name> | Build a custom model using a Modelfile |
--version | Print the Ollama version number |
Examples
Download and start an interactive chat with the Llama 2 model
ollama run llama2Download the Mistral model without entering interactive mode
ollama pull mistralStart the Ollama API server on localhost:11434 for programmatic access
ollama serveDisplay all downloaded models with their sizes and last modified time
ollama listGenerate text using the API (requires ollama serve running)
curl http://localhost:11434/api/generate -d '{"model":"llama2","prompt":"Hello"}'Delete the Llama 2 model from local storage
ollama rm llama2Create a custom model using a Modelfile and name it 'mycustom'
ollama create -f Modelfile mycustomShow detailed information about the Mistral model including parameters and template
ollama show mistral