DDS Vibe Academy · Mastery · Free · No Signup

The Definitive Ollama Masterclass

Run any open model, for any task, locally. Every install path across macOS, Windows, Linux, Docker, and Cloud — a job-organized model catalog with real pull commands — the API, the Modelfile, editor integrations, and paste-ready playbooks. Current to Ollama v0.31.1.

Every install path 50+ models by job $0 local, private 7 task playbooks

Quick Answer

Ollama is free, open-source software that runs open models — Gemma, Qwen, Llama, DeepSeek, gpt-oss and more — locally on macOS, Windows, and Linux, with an optional hosted Cloud tier for models too big for your hardware. Install it in one command, pull a model with ollama pull, and chat with ollama run. Every prompt stays on your machine; there are no subscriptions, rate limits, or per-token bills. This class is the cross-platform, current, end-to-end guide: every install path, the right model for each job, the API and Modelfile, editor integrations, and paste-ready playbooks.

Key takeaways

  1. One command installs Ollama on any OS; a second pulls a model. You are chatting locally in minutes.
  2. Pick the model by the job, not the hype: coding, reasoning, vision, embeddings, small/edge, tool-calling, and specialized lanes each have a best-in-class pick.
  3. VRAM is the constraint. A 12 GB GPU runs 7–14B models fast; CPU-only runs the small ones; the giants run on Cloud.
  4. Local and Cloud are different trust models: local never leaves your machine, Cloud runs on Ollama's servers.
  5. Every install exposes a local API at localhost:11434, including an OpenAI-compatible endpoint — so your editor, scripts, and apps just point at it.
  6. A Modelfile turns any base model into a reusable, constrained assistant you load by name.

What Ollama Is in 2026

Ollama is a local model runtime. It downloads open models, runs them on your GPU or CPU, and serves them over a simple API — so a chat window, an editor, or your own app can all talk to the same local engine.

Under the hood, Ollama runs on the llama.cpp backend and now ships an MLX backend for Apple Silicon, with GPU acceleration through CUDA on NVIDIA, ROCm on AMD, and Vulkan as a broad fallback. As of v0.31.1 it supports current families including Gemma 4, Qwen 3.5, Llama, DeepSeek, gpt-oss, and cloud-scale models like Kimi, GLM, and MiniMax.

Two things changed the product recently and matter for vibe coders. First, the bare ollama command now offers to wire itself into coding agents — Claude Code, Codex, Copilot CLI, Droid, and OpenCode — via ollama launch. Second, Ollama Cloud lets you run models far too large for local hardware on Ollama's servers, marked cloud in the library. The rest of the ecosystem — REST API, OpenAI-compatible endpoint, Python and JS SDKs, Modelfiles, GGUF import — is unchanged and stable.

Local vs Cloud, stated plainly. A local model runs on your machine and nothing leaves it. A Cloud model runs on Ollama's servers — convenient for 200B–700B models, but not private in the same way. This class labels every model so you always know which you are using.

New here and on Windows? The Ollama for Windows companion covers the Windows-specific tray app and RTX 3060 benchmarks in depth. This class is the cross-platform, model-and-task superset.

Hardware & VRAM Reality

VRAM is king. The amount of GPU memory you have sets the largest model you can run at full speed. You do not need a top-tier card — you need to match the model size to your memory, and let anything bigger run on Cloud.

Ollama defaults to roughly 4-bit quantization, which compresses a model to about a quarter of its full-precision size. A useful rule of thumb: the download size plus about 20% for the context cache is what you need in memory. When a model exceeds your VRAM, Ollama automatically splits layers between GPU and system RAM — it still runs, just slower.

Model sizeApprox. downloadVRAM to run fastCPU-only RAMTypical hardware
1–3B0.7–2 GB2–4 GB8 GBAny GPU, or CPU-only
7–8B4–5 GB6–8 GB16 GBRTX 4060 8 GB, RTX 3060 12 GB
12–14B7–9 GB10–14 GB16–32 GBRTX 3060 12 GB (tight), 4080 16 GB
27–35B16–22 GB22–30 GB32–64 GBRTX 3090/4090 24 GB
70B38–42 GB40–48 GB64 GB+2×24 GB, or workstation
100B–700Bcloud Ollama Cloud

The three practical tiers

  • CPU-only ($0 extra): any modern quad-core with 8–16 GB RAM runs 1–8B models at readable speed. Great for learning, small tasks, and edge models.
  • 12 GB GPU (the vibe-coder sweet spot): an RTX 3060 12 GB runs 7–14B models with full acceleration — the best balance of quality and speed for local coding and RAG.
  • 24 GB GPU or Apple Silicon: 24 GB runs 27–35B locally; Apple Silicon uses unified memory, so a 32–64 GB Mac runs surprisingly large models via the MLX backend.

Two quick wins. Put models on an SSD (loading from a spinning disk is painfully slow), and set OLLAMA_KV_CACHE_TYPE=q8_0 to roughly halve context-cache memory so a larger context fits on a smaller GPU.

Install: Every Path

Pick your platform. Each method below is a step-by-step with the exact command, a verify step, and the failure mode to watch for. Commands are quoted from the official Ollama sources; re-verify at ollama.com/download and docs.ollama.com before a high-stakes setup, since Ollama ships weekly.
macOS
  1. Install. Run the one-line script, or download the app.
  2. Verify. ollama --version prints the version; ollama list confirms the service runs.
  3. First model. ollama run gemma4 downloads and starts a chat. Apple Silicon uses the MLX backend automatically.
macOS · terminal
# Install (script) β€” or download the app from ollama.com/download/Ollama.dmg
curl -fsSL https://ollama.com/install.sh | sh

# Verify
ollama --version
ollama list

# Run your first model (Apple Silicon uses MLX automatically)
ollama run gemma4

Watch for: on Intel Macs without a discrete GPU, prefer smaller models (1–8B). The .dmg app and the script install the same runtime.

Windows
  1. Install. Run the PowerShell one-liner, or download and run OllamaSetup.exe. No administrator rights are required; it installs into your home directory and adds a tray icon.
  2. Custom location. To install elsewhere, run the installer with the /DIR flag. To move where models are stored, set OLLAMA_MODELS.
  3. Portable. Prefer no installer? Download ollama-windows-amd64.zip from the GitHub releases, unzip anywhere, and run ollama.exe.
  4. GPU. Vulkan is enabled by default; ROCm is available for AMD and CUDA for NVIDIA.
Windows · PowerShell
# Install (PowerShell one-liner)
irm https://ollama.com/install.ps1 | iex

# Or run the installer to a custom directory (Command Prompt)
OllamaSetup.exe /DIR="D:\Ollama"

# Move model storage to a big drive (set, then restart Ollama)
setx OLLAMA_MODELS "D:\ollama\models"

# Verify + first model
ollama --version
ollama run gemma4

Watch for: some AMD RX 6000-class cards do not expose ROCm on current Windows drivers — Ollama falls back to Vulkan automatically. The deep-dive tray walkthrough and RTX 3060 benchmarks live in the Windows companion class.

Linux (script + manual + systemd)
  1. Fast path. The install script detects your GPU and sets up a systemd service.
  2. Manual path. Prefer control? Download the tarball, extract to /usr, and run ollama serve. Verify the exact filename at docs.ollama.com/linux.
  3. Service. Create a systemd unit so Ollama starts on boot and restarts on failure.
  4. AMD. For ROCm GPUs, install the ROCm build variant as documented on the same page.
Linux · script
# Fast path β€” detects GPU, installs a systemd service
curl -fsSL https://ollama.com/install.sh | sh

# Verify
ollama --version
ollama run gemma4
Linux · manual + systemd
# Manual install (verify filename at docs.ollama.com/linux)
curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz
sudo tar -C /usr -xzf ollama-linux-amd64.tgz

# Create a dedicated user and a systemd service
sudo useradd -r -s /bin/false -m -d /usr/share/ollama ollama
sudo tee /etc/systemd/system/ollama.service >/dev/null <<'UNIT'
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
Environment="OLLAMA_HOST=127.0.0.1:11434"

[Install]
WantedBy=multi-user.target
UNIT

sudo systemctl daemon-reload
sudo systemctl enable --now ollama

Watch for: the systemd service runs as the ollama user, so its model directory differs from your shell user's. Set OLLAMA_MODELS in the unit's Environment= if you want a shared location.

Docker (CPU, NVIDIA, AMD)
  1. CPU. Run the official ollama/ollama image with a named volume for models and the port mapped.
  2. NVIDIA. Install the NVIDIA Container Toolkit, then add --gpus=all.
  3. AMD. Use the :rocm image and pass the render devices.
  4. Run a model. Exec into the container: docker exec -it ollama ollama run gemma4.
Docker · CPU / NVIDIA / AMD
# CPU
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama

# NVIDIA GPU (needs nvidia-container-toolkit)
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama

# AMD ROCm
docker run -d --device /dev/kfd --device /dev/dri \
  -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama:rocm

# Pull + run a model inside the container
docker exec -it ollama ollama run gemma4

Add a chat UI with Open WebUI

Docker · Open WebUI
# ChatGPT-style UI bundled with Ollama, GPU build β€” then open http://localhost:3000
docker run -d -p 3000:8080 --gpus=all \
  -v ollama:/root/.ollama -v open-webui:/app/backend/data \
  --name open-webui --restart always \
  ghcr.io/open-webui/open-webui:ollama

# CPU-only: drop the --gpus=all flag
Package managers

Ollama is packaged for most ecosystems. Homebrew and Arch are the most common; Nix, Flox, Gentoo, Guix, and a Helm chart for Kubernetes are all official-listed on the project README.

Homebrew / Arch / Nix / Helm
# macOS / Linux β€” Homebrew
brew install ollama
brew services start ollama

# Arch Linux
sudo pacman -S ollama

# Nix (ephemeral shell)
nix-shell -p ollama

# Kubernetes β€” Helm chart
helm repo add ollama-helm https://otwld.github.io/ollama-helm/
helm install ollama ollama-helm/ollama

Which to pick? Use your platform's native package if you already manage software that way; otherwise the official install script gives you the fastest GPU auto-detection.

Libraries & build from source

For building apps, install the official SDKs. To hack on Ollama itself, build from source with Go and CMake (see the development docs).

SDKs
# Python
pip install ollama

# JavaScript / TypeScript
npm i ollama
Ollama Cloud (no local install)
  1. When to use it. For models too large for your hardware — the 100B–700B frontier models tagged cloud in the library.
  2. How. Sign in, then run a cloud-tagged model with the same ollama run command, or call the API with your key. See ollama.com/pricing.
  3. Trade-off. Cloud runs on Ollama's servers, so it is not private the way a local model is. Use it for scale, keep sensitive work local.
Cloud · run a frontier model
# Sign in, then run a cloud-scale model by its cloud tag
ollama signin
ollama run deepseek-v4-pro

# Cloud models expose the same local API surface at localhost:11434

Sources: github.com/ollama/ollama (README), docs.ollama.com (linux, windows), ollama.com/download. Verified Ollama v0.31.1, 2026-06-29.

First Run & the Core CLI

Ten commands cover ninety percent of daily use. Learn run, pull, list, ps, and rm first; reach for show, cp, create, and serve as you go. New in 2026: ollama launch wires Ollama straight into a coding agent.

Essential commands
ollama pull gemma4          # download a model
ollama run gemma4           # download if needed, then chat
ollama list                 # list installed models + sizes
ollama ps                   # show what is loaded in GPU/CPU right now
ollama show gemma4          # architecture, parameters, license, context
ollama rm gemma4            # delete a model to free disk
ollama cp gemma4 my-gemma   # copy a model under a new name
ollama serve                # run the API server in the foreground
ollama launch claude        # wire Ollama into Claude Code (also: codex, opencode, droid, copilot-cli)

# Inside the chat REPL:
#   /set parameter num_ctx 8192   -> change context length
#   /show info                    -> model details
#   /bye                          -> exit

The REPL accepts multi-line input with triple quotes and lets you tweak parameters live with /set. Everything runs on your hardware; watch ollama ps to confirm a model is on the GPU rather than spilling to CPU.

Configuration & Performance

Ollama is configured through environment variables. A handful of them decide where models live, how much context fits, and how memory is used. Set them before starting the server.
VariableWhat it doesTypical value
OLLAMA_MODELSWhere models are stored. Point at your largest drive.D:\ollama\models
OLLAMA_HOSTBind address and port for the API server.127.0.0.1:11434
OLLAMA_KEEP_ALIVEHow long a model stays loaded after use. -1 keeps it resident.5m or -1
OLLAMA_CONTEXT_LENGTHDefault context window for loaded models.8192
OLLAMA_FLASH_ATTENTIONEnable flash attention for lower memory and higher speed.1
OLLAMA_KV_CACHE_TYPEQuantize the context cache to fit more context in less VRAM.q8_0
OLLAMA_NUM_PARALLELConcurrent requests served per model.14
OLLAMA_MAX_LOADED_MODELSHow many models may be resident at once.13
CUDA_VISIBLE_DEVICESWhich NVIDIA GPUs to use in a multi-GPU box.0,1

A tuned local profile

Sovereign local profile (12 GB GPU)
# Fit more context on a 12 GB GPU and keep the model hot
export OLLAMA_FLASH_ATTENTION=1
export OLLAMA_KV_CACHE_TYPE=q8_0
export OLLAMA_CONTEXT_LENGTH=8192
export OLLAMA_KEEP_ALIVE=-1
export OLLAMA_MODELS="$HOME/ollama-models"

# On Windows PowerShell, use: setx OLLAMA_FLASH_ATTENTION 1  (etc.), then restart Ollama
ollama serve

Quantization, briefly

A model's quantization is how tightly its weights are compressed. Ollama defaults to a 4-bit variant, the best speed-to-quality balance for local use. Pull a specific quantization with a tag, for example ollama pull qwen2.5-coder:14b-instruct-q8_0 for higher fidelity at the cost of memory, or a smaller q4 to fit a bigger model on a small card. The show command prints the quantization a model is using.

The Model Catalog, by Job

Pick the model by the job. Below is the current best-in-class per category with the exact ollama pull command and a start-here size. The full library is 150+ models and grows weekly — browse it at ollama.com/library, read the tags (tools vision thinking cloud), and ollama pull anything. local runs on your machine; cloud runs on Ollama's servers.

Find and run any model

The universal pattern
# 1) Browse ollama.com/library and note a model name + size tag
# 2) Pull a specific size/quant with a tag after the colon
ollama pull qwen2.5-coder:14b
# 3) Run it
ollama run qwen2.5-coder:14b
# 4) Inspect what you got (context, quant, license)
ollama show qwen2.5-coder:14b

General & chat flagships

ModelSizesBest forStart here
gemma4 locale2b–31bGoogle's frontier-per-size all-rounder; vision + tools + thinking12b on 12 GB
qwen3.5 local0.8b–122bMultimodal, strong reasoning and multilingual9b on 12 GB
llama3.3 local70bMeta flagship-class instruction following70b on 48 GB
gpt-oss local20b / 120bOpenAI open weights; agentic + reasoning20b on 16 GB
mistral-small3.2 local24bFast, capable, good function calling + vision24b on 24 GB
granite4.1 local3b–30bEnterprise: RAG, tools, JSON output (Apache 2.0)8b on 12 GB
pull · flagships
ollama pull gemma4
ollama pull qwen3.5
ollama pull gpt-oss:20b
ollama pull mistral-small3.2
ollama pull granite4.1:8b

Coding (the vibe-coder core)

ModelSizesBest forStart here
qwen2.5-coder local0.5b–32bThe local workhorse: generation, completion, fixing7b or 14b on 12 GB
devstral local24bAgentic multi-file coding, codebase exploration24b on 24 GB
codestral local22bMistral's code model; fast fill-in-the-middle22b on 24 GB
deepseek-coder-v2 local16b / 236bStrong multi-language MoE; big-context refactors16b on 16 GB
qwen3-coder cloud30b / 480bLong-context agentic coding at frontier scaleCloud
codegemma local2b / 7bLightweight completion on modest hardware7b on 8 GB
pull · coding
ollama pull qwen2.5-coder:14b
ollama pull devstral
ollama pull codestral
ollama pull deepseek-coder-v2

Reasoning (thinking models)

ModelSizesBest forStart here
deepseek-r1 local1.5b–671bChain-of-thought; shows its reasoning steps8b or 14b on 12 GB
qwq local32bQwen's dedicated reasoner32b on 24 GB
magistral local24bEfficient reasoning with tool use24b on 24 GB
phi4-reasoning local14bPunches above its size on math and logic14b on 14 GB
deepscaler local1.5bTiny math specialist for constrained hardware1.5b anywhere
pull · reasoning
ollama pull deepseek-r1:14b
ollama pull qwq
ollama pull phi4-reasoning

Vision & multimodal

ModelSizesBest forStart here
qwen3-vl local2b–235bStrongest Qwen vision-language; charts, docs, UI-to-code8b on 12 GB
llama3.2-vision local11b / 90bImage reasoning, document understanding11b on 12 GB
llava local7b–34bGeneral visual Q&A, captioning7b on 8 GB
moondream local1.8bTiny vision model for edge devices1.8b anywhere
deepseek-ocr local3bToken-efficient OCR from scans and receipts3b on 8 GB
pull · vision
ollama pull qwen3-vl:8b
ollama pull llama3.2-vision
ollama pull moondream

Embeddings (for RAG)

ModelSizeBest forNote
nomic-embed-text localThe default general-purpose embedder; large contextFast, tiny
embeddinggemma local300mGoogle's compact embedder for on-device RAGEfficient
mxbai-embed-large local335mHigher-quality retrieval when accuracy mattersStronger
bge-m3 local567mMultilingual, multi-granularity retrievalMultilingual
qwen3-embedding local0.6b–8bScales embedding quality with sizeTunable
pull · embeddings
ollama pull nomic-embed-text
ollama pull embeddinggemma
ollama pull mxbai-embed-large

Small & edge (low VRAM / CPU)

ModelSizesBest forStart here
gemma3 local270m–4bTiny-but-capable; 270m runs almost anywhere1b on CPU
llama3.2 local1b / 3bFast general chat on modest hardware3b on CPU/8 GB
phi4-mini local3.8bReasoning + function calling in a small footprint3.8b on 8 GB
smollm2 local135m–1.7bUltra-light experiments and edge devices360m on CPU
granite4 local350m–3bLow-latency enterprise tasks with tools3b on 8 GB
pull · small/edge
ollama pull gemma3:1b
ollama pull llama3.2:3b
ollama pull phi4-mini
ollama pull smollm2:360m

Tool-calling & agentic

ModelSizesBest forStart here
functiongemma local270mPurpose-built function calling in a tiny model270m anywhere
hermes3 local3b–405bFlagship open tool-use / agent behavior8b on 12 GB
command-r local35bLong-context RAG + tool use35b on 24 GB
llama3-groq-tool-use local8b / 70bTuned specifically for function calling8b on 12 GB
pull · tools/agentic
ollama pull hermes3:8b
ollama pull functiongemma
ollama pull llama3-groq-tool-use

Specialized (math, SQL, translation, safety)

ModelJobNote
mathstral localMath & scientific reasoning7b, Mistral
sqlcoder localText-to-SQL generation7b / 15b
translategemma localTranslation across 55 languages4b–27b
llama-guard3 localSafety classification of inputs/outputs1b / 8b
shieldgemma localContent-safety policy evaluation2b–27b
nuextract localStructured information extraction3.8b
pull · specialized
ollama pull mathstral
ollama pull sqlcoder
ollama pull llama-guard3

Cloud-only frontier models

These run on Ollama Cloud, not your GPU. They are 100B–700B-class and marked cloud in the library. Use them for frontier quality; keep sensitive work on local models.

ModelBest for
kimi-k2.6 cloudNative-multimodal agentic model; long-horizon coding + orchestration
glm-5.2 cloudFlagship agentic engineering; long-horizon tasks
minimax-m3 cloudCoding + agentic with a 1M-token context
deepseek-v4-pro cloudFrontier MoE with multiple reasoning modes

Source: ollama.com/library (popular + newest), read 2026-06-29. Sizes and tags reflect that snapshot; the library changes weekly — verify before quoting.

Modelfile & Custom Models

A Modelfile turns any base model into a reusable, constrained assistant you load by name. Set a system prompt, lock parameters, and you never re-explain the rules again. You can also import your own GGUF or safetensors weights.
Modelfile · a scoped assistant
# Save as "Modelfile" (no extension)
FROM qwen2.5-coder:14b

SYSTEM """You are a senior Shopify + React engineer.
Write production-ready code with error handling.
Vanilla JS only, no jQuery. Scope all CSS under a unique wrapper class.
When unsure, say so and propose a test rather than guessing."""

PARAMETER temperature 0.3
PARAMETER num_ctx 8192

# Build and run it:
#   ollama create shopify-dev -f Modelfile
#   ollama run shopify-dev

Import your own weights

Import GGUF + push
# Point FROM at a local GGUF file (or a safetensors directory)
echo 'FROM ./my-model.gguf' > Modelfile
ollama create my-model -f Modelfile
ollama run my-model

# Share it to your namespace on ollama.com
ollama push yourname/my-model

See the Modelfile reference and import guide for every instruction, including TEMPLATE, ADAPTER for LoRA, and quantization on import.

The API & SDKs

Every Ollama install runs a local server at http://localhost:11434 with a REST API and an OpenAI-compatible endpoint. This is the whole point for builders: your editor, scripts, and apps all talk to one local engine — no keys, no rate limits, no per-token bills.
EndpointMethodPurpose
/api/chatPOSTMulti-turn chat with message history (streaming supported)
/api/generatePOSTSingle-turn completion
/api/embedPOSTVector embeddings for RAG and semantic search
/api/tagsGETList installed models
/api/psGETShow loaded models
/v1/chat/completionsPOSTOpenAI-compatible drop-in

Chat from the shell

curl · /api/chat
curl http://localhost:11434/api/chat -d '{
  "model": "gemma4",
  "messages": [{ "role": "user", "content": "Why is the sky blue?" }],
  "stream": false
}'

Python

Python · official lib + JSON output
# pip install ollama
from ollama import chat

resp = chat(model='qwen2.5-coder:14b', messages=[
    {'role': 'system', 'content': 'You output only valid JSON.'},
    {'role': 'user', 'content': 'Give me a product with name and price.'}
], format='json')          # force structured JSON output
print(resp.message.content)

# Embeddings for RAG:
from ollama import embed
vec = embed(model='nomic-embed-text', input='chunk of text')['embeddings']

JavaScript

JavaScript · official lib
// npm i ollama
import ollama from 'ollama';

const res = await ollama.chat({
  model: 'gemma4',
  messages: [{ role: 'user', content: 'Plan a week of social posts.' }],
});
console.log(res.message.content);

OpenAI drop-in

Point any OpenAI client at the local endpoint and most code — plus LangChain, LlamaIndex, and CrewAI — works unchanged.

Python · OpenAI client to Ollama
# pip install openai
from openai import OpenAI

client = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')  # key ignored
resp = client.chat.completions.create(
    model='qwen2.5-coder:14b',
    messages=[{'role': 'user', 'content': 'Explain how Ollama works.'}],
)
print(resp.choices[0].message.content)

Structured + tools. Pass format: json (or a JSON schema) to force machine-parseable output, and use a tools-tagged model with a tools array for function calling. Full details in the API reference.

Editor & Agent Integrations

Ollama is a drop-in local backend for the vibe-coder toolchain. The fastest path in 2026 is ollama launch, which wires Ollama directly into a coding agent. For editors, Continue and Cline are the go-to extensions; anything OpenAI-compatible points at localhost:11434/v1.

Native agent launch (new)

ollama launch
# Wire Ollama into a coding agent in one command
ollama launch claude        # Claude Code
ollama launch codex         # Codex
ollama launch opencode      # OpenCode
ollama launch droid         # Droid
ollama launch copilot-cli   # GitHub Copilot CLI

# Turn Ollama into a personal assistant across chat apps
ollama launch openclaw

The editor landscape

ToolWhat it isHow to connect
ContinueAI assistant for VS Code + JetBrainsSelect Ollama as provider, choose your local model
ClineAutonomous multi-file / whole-repo codingSet API provider to Ollama; Plan then Act
Void / ZedAI-native editors, Cursor alternativesPoint the model provider at Ollama
AiderTerminal pair-programmerSet the Ollama API base and model
Open WebUI / AnythingLLMChat + local RAG desktop appsAuto-detect Ollama at localhost:11434
AntigravityAgent-first IDE (see the DDS class)Use Ollama as the local validation lane
Continue · config snippet
# ~/.continue/config.yaml β€” point Continue at your local Ollama
models:
  - name: Qwen Coder (local)
    provider: ollama
    model: qwen2.5-coder:14b
  - name: Autocomplete (local)
    provider: ollama
    model: qwen2.5-coder:1.5b
    roles: [autocomplete]
Aider · terminal
export OLLAMA_API_BASE=http://127.0.0.1:11434
aider --model ollama/qwen2.5-coder:14b

Task Playbooks

Seven recipes for real work. Each is a minimal, paste-ready path from zero to a working task on local models. Swap the model for your hardware tier using the catalog above.

1. A private local coding copilot

copilot · qwen-coder + Continue
ollama pull qwen2.5-coder:14b     # chat/edit model
ollama pull qwen2.5-coder:1.5b    # fast autocomplete
# Install the Continue extension, select Ollama, pick the models above.
# Result: tab completion + inline chat, fully local, zero cloud calls.

Best on a 12 GB GPU. Drop to qwen2.5-coder:7b on 8 GB.

2. Private RAG over your own documents

rag · embed + retrieve
ollama pull nomic-embed-text     # embedder
ollama pull gemma4               # answerer
# Fastest GUI path: install AnythingLLM or Open WebUI, point at Ollama,
# drop your files in, and ask questions grounded in them.
# Script path (Python):
from ollama import embed, chat
docs = ["...your chunks..."]
vectors = [embed(model='nomic-embed-text', input=d)['embeddings'][0] for d in docs]
# store vectors in any vector DB, retrieve top-k for a query, then:
answer = chat(model='gemma4', messages=[{'role':'user','content':'CONTEXT + QUESTION'}])

Everything stays local — the entire point of RAG on Ollama for sensitive data.

3. Agentic multi-file coding

agent · devstral + Cline/OpenCode
ollama pull devstral              # coding-agent model (24B, needs ~24 GB)
ollama launch opencode           # or use Cline in VS Code with Ollama
# Give it a bounded task, review the plan, then let it edit across files.
# On 12 GB, use qwen2.5-coder:14b instead and keep tasks smaller.

Keep changes reviewable: bounded task, read the plan, commit yourself.

4. Vision & OCR extraction

vision · describe / extract
ollama pull qwen3-vl:8b          # general vision-language
ollama pull deepseek-ocr:3b      # token-efficient OCR
# CLI: pass an image path in the REPL, or via the API:
from ollama import chat
r = chat(model='qwen3-vl:8b', messages=[{
  'role':'user','content':'Extract the totals from this receipt as JSON.',
  'images':['receipt.jpg']}], format='json')
print(r.message.content)

Use deepseek-ocr for dense scans; qwen3-vl for reasoning about charts and UI.

5. Batch, offline text operations

batch · summarize / classify
from ollama import chat
items = open('inbox.txt').read().split('\n---\n')
for i, text in enumerate(items):
    r = chat(model='gemma4', messages=[
      {'role':'system','content':'Classify as [urgent], [fyi], or [archive]. One label only.'},
      {'role':'user','content': text}])
    print(i, r.message.content.strip())

No rate limits, no bill — run thousands of items overnight on local hardware.

6. Structured JSON extraction

structured · format json
from ollama import chat
r = chat(model='granite4.1:8b', messages=[
  {'role':'system','content':'Return only JSON matching {name, email, company}.'},
  {'role':'user','content':'Jane Doe, jane@acme.co, works at Acme.'}
], format='json')
import json; print(json.loads(r.message.content))

Pair format='json' with a tools-capable model for reliable machine output.

7. Sovereign fallback (local primary, cloud backup)

sovereign · route by sensitivity
from ollama import chat
def ask(prompt, sensitive=True):
    model = 'qwen2.5-coder:14b' if sensitive else 'qwen3-coder'  # local vs cloud
    return chat(model=model, messages=[{'role':'user','content':prompt}]).message.content
# Sensitive work never leaves the machine; non-sensitive scale routes to Cloud.

The pattern behind zero-cost sovereign operation — expanded in the AI Cost Engineering class.

Ops & Guardrails

Local does not mean careless. A few habits keep an Ollama box healthy and safe to leave running: update deliberately, mind disk, expose the API only when you mean to, and screen agentic I/O with a safety model.

Update & maintain

  • Update Ollama: re-run the install script or installer. On Homebrew, brew upgrade ollama.
  • Update a model: ollama pull name again — only changed layers download.
  • Reclaim disk: ollama list to see sizes, ollama rm name to delete. Models run tens to hundreds of GB.
  • Keep models hot: OLLAMA_KEEP_ALIVE=-1 avoids reloading from disk between requests.

Exposing the API. By default Ollama listens on localhost only. Setting OLLAMA_HOST=0.0.0.0:11434 opens it to your whole network with no authentication. Only do this behind a firewall or a reverse proxy that adds auth — never on an untrusted network.

Guard an agentic setup

When a local model can call tools or act on files, screen its inputs and outputs. Ollama ships safety models for exactly this: llama-guard3 and shieldgemma classify prompts and responses against safety policies, and granite4.1-guardian judges harm criteria. Run the model's output through a guard before any side effect, the same discipline any production agent needs.

uninstall (quick reference)
# macOS: quit the app, then remove it and the models
rm -rf ~/.ollama
# Linux (script install):
sudo systemctl disable --now ollama
sudo rm /usr/bin/ollama /etc/systemd/system/ollama.service
sudo rm -rf /usr/share/ollama
# Windows: uninstall from Settings > Apps, then delete %USERPROFILE%\.ollama

Troubleshooting Matrix

The common failure modes, each with the most likely cause and the fix. Start with ollama ps — it tells you whether a model is on the GPU or spilling to CPU, which explains most speed problems.
SymptomLikely causeFix
Very slow tokensModel on CPU, not GPU (check ollama ps)Update GPU drivers; use a smaller size that fits VRAM; enable flash attention
Out of memory / crashModel too big for VRAMSmaller size or lower quant; OLLAMA_KV_CACHE_TYPE=q8_0; reduce num_ctx
AMD RX 6000 on Windows, no GPUROCm not exposed on current driversVulkan is the automatic fallback; leave it enabled
"port already in use" 11434Ollama already running (tray app or service)Use the running instance, or stop it before ollama serve
Long pause on first promptModel loading from diskPut models on SSD; set OLLAMA_KEEP_ALIVE=-1
Disk filling on C: (Windows)Default model dir in home driveSet OLLAMA_MODELS to a big drive and restart
Cannot reach API from another deviceBound to localhost onlySet OLLAMA_HOST=0.0.0.0 behind a firewall; open the port deliberately
Vision model ignores the imageNon-vision model, or image not attachedUse a vision-tagged model and pass the image in the request

Sources: docs.ollama.com (windows, faq), github.com/ollama/ollama. Verified 2026-06-29. Re-check version-specific behavior after any Ollama update.

Frequently Asked Questions

What is Ollama and is it free?

Ollama is free, open-source software for running open models locally on macOS, Windows, and Linux. Once a model is downloaded it runs entirely on your machine with no subscription and no data leaving your computer. It also offers an optional hosted Cloud tier for models too large to run locally.

Which operating systems does Ollama support?

macOS, Windows, and Linux natively, plus Docker on all three. On Windows it installs without administrator rights into your home directory and uses Vulkan by default, with ROCm available for AMD and CUDA for NVIDIA.

What is the fastest way to install Ollama?

On macOS or Linux, run curl -fsSL https://ollama.com/install.sh | sh. On Windows, run irm https://ollama.com/install.ps1 | iex in PowerShell, or download and run OllamaSetup.exe. Then ollama pull gemma4 and ollama run gemma4.

What hardware do I need for Ollama?

A CPU-only machine with 8 to 16 GB of RAM runs 1B to 8B models at usable speeds. A 12 GB GPU such as an RTX 3060 runs 7B to 14B models fast. 24 GB runs 30B-class models. Apple Silicon uses unified memory. Models too big for local hardware run on Ollama Cloud.

What is the difference between local models and Ollama Cloud?

Local models run on your own GPU or CPU and never leave your machine. Ollama Cloud runs very large models, such as the biggest DeepSeek, GLM, Kimi, and MiniMax models, on Ollama's servers when they are too large for local hardware. Cloud models are marked cloud in the library and are not private in the same way as local models.

What is the best Ollama model for coding?

For local coding on a 12 GB GPU, qwen2.5-coder in its 7B or 14B size is the workhorse, with devstral and codestral strong for agentic multi-file work. Larger coding models such as qwen3-coder and the cloud coding models are available when you have more VRAM or use Cloud.

How do I connect Ollama to my code editor?

Use the Continue or Cline extensions in VS Code or JetBrains and select Ollama as the provider, or run ollama launch to wire Ollama into Claude Code, Codex, Copilot CLI, Droid, or OpenCode directly. Any tool that speaks the OpenAI API can point at localhost:11434/v1.

How do I change where Ollama stores models?

Set the OLLAMA_MODELS environment variable to a folder on a large drive, then restart Ollama. Models can be tens to hundreds of gigabytes, so pointing this at your biggest disk is a common first step.

Can I use Ollama as a drop-in for the OpenAI API?

Yes. Ollama exposes an OpenAI-compatible endpoint at http://localhost:11434/v1. Point the OpenAI client's base_url there with any placeholder API key, and most OpenAI code, plus frameworks like LangChain and LlamaIndex, works unchanged.

Can Ollama do vision, embeddings, and tool calling?

Yes. Vision models such as qwen3-vl, llava, and moondream read images. Embedding models such as nomic-embed-text and embeddinggemma power retrieval and RAG. Many models are tagged tools for function calling, and Ollama supports structured JSON output.

How do I create a custom model in Ollama?

Write a Modelfile with a FROM base model plus a SYSTEM prompt and PARAMETER lines, then run ollama create your-name -f Modelfile. You can also import GGUF or safetensors weights with FROM pointing at the file, and push your model to your namespace.

How do I keep Ollama and its models updated?

Re-run the installer or install script to update Ollama itself, and run ollama pull model-name again to update a model, which downloads only changed layers. Ollama ships updates frequently, so re-verify version-specific details before a high-stakes setup.

Sources & Author

Every command and model is verified against official Ollama sources, snapshot-dated. The library changes weekly — treat this as accurate to Ollama v0.31.1, 2026-06-29, and re-verify before a high-stakes setup.

Robert McCullock

Architect-CEO of Design Delight Studio, a Boston sustainable streetwear studio run on a multi-agent AI stack — including a local Ollama tier for zero-cost, private production agents. He builds the DDS Vibe Academy to document intent-based AI development in production.

Portfolio · LinkedIn

Your models. Your machine. Your rules.

Pick your platform, pull one model, and run local AI for any task — free, private, and with no rate limits. Then explore the rest of the Academy.

Browse the DDS Vibe Academy

Free. No paywall. No signup. No certificate. Just the work.