In This Guide
Key Takeaways
- Ollama is an open-source local LLM runtime built on llama.cpp — install once, pull models, query via CLI or REST
- The HTTP server listens on
localhost:11434with native endpoints (/api/generate,/api/chat) and an OpenAI-compatible/v1/chat/completionsroute - 4-bit quantization (Q4_K_M) is the default — a 7B model fits in roughly 5 GB on disk and 8 GB of RAM
- Llama 3.3 (70B), Mistral, Qwen 2.5, Phi-4, and DeepSeek are all one
ollama pullaway - Apple Silicon Macs are exceptional Ollama hosts thanks to unified memory; CUDA GPUs are excellent on Linux/Windows
- Local LLMs are not a frontier-API replacement — they win on privacy, cost, latency, and offline; they lose on raw capability
What Is Ollama?
Ollama is an open-source local LLM runtime that turns your laptop or workstation into a private inference server. Under the hood it wraps llama.cpp — Georgi Gerganov's tight C/C++ inference engine for quantized transformer models — and adds three things that matter: a model registry with one-line downloads, a clean command-line interface, and an HTTP API that every other tool in the ecosystem already knows how to talk to.
The premise is simple: if hosted models like Claude and GPT made calling a frontier model as easy as a single HTTPS request, Ollama makes calling a strong open-weight model just as easy — except the model lives on your machine, the request never leaves your network, and you pay nothing per token. ollama pull llama3.3 downloads the model. ollama run llama3.3 drops you into an interactive prompt. curl http://localhost:11434/api/chat hits the same model from any application you write.
By 2026 Ollama has become the default local LLM runtime for practitioners who care about privacy, cost, and tight integration into their own software. It is not the only option — LM Studio is friendlier for non-technical users, vLLM is faster for production GPU serving, and llama.cpp itself is the right choice for embedded or unusual hardware — but for the broad middle of the market (developers running models on their own machines and small servers), Ollama is the path of least friction.
Why Run LLMs Locally in 2026
Hosted APIs are still the right answer for most use cases. Frontier models — GPT-5, Claude Opus 4, Gemini 2 — are genuinely more capable than anything you can run on a laptop, and per-token API pricing keeps falling. So why bother with local at all?
Four reasons that have not gone away in 2026:
Privacy
If your prompts contain proprietary code, customer PII, healthcare records, attorney-client communication, or any data that is bound by contract, regulation, or trade secret to stay on-premises, a hosted API is a non-starter. Local inference means the prompt and the response never leave your network. There is no vendor data-retention policy to negotiate, no SOC 2 attestation to audit, no log to subpoena. The data physically does not exist outside your machine.
Cost At Scale
For one developer making a hundred API calls a day, hosted is cheaper than buying a GPU. For a coding assistant inside a 200-person engineering org running thousands of completions per developer per day, the math flips. Hosted token costs at that volume run into five-figure monthly bills. A single workstation running Ollama costs the electricity to run it. Many internal tools — autocomplete, code search, RAG over the company wiki — produce more value than they would justify at hosted token prices, and only become viable when local inference makes the marginal cost effectively zero.
Offline And Air-Gapped
Field laptops, secure facilities, classified networks, flights, the cabin you go to when you need to write — local LLMs run with no internet connection. Once the model is on disk, you have a permanent capability that does not depend on a vendor's uptime, a network you control, or a billing relationship.
Latency And Determinism
Hosted APIs add round-trip network latency on every call. For chatbot use this is invisible. For an agent making dozens of small calls in a tight loop, or for a streaming UI where time-to-first-token matters, a local model on a fast machine often beats a hosted call to a more capable model on every metric except the quality of the output.
The Honest Tradeoff
What you give up running locally is capability. A 70B model running 4-bit-quantized on a Mac is meaningfully behind GPT-5 or Claude Opus on hard reasoning, long-context tasks, code generation in unfamiliar languages, and any task where the frontier matters. The right framing is not local-vs-hosted as a binary — it is local-where-local-wins (privacy, scale, offline, latency) and hosted-where-hosted-wins (capability, very long context, vision, frontier reasoning). Most production systems end up using both.
Installation
Ollama installs in under a minute on every major platform. The official installers handle the platform-specific dependencies — Metal on Apple Silicon, CUDA on Linux/Windows with NVIDIA GPUs, ROCm on AMD, or pure CPU as a fallback.
macOS
Download the .dmg from ollama.com/download, drag to Applications, launch once. The installer registers a background daemon that auto-starts ollama serve on port 11434 and adds the ollama CLI to your PATH. Apple Silicon Macs (M1, M2, M3, M4) get Metal GPU acceleration automatically — this is the cleanest local-LLM experience on any platform.
Linux
# One-line install — pulls the latest release and registers a systemd service curl -fsSL https://ollama.com/install.sh | sh # Verify the service is running systemctl status ollama # Or start it manually ollama serve
On NVIDIA hardware, install the CUDA driver first (the Ollama installer detects it and enables GPU offload). On AMD GPUs, install ROCm. On a plain CPU box, Ollama still runs — just slowly.
Windows
Download OllamaSetup.exe from ollama.com/download/windows and run it. WSL2 is no longer required as of 2025 — Ollama runs natively on Windows with CUDA acceleration on supported NVIDIA GPUs.
Docker
# CPU-only docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama # NVIDIA GPU docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama # Pull a model into the running container docker exec -it ollama ollama pull llama3.3
Hardware Requirements By Model Size
Ollama's RAM requirements scale with the parameter count of the model and the quantization level. The numbers below are for the default Q4_K_M quantization; FP16 (no quantization) roughly doubles them, and Q8_0 sits in between.
- 1–3B parameters (Phi-4-mini, Qwen 2.5 3B): about 4 GB RAM, runs reasonably on any modern machine including older laptops and Raspberry Pi 5
- 7–8B (Llama 3.1 8B, Mistral 7B, Qwen 2.5 7B): about 8 GB RAM, runs comfortably on a 16 GB laptop
- 13–14B (Phi-4, Qwen 2.5 14B): about 16 GB RAM, comfortable on a 32 GB machine
- 30–34B (Mixtral 8x7B effective, Qwen 2.5 32B): about 24 GB RAM, needs a 32 GB+ machine or a 24 GB GPU
- 70B (Llama 3.3 70B): about 48 GB RAM at Q4, runs well on a 64 GB Mac or a 48 GB GPU; usable on a 32 GB Mac with aggressive quantization but slow
Pro Tip: Sizing RAM For Your Model
The rule of thumb at Q4_K_M is roughly 0.6–0.7 GB of RAM per billion parameters, plus 1–2 GB of overhead for context and KV cache. A 13B model needs about 8–10 GB; a 70B needs about 45–50 GB. If your model + context together exceed available memory, Ollama will spill to disk and tokens-per-second will collapse from "fast" to "unusable." Always leave headroom — don't run a 13B on exactly 16 GB if you need that machine for anything else.
Pulling & Running Models
Once Ollama is installed, the entire model lifecycle is four commands: pull, run, list, and rm. The model registry at ollama.com/library hosts the canonical builds; you can also load models from Hugging Face GGUF files or from a Modelfile.
# Pull a model from the registry — defaults to a sensible size and Q4_K_M ollama pull llama3.3 # Pull a specific size or quantization ollama pull llama3.3:70b ollama pull llama3.1:8b-instruct-q8_0 # Drop into an interactive REPL with the model ollama run llama3.3 # Run a one-off prompt ollama run llama3.3 "Summarize the SBIR Phase I selection process in three bullets." # Inspect installed models ollama list # Remove a model to reclaim disk space ollama rm llama3.1:8b
The Models That Matter In 2026
Llama 3.3 (Meta) — Released late 2024, the 70B Llama 3.3 Instruct is the strongest general-purpose open-weight model that fits on a single high-memory consumer machine. It was Meta's "we got 405B-level quality into a 70B form factor" release. For most local-first workloads, this is the default to start with on hardware that can run it.
Mistral and Mistral Small/Large — Mistral's open releases — Mistral 7B, Mixtral 8x7B (sparse mixture-of-experts), and the Mistral Small/Large series — remain workhorse choices for European users and anyone who values Apache-2.0 licensing. Mistral 7B is still one of the best 7B models in 2026 for general instruction-following.
Qwen 2.5 (Alibaba) — The Qwen 2.5 family (0.5B, 1.5B, 3B, 7B, 14B, 32B, 72B) is exceptionally strong on coding and multilingual tasks. Qwen 2.5-Coder 32B is widely regarded as the best open-weight coding model that runs locally. The licensing is permissive for the smaller sizes; the 72B has a custom Qwen license.
Phi-4 (Microsoft) — Phi-4 (14B parameters) is Microsoft's "small model trained on curated and synthetic data" release. It punches well above its weight on reasoning and math benchmarks while fitting into 16 GB of RAM. A strong choice on memory-constrained machines.
DeepSeek R1 and DeepSeek V3 — DeepSeek's open-weight reasoning models brought frontier-style chain-of-thought performance to local runtimes. The full R1 is too large for consumer machines, but distilled variants (DeepSeek-R1-Distill-Qwen 7B/14B/32B, DeepSeek-R1-Distill-Llama 8B/70B) bring much of the reasoning capability to hardware you can actually own. See our DeepSeek R1 deep-dive for the longer story.
Specialized models — Embedding models (nomic-embed-text, mxbai-embed-large) for RAG; vision models (LLaVA, Qwen2-VL); code-specific models (Qwen2.5-Coder, DeepSeek-Coder). All available with one ollama pull.
The Ollama API
The Ollama daemon listens on http://localhost:11434 by default and exposes both a native REST API and an OpenAI-compatible chat completions endpoint. The OpenAI-compatible route is the killer feature — it means almost any tool, library, or framework that speaks the OpenAI API can be pointed at your local model with a one-line base-URL change.
The Native REST API
# Generate a single completion (non-streaming) curl http://localhost:11434/api/generate -d '{ "model": "llama3.3", "prompt": "Why is the sky blue?", "stream": false }' # Chat-style endpoint with message history curl http://localhost:11434/api/chat -d '{ "model": "llama3.3", "messages": [ {"role": "system", "content": "You are a concise technical assistant."}, {"role": "user", "content": "Explain GGUF in one sentence."} ], "stream": true }'
Python Client (Native API)
import requests resp = requests.post( "http://localhost:11434/api/chat", json={ "model": "llama3.3", "messages": [ {"role": "system", "content": "You write tight, accurate technical answers."}, {"role": "user", "content": "What does Q4_K_M quantization mean?"}, ], "stream": False, "options": {"temperature": 0.2, "num_ctx": 4096}, }, timeout=120, ) print(resp.json()["message"]["content"])
OpenAI-Compatible Endpoint
Ollama exposes /v1/chat/completions, /v1/completions, /v1/embeddings, and /v1/models with the OpenAI request/response shape. Point any OpenAI SDK at http://localhost:11434/v1 with any non-empty API key, and it just works.
from openai import OpenAI client = OpenAI( base_url="http://localhost:11434/v1", api_key="ollama", # required by the SDK; value is ignored ) response = client.chat.completions.create( model="llama3.3", messages=[ {"role": "system", "content": "You are a precise assistant."}, {"role": "user", "content": "Write a Python function that returns the nth Fibonacci number."}, ], temperature=0.2, ) print(response.choices[0].message.content)
That two-line base-URL swap is why Ollama integrates cleanly with frameworks built for hosted APIs — LangChain, LlamaIndex, Aider, Continue, AutoGen, OpenWebUI, and dozens of others ship with built-in Ollama support or work out-of-the-box through the OpenAI-compat layer.
Modelfiles & Custom Models
A Modelfile is Ollama's equivalent of a Dockerfile — a small declarative recipe that takes a base model and adds a system prompt, parameter defaults, a chat template, and any other behavior you want baked in. ollama create builds a new named model from the Modelfile that you can then run and pull like any registry model.
# Modelfile — a federal-proposal-writing assistant built on Llama 3.3 FROM llama3.3:70b PARAMETER temperature 0.3 PARAMETER top_p 0.9 PARAMETER num_ctx 8192 PARAMETER repeat_penalty 1.1 PARAMETER stop "<|eot_id|>" SYSTEM """You are a senior federal proposal writer specializing in DoD SBIR Phase I. You write in active voice, lead with the customer's problem, and ground every claim in cited evidence. You never use marketing language. You match the tone of a senior program manager briefing a TPOC, not a salesperson.""" TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|> {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|> {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|> {{ .Response }}<|eot_id|>"""
Build and run it:
ollama create proposal-writer -f ./Modelfile ollama run proposal-writer # Now it shows up in the list and works through the API by name ollama list # NAME ID SIZE MODIFIED # proposal-writer a3f8e1b2c... 42 GB just now # llama3.3:70b b1c4d5e6f... 42 GB 2 days ago
Modelfiles are also how you load models from Hugging Face GGUF files that aren't in the Ollama registry — point FROM at a local .gguf file and you have a custom model.
Ollama vs llama.cpp vs LM Studio vs vLLM
Ollama is one of four serious local-LLM runtimes in 2026. They overlap, but each occupies a distinct niche. The right pick depends on whether you optimize for ease, control, GUI, or production throughput.
| Feature | Ollama | llama.cpp | LM Studio | vLLM |
|---|---|---|---|---|
| Interface | CLI + REST API | CLI / library | Desktop GUI | Python / REST |
| Setup difficulty | Trivial | Moderate (build) | Trivial | High (GPU + Python) |
| Model registry | Built-in | Manual GGUF | HF browser | Manual HF |
| OpenAI-compat API | Yes | Yes (server mode) | Yes | Yes |
| Apple Silicon (Metal) | Excellent | Excellent | Excellent | Limited |
| Multi-GPU server | Basic | Basic | No | Best-in-class |
| Concurrency / batching | Basic | Moderate | Single user | PagedAttention |
| Best for | Developer laptops, internal tools | Embedded / unusual hardware | Non-technical users | Production GPU serving |
The decision is usually clean. LM Studio if you want a GUI and never touch the terminal. llama.cpp if you need to deploy on a Raspberry Pi, an unusual SoC, or you want to embed inference in a C++ binary. vLLM if you are running a production service on a GPU server and need to serve dozens or hundreds of concurrent users efficiently. Ollama for everything in between — single-developer workflows, internal tools, RAG over private documents, on-device agents, prototyping.
Hardware Reality
Local LLM performance is dominated by memory bandwidth, not raw compute. This is why Apple Silicon punches above its weight, why a $300 used GPU often beats a $3,000 CPU, and why "I have a fast CPU" is rarely the right answer for serious local work.
Apple Silicon
Apple's unified memory architecture means the GPU can address all of system RAM with full memory bandwidth — there is no separate VRAM and no PCIe bottleneck. An M3 Max with 64 GB or 128 GB RAM is one of the best machines on the market for running 70B-class models locally. M2 Ultra and M3 Ultra Mac Studios with 192 GB RAM can run 70B models comfortably with full context. Realistic tokens-per-second on a Llama 3 70B at Q4_K_M typically lands in the high single digits to low double digits on M-series Macs — usable for interactive chat, fast enough for most agent workflows. Smaller 7B and 13B models run dramatically faster, often at conversational speeds that rival hosted APIs.
NVIDIA GPUs
A modern consumer card (RTX 4090, RTX 5090) with 24–32 GB of VRAM runs 7B–13B models at speeds that feel instant and 30B–34B models comfortably. For 70B you need either two consumer cards via tensor-parallel or a single workstation card (A6000, RTX 6000 Ada) with 48 GB of VRAM. Datacenter cards (A100, H100) are overkill for personal use but standard for production vLLM deployments.
CPU-Only
Modern x86 CPUs with AVX-512 (and Apple Silicon's CPU cores) can run small models acceptably — a 3B Phi or Qwen at Q4 produces output at conversational pace. 7B models on a recent CPU produce text at slower-than-reading-speed pace; usable for batch jobs, not for chat. 13B and up on CPU only is generally too slow to be practical.
Quantization Levels
Quantization compresses model weights from FP16 (16-bit floats) into smaller integer representations. Lower quantization means smaller model on disk, less RAM usage, faster inference — at the cost of some quality.
- Q4_K_M — 4-bit, K-quants, mixed precision. Ollama's default. The sweet spot for most users; quality loss vs FP16 is small enough to be invisible on most tasks.
- Q5_K_S, Q5_K_M — 5-bit. A small step up in quality at a small cost in size. Worth it if you have the RAM.
- Q6_K — 6-bit. Near-FP16 quality at roughly 60% of the size. A good choice for production work where the extra fidelity matters.
- Q8_0 — 8-bit. Effectively indistinguishable from FP16 on most benchmarks. Use this when you have the RAM and want to remove quantization as a variable in your evaluation.
- FP16 / BF16 — Full precision. Roughly 2x the RAM of Q8. Rarely worth it for local inference; the quality gain is small and the memory cost is large.
Real benchmark numbers vary widely by platform, model, prompt length, and quantization, so be skeptical of any single tokens-per-second figure quoted on the internet without context. Always measure on your own hardware with your own workload before committing to a model size.
Production Use Cases & Limits
The honest framing for local LLMs in 2026 is that they are excellent for a specific class of problem and a poor fit for a different class. Knowing which is which separates teams that ship local-LLM products from teams that try and abandon them.
When Local Makes Sense
Coding tools and developer assistants — code completion, code search, internal documentation chat. Latency matters, privacy of source code matters, and 7B–32B coding models (Qwen 2.5-Coder, DeepSeek-Coder) are genuinely useful for this work even though they can't match Claude on hard problems.
RAG over private documents — chatting with a company wiki, legal contract corpus, customer support history, or a personal knowledge base. The retrieval step does most of the heavy lifting; the local model just has to synthesize the retrieved chunks. A 7B–13B model is plenty for this, and the privacy story is decisive.
On-device agents and automation — local agents that manipulate files, automate desktop tasks, or run continuously in the background. A hosted API at scale is too expensive; a local model runs free and never sends your filesystem contents to a third party.
Embeddings at scale — generating vector embeddings for millions of documents for semantic search. Hosted embedding APIs are cheap per call but expensive in aggregate. nomic-embed-text running locally on Ollama produces production-grade embeddings at zero marginal cost.
Edge and air-gapped deployments — anywhere a hosted API is structurally impossible: ITAR-restricted environments, classified networks, vehicles, factories with no internet, regulated medical settings.
When Local Doesn't Make Sense
Frontier-capability tasks — anything where the marginal IQ of the model decides whether the product works at all. Hard reasoning, complex agentic planning, code generation in unfamiliar languages, advanced math. Frontier hosted models are still meaningfully ahead, and the gap matters more than the privacy or cost benefits for these use cases.
Very long contexts — hosted models in 2026 routinely accept 200K–1M+ token contexts. Local models support long context in principle but the memory footprint and inference time grow with context length, and consumer machines hit the wall well before frontier-API limits.
High concurrency multi-tenant serving — if you need to serve a hundred concurrent users from a single endpoint, vLLM on a GPU is the right answer, not Ollama. Ollama supports basic concurrency but is optimized for single-user or low-concurrency workloads.
Multimodal at the frontier — vision and audio capabilities in local models have improved dramatically (LLaVA, Qwen2-VL) but still trail GPT-5 and Gemini 2 on hard visual reasoning.
Sources: Ollama official documentation, Ollama GitHub repository, llama.cpp project. Hardware ranges and tokens-per-second figures are practitioner estimates as of April 2026 and vary substantially by configuration; always benchmark on your own hardware.
Explore More Guides
The capability gap to frontier hosted models is real — and that doesn't make local less interesting.
There is a reflexive enthusiasm in the open-source community that wants every Ollama review to claim "local models have caught up to GPT-4." They have not, and pretending otherwise wastes practitioners' time. A 70B Llama 3.3 at Q4_K_M, running on the best consumer hardware available in 2026, is meaningfully behind GPT-5, Claude Opus 4, and Gemini 2 on hard reasoning tasks, code generation in unfamiliar territory, long-context retrieval, and most agentic planning benchmarks. The gap is smaller than it was in 2023, but it is real, and acknowledging it is how grown-ups make architecture decisions.
What that honest framing makes possible is the actually interesting use case: local-where-local-wins, hosted-where-hosted-wins, and a system architecture that uses both. RAG over the company wiki with a 7B local embedding model and a 13B local generator. Code completion in the editor with a 7B coding model so private source never touches a third party. A frontier hosted API for the hard architectural questions and the production reasoning paths. The split is not a compromise — it is the right design. Teams that try to build their entire stack on hosted APIs hit cost walls at scale; teams that try to build their entire stack on local models hit capability walls on hard work. The hybrid is what ships.
The genuinely good Ollama use cases for most practitioners in 2026: coding assistants on private code, RAG over private documents, embedding generation at scale, on-device agents, offline development, and any workflow where the privacy story is decisive. For those, Ollama is the right default — not because it's the most capable runtime (vLLM is faster at scale, llama.cpp is more flexible) but because it's the runtime with the lowest friction from "I want a local LLM" to "I have a working OpenAI-compatible endpoint on localhost." That friction matters more than benchmark differences for most teams. Install it, pull Llama 3.3, point your existing OpenAI client at port 11434, and ship.