Ollama guide: run AI models locally, commands, hardware, API and cloud plans
Ollama is the most popular way to run open language models on a personal computer. The project started in mid-2023, is released under the MIT license, and has around 184,000 GitHub stars. It wraps the hard parts of local inference, such as downloading weights, choosing a quantized version that fits your memory and using your GPU, behind a few short commands.
It does two jobs. It is a terminal chat tool for trying models, and it is a local model server that other apps call through an API. The second job is why it appears in so many AI tools' setup guides.
Installing Ollama
| System | How to install |
|---|---|
| macOS | Download the app from ollama.com |
| Windows | Download the installer, or irm https://ollama.com/install.ps1 | iex |
| Linux | curl -fsSL https://ollama.com/install.sh | sh |
| Docker | docker run -d -p 11434:11434 ollama/ollama |
The desktop apps run Ollama in the background and include a simple chat window. On Linux, the install script sets up a system service. Ollama uses Apple silicon GPUs through Metal, NVIDIA GPUs through CUDA and many AMD GPUs through ROCm.
Everyday commands
| Command | What it does |
|---|---|
ollama run llama3.2 | Download if needed, then chat with the model |
ollama pull qwen3 | Download a model without running it |
ollama ls | List downloaded models |
ollama ps | Show models loaded in memory |
ollama stop <model> | Unload a model from memory |
ollama rm <model> | Delete a downloaded model |
ollama serve | Start the server manually |
ollama create <name> -f Modelfile | Build a custom model |
ollama signin | Sign in for cloud models |
ollama launch <agent> | Set up a coding agent to use Ollama |
Models come from the Ollama library at ollama.com/library. Each model has tags for sizes and quantization levels, such as qwen3:8b or gemma3:27b. If you leave the tag off, Ollama pulls the default, which is usually a mid-size, 4-bit quantized version.
Choosing a model for your hardware
The biggest constraint is memory. A model has to fit in RAM, or in GPU memory for full speed.
| Model size | Typical download (4-bit) | Memory to run comfortably |
|---|---|---|
| 1 to 4B parameters | 1 to 3 GB | 8 GB |
| 7 to 9B | 4 to 6 GB | 16 GB |
| 12 to 14B | 8 to 10 GB | 16 to 24 GB |
| 27 to 32B | 16 to 20 GB | 32 GB |
| 70B and up | 40 GB and up | 64 GB or more |
These are rough figures. Longer context windows need more memory on top of the model weights. Macs with Apple silicon do well because the GPU shares the system's unified memory. On a PC, a model that spills out of GPU memory into system RAM runs much slower.
For coding agents, choose a model trained for tool use and coding. Small models answer questions well but tend to fail at multi-step agent work.
The local API
Ollama listens on http://localhost:11434. It has its own REST API, with endpoints such as /api/generate, /api/chat and /api/embed, and an OpenAI-compatible API under /v1. That second one is what makes Ollama easy to plug in: any tool that lets you set an OpenAI base URL can use local models by pointing at http://localhost:11434/v1.
Official client libraries exist for Python and JavaScript. By default the server only accepts connections from your own machine. Set OLLAMA_HOST=0.0.0.0 to accept connections from other machines, and only do that on a trusted network or behind authentication, because the API has no login of its own.
Coding agents and Ollama
The ollama launch command configures supported agents to use Ollama models, with Claude Code, Codex, OpenCode and Droid among the documented options. For other tools, set the base URL yourself:
- Aider:
aider --model ollama_chat/qwen3-coder - OpenCode: add Ollama as a provider with
/connect - Pi and many others: an OpenAI-compatible provider pointing at port 11434
Running an agent locally keeps your code on your machine. The trade-off is quality and speed: the best local coding models are good, but on most laptops they are slower and less reliable than frontier cloud models on large tasks.
Cloud models and plans
In September 2025 Ollama added cloud models, which run large open models on Ollama's servers while keeping the same commands and API. Cloud model names end in -cloud. You sign in with ollama signin and run them like local ones.
| Plan | Price | Included usage | Concurrent requests |
|---|---|---|---|
| Free | $0 | Starter credits | 1 |
| Pro | $20/month or $200/year | $60 | 3 |
| Max | $100/month | $300 | 10 |
| Team | $500/month | $1,000, shared | 10 |
Ollama says it does not log or train on cloud prompts, and that cloud inference runs mostly in US data centers. Local models are unaffected by any of this and stay free.
Customizing with Modelfiles
A Modelfile defines a custom model from a base model:
FROM qwen3:8b
SYSTEM "You are a concise code reviewer. Point out bugs first."
PARAMETER temperature 0.2
PARAMETER num_ctx 16384
Build it with ollama create reviewer -f Modelfile and run it with ollama run reviewer. You can also import GGUF files from Hugging Face this way.
Limits and risks
Hardware sets the ceiling. A laptop cannot run the largest open models at useful speed. Expect slower answers than cloud services on most machines.
Default context length is modest. Many models load with a context window smaller than they support. Raise num_ctx for long documents and agent work, and expect memory use to rise with it.
The API has no authentication. Do not expose port 11434 to the internet.
Model licenses vary. Ollama is MIT licensed, but each model has its own license. Llama, Gemma, Qwen and others carry different terms for commercial use.
Ollama compared with other local options
| Tool | Interface | License | Best for |
|---|---|---|---|
| Ollama | CLI, API, simple app | MIT | Developers and tools that need a local model server |
| LM Studio | Desktop app, API | Proprietary, free | Browsing and testing models with a GUI |
| llama.cpp | CLI, server, library | MIT | Maximum control and the newest features |
| Jan | Desktop app | Apache 2.0 | A ChatGPT-style app that runs offline |
Choose Ollama if you want local models available to every tool on your machine through one API. For a full chat interface on top of it, see our open-source tools. For agents that can use it, see the terminal tools guide.
Frequently asked questions
Is Ollama free?
Running models on your own hardware with Ollama is free, with no usage limits, under the MIT license. Ollama's cloud models are a separate, optional service. The Free cloud plan includes starter credits and one request at a time. Pro costs $20 a month or $200 a year with $60 of included usage, Max is $100 a month with $300, and Team is $500 a month with $1,000 shared across the team.
How do I install Ollama?
On macOS and Windows, download the app from ollama.com, or on Windows run irm https://ollama.com/install.ps1 | iex in PowerShell. On Linux, run curl -fsSL https://ollama.com/install.sh | sh. A Docker image, ollama/ollama, is also available. After installing, ollama run followed by a model name downloads the model and starts a chat.
What hardware do I need to run Ollama?
It depends on the model size. A rough rule is that a model needs a little more memory than its download size. Models with 1 to 4 billion parameters run on most laptops with 8 GB of RAM. Models around 7 to 8 billion parameters run comfortably with 16 GB. Models of 30 billion parameters and up need 32 GB or more of unified memory on Apple silicon or a GPU with matching VRAM. Without a GPU, Ollama runs on the CPU, more slowly.
Can I use Ollama with Claude Code, Codex or other coding agents?
Yes. The ollama launch command sets up supported agents, including Claude Code, Codex, OpenCode and Droid, to use Ollama models. Any tool that accepts an OpenAI-compatible base URL can also point at http://localhost:11434/v1. Coding agents need models that follow tool-calling instructions reliably, so pick a model built for coding and agents rather than the smallest one available.
Does Ollama send my prompts to the cloud?
Not for local models. When you run a model that you downloaded, prompts and outputs stay on your machine. Cloud models, which have names ending in -cloud, run on Ollama's servers. Ollama says it does not log or train on cloud prompts and that cloud processing happens mostly in US data centers. Use local models for anything that must not leave your device.
What is a Modelfile?
A Modelfile is a short text file that defines a custom model in Ollama. It starts from a base model and can set a system prompt, parameters such as temperature and context length, and a prompt template. You build it with ollama create my-model -f Modelfile and then run it like any other model. Teams use Modelfiles to share a consistent assistant setup.