All Local AI
Pick VRAM for fit estimates
inference engine MIT linux macos windows

Ollama

One-command local model runner with an OpenAI-compatible API and automatic GPU offload.

GitHub stars

183,583

License

MIT

Install

binary

Latest release

Oct 14, 2026

Best for

Getting a model running in under five minutes, and serving it to other apps on localhost.

Model formats

  • GGUF

Hardware behaviour

Offloads as many layers to the GPU as VRAM allows and quietly falls back to CPU for the rest, so an oversized model gets slow rather than crashing.

Not sure what your card can hold? Run the fit check — the entry point in our listings is the RTX 4060 8GB at 8.00 GB.

Ollama is a background daemon built on top of llama.cpp. It provides an OpenAI-compatible HTTP endpoint on port 11434 alongside its own CLI.

The daemon handles model downloads and token streaming. It schedules model layers across GPU and CPU.

Hardware offloading to GPUs and system memory occurs automatically, without manual build steps or CUDA compilation flags.

The daemon exposes HTTP endpoints on localhost:11434. It provides native REST endpoints (/api/generate and /api/chat) and an OpenAI-compatible one (/v1/chat/completions).

Client SDKs and agent frameworks can route traffic to local models by changing the base URL.

It manages model distribution using a registry system. When a tag is requested, Ollama downloads the GGUF weights and saves them to an internal blob store, bundling prompt formatting and tokenization metadata into the tag.

Ollama runs headlessly without a bundled graphical user interface. It serves inference requests directly to terminal sessions or web frontends such as Open WebUI.

Supported platforms and installation

Ollama provides native binaries for Linux, macOS, and Windows. It uses underlying hardware acceleration where available, including on NVIDIA GPUs and Apple Silicon.

Linux and macOS binary installation

The installation script handles both Linux and macOS:

curl -fsSL https://ollama.com/install.sh | sh

On Linux, the installer sets up a systemd unit located at /etc/systemd/system/ollama.service. It starts the daemon immediately and configures it to bind to port 11434 on system boot.

On macOS, Ollama runs as an application bundle that registers the command-line binary in your path and adds a menu bar status controller.

Windows setup and Docker deployment

Windows users run a standalone installer that registers an auto-starting user service. The Windows binary automatically detects supported NVIDIA GPUs via installed display drivers.

For containerized environments, use the official Docker image:

docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 ollama/ollama

Once installed, test model execution directly from your terminal:

ollama run llama3.1:8b

Hardware and VRAM behaviour

Ollama offloads as many layers to the GPU as VRAM allows and quietly falls back to CPU for the rest, so an oversized model gets slow rather than crashing.

Token throughput drops when the model is not fully resident in VRAM, as activation tensors must traverse the PCIe bus on every generation cycle.

Inspect active layer distribution and memory usage by querying the daemon:

ollama ps

The output details the active model name and its split across system RAM and GPU VRAM.

Ollama retains models in VRAM for a period after the last request by default. Adjust this using the keep_alive parameter.

A value of -1 keeps weights permanently pinned, while 0 unloads them immediately after inference.

Key configurations

Overriding default context window (num_ctx)

Many models default to a limited num_ctx. Prompts exceeding this are truncated silently unless explicitly configured, even when the base model supports larger contexts.

Override this by specifying num_ctx inside a custom Modelfile:

FROM llama3.1:8b
PARAMETER num_ctx 8192

Build the new model tag with ollama create llama3.1-8k -f Modelfile. Alternatively, pass the option in API payloads:

curl http://localhost:11434/api/generate -d '{
  "model": "llama3.1:8b",
  "prompt": "Summarize this text...",
  "options": {
    "num_ctx": 8192
  }
}'

Expanding context increases the size of the key-value cache, requiring additional VRAM allocation alongside the model weights.

Network binding and remote access (OLLAMA_HOST)

By default, the Ollama daemon binds exclusively to loopback interface 127.0.0.1:11434, rejecting incoming network connections.

To bind all network interfaces for LAN or remote access, set the OLLAMA_HOST environment variable when starting the service:

OLLAMA_HOST=0.0.0.0:11434 ollama serve

On Linux systems running systemd, persist this setting by running sudo systemctl edit ollama.service and adding the override below:

[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"

Apply changes with sudo systemctl daemon-reload && sudo systemctl restart ollama.

Storage location and custom GGUF imports (OLLAMA_MODELS)

Ollama stores weights in ~/.ollama/models on Linux/macOS and %USERPROFILE%\.ollama\models on Windows. Redirect storage by setting the OLLAMA_MODELS environment variable.

For example, to persist this in systemd on Linux and prevent filling root disk space, use:

Environment="OLLAMA_MODELS=/mnt/fast_nvme/ollama_models"

If you already have local GGUF files, create a Modelfile containing:

FROM /absolute/path/to/custom_model.gguf

Run ollama create custom-local -f Modelfile to import the weights directly into the local store.

Comparing Ollama with Alternatives

Choosing an inference engine often depends on concurrency targets and runtime control. While Ollama simplifies setup, raw command-line builds of llama.cpp offer more direct control over lower-level execution parameters.

For high-concurrency server deployments, vLLM offers PagedAttention and continuous batching.

Ollama focuses instead on single-user workflows and local desktop integrations. Those seeking a desktop application interface can consider LM Studio.

The codebase is open source, maintained under the MIT license on the Ollama GitHub repository.

The short version

To run models locally with automatic GPU offloading, install the binary and launch a model:

# Install Linux / macOS
curl -fsSL https://ollama.com/install.sh | sh

# Run a model interactively
ollama run llama3.1:8b

# Serve on the network
OLLAMA_HOST=0.0.0.0:11434 ollama serve

For headless operation, explicitly set num_ctx in your Modelfile and monitor layer distribution using ollama ps.

Setup

Install Ollama

Copy-paste starting points. Always read the project's own instructions before running anything with elevated permissions.

macOS / Linux

macOS / Linux

curl -fsSL https://ollama.com/install.sh | sh

Installs the CLI and background service.

Run a model

Run a model

ollama run llama3.1:8b

Pulls the weights on first run, then opens a chat prompt.

Serve on the network

Serve on the network

OLLAMA_HOST=0.0.0.0:11434 ollama serve

Exposes the OpenAI-compatible API to other machines.

Docker

Ollama

docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 ollama/ollama

Quick start

Getting the first model running

Install, pull, chat — that is the whole loop. ollama run downloads the model on first use and drops you into a prompt; the same daemon exposes an OpenAI-compatible endpoint at http://localhost:11434/v1 that most client libraries accept with only a base-URL change.

Quantization is chosen for you unless you ask otherwise. Appending a tag such as :q4_K_M or :q8_0 to the model name picks a specific build when the default is too large for your card.

FAQ

Ollama questions people actually ask

Short answers to the problems that come up most often.

Where does Ollama store downloaded models?

On macOS and Linux, in ~/.ollama/models; on Windows, in %USERPROFILE%\.ollama\models. Set the OLLAMA_MODELS environment variable before starting the service to move that directory to a larger drive.

Why is Ollama running on the CPU instead of my GPU?

Usually a driver, library, or size issue rather than an Ollama bug. Run ollama ps while generating — if the GPU column is 0% or missing, the model is on the CPU. Confirm nvidia-smi works, that the NVIDIA driver is current (newer Ollama builds need a recent driver for CUDA), and that Docker has --gpus=all if you containerise. On NVIDIA laptops with Optimus, force High Performance for ollama.exe. If the model simply does not fit, Ollama offloads only some layers — check VRAM for your quantization first.

How do I tell whether the GPU is actually being used?

Two checks. ollama ps shows a processor column; you want GPU, not CPU. Then nvidia-smi during a prompt should show utilisation above zero. If nvidia-smi is idle while tokens crawl out at 2–5/sec, you have silent CPU fallback.

How do I limit the context length to save VRAM?

Context is the second-largest memory cost after weights. Pass --ctx-size via a Modelfile parameter or set num_ctx in the API request. Halving context roughly halves KV-cache memory.

Can other applications talk to Ollama?

Yes. It serves an OpenAI-compatible REST API on port 11434, so anything that lets you override the base URL — chat UIs, editor plugins, agent frameworks — can point at it with a dummy API key.

Ollama vs llama.cpp — which should I use?

Ollama is llama.cpp with model management, a daemon, and an API wrapped around it. Choose Ollama for convenience; choose llama.cpp directly when you need flags it does not expose, such as fine-grained layer offload, custom RoPE scaling, or the newest quantization formats on release day.

GPU disappeared after sleep on Linux — now everything is slow?

A known NVIDIA UVM glitch after suspend. Reload the module: sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm, then restart the Ollama service. If that fails, a reboot restores discovery.

Alternatives

Compared with other inference engine options

Same job, different tradeoffs.

Next step

A runner is only half the decision. Check which models fit your GPU with the VRAM calculator, then follow a setup guide or pick a ready-made stack.