Skip to main content

Ollama: Run LLMs Locally on Mac, Windows & Linux

Ollama is the fastest way to run open-source large language models entirely on your own hardware — no API keys, no cloud costs, no data leaving your machine. Install it in under a minute and have Llama, Mistral, or Gemma running locally in 2026.

✓ Completely private — no data sent to cloud ✓ OpenAI-compatible REST API ✓ macOS, Windows, Linux support ✓ GPU acceleration (CUDA, Metal, ROCm)
Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →

Installation

Ollama installs as a single binary with no dependencies. Choose your platform:

# macOS (Homebrew)
brew install ollama

# Linux (one-liner)
curl -fsSL https://ollama.com/install.sh | sh

# Windows
# Download the installer from https://ollama.com/download
# Or via winget:
winget install Ollama.Ollama

After installation, Ollama runs as a background service. Verify with ollama --version.

Pulling and Running Models

Use ollama pull to download a model and ollama run to start an interactive chat. Popular models and their approximate RAM requirements:

# Pull models (downloads to ~/.ollama/models)
ollama pull llama3.2          # Llama 3.2 3B — ~2 GB, fast on CPU
ollama pull llama3.2:7b       # Llama 3.2 7B — ~4.7 GB
ollama pull mistral           # Mistral 7B — ~4.1 GB
ollama pull gemma3            # Gemma 3 4B — ~3 GB
ollama pull phi4              # Phi-4 14B — ~8.9 GB
ollama pull deepseek-r1:7b    # DeepSeek-R1 7B — ~4.7 GB

# Start interactive chat
ollama run llama3.2

# Run with a one-shot prompt
ollama run mistral "Explain Docker in one paragraph"

# List downloaded models
ollama list

# Remove a model
ollama rm phi4

Models are stored in ~/.ollama/models on macOS/Linux and C:\Users\<user>\.ollama\models on Windows.

Using the Ollama REST API

Ollama starts an HTTP server on http://localhost:11434 automatically. It exposes two API styles: the native Ollama API and an OpenAI-compatible endpoint at /v1/chat/completions.

# Native Ollama API — streaming chat
curl http://localhost:11434/api/chat -d '{
  "model": "llama3.2",
  "messages": [{"role": "user", "content": "Why is the sky blue?"}],
  "stream": false
}'

# OpenAI-compatible endpoint (drop-in replacement)
curl http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama3.2",
    "messages": [{"role": "user", "content": "Write a Python hello world"}]
  }'

# Python with openai SDK pointing at Ollama
# pip install openai
from openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
response = client.chat.completions.create(
  model="llama3.2",
  messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Modelfile: Custom Model Configuration

A Modelfile lets you create a named model variant with a custom system prompt, parameters, and prompt template — similar to a Dockerfile for LLMs.

# Create a file named "Modelfile"
FROM llama3.2

# Set a persistent system prompt
SYSTEM """
You are a senior software engineer who gives concise, production-ready
code examples with minimal explanation. Always use modern best practices.
"""

# Tune generation parameters
PARAMETER temperature 0.3
PARAMETER num_ctx 8192
PARAMETER top_p 0.9

# Build and run
# ollama create dev-assistant -f Modelfile
# ollama run dev-assistant "Write a FastAPI endpoint for user auth"

Custom models appear in ollama list alongside downloaded models and can be shared with ollama push.

Ollama vs LM Studio vs llama.cpp

Feature Ollama LM Studio llama.cpp
InterfaceCLI + REST APIDesktop GUICLI + server
Ease of useVery easyVery easyTechnical
Model formatGGUF (auto)GGUF (manual)GGUF (manual)
OpenAI API compatYesYesYes (server)
GPU supportCUDA, Metal, ROCmCUDA, MetalCUDA, Metal, Vulkan
Ideal forDevelopers, API appsNon-technical usersAdvanced customization
Model libraryollama.com registryHuggingFace browseManual download

Frequently Asked Questions

What is Ollama and how does it work?▼

Ollama is an open-source tool that lets you download and run large language models entirely on your own hardware. It bundles model weights, configuration, and a lightweight inference server into a single CLI. When you run 'ollama serve', it starts a local REST API on port 11434 that any application can call — exactly like calling OpenAI's API but with no network requests leaving your machine.

Which models can I run with Ollama?▼

Ollama supports hundreds of models from its official registry including Llama 3.2 (1B–90B), Mistral 7B, Gemma 3 (1B–27B), Phi-4, Qwen2.5, DeepSeek-R1, CodeLlama, and many more. You can pull any model with 'ollama pull <name>'. Ollama uses GGUF quantized models, so a 7B model typically needs 4–6 GB of RAM.

What GPU and hardware do I need for Ollama?▼

Ollama runs on CPU-only hardware, but GPU acceleration dramatically improves speed. On macOS, it uses Apple Metal (M1/M2/M3/M4 chips are ideal). On Windows/Linux, it supports NVIDIA CUDA and AMD ROCm. A 7B model runs at roughly 5–10 tokens/sec on CPU, 50–100+ tokens/sec on a modern GPU. Minimum 8 GB RAM for 7B models; 16 GB+ recommended for 13B models.

Is Ollama compatible with OpenAI client libraries?▼

Yes. Ollama exposes an OpenAI-compatible REST API. You can point any OpenAI SDK at http://localhost:11434/v1 by setting the base URL. This means tools like LangChain, LlamaIndex, Open WebUI, AnythingLLM, and custom Python/Node apps work with Ollama without code changes — just swap the API base URL.

How do I create a custom model with Ollama?▼

Use a Modelfile — a simple text file similar to a Dockerfile. You specify FROM (base model), SYSTEM (system prompt), PARAMETER (temperature, context length, stop tokens), and TEMPLATE (prompt format). Run 'ollama create mymodel -f Modelfile' to build it. This lets you bake in personas, task-specific instructions, or custom context windows.

How does Ollama compare to LM Studio?▼

Ollama is CLI/API-first and ideal for developers who want to integrate local LLMs into apps or scripts. LM Studio provides a desktop GUI with a built-in chat interface and model browser — better for non-technical users or quick experimentation. Both support GGUF models and expose OpenAI-compatible APIs. Ollama is more scriptable; LM Studio is more visual.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

AI Hallucination Detector AI Safety Checklist Generator CrewAI Agent Config Generator AI Model Comparator AI Model Comparison Tool Jotai Atom Explorer LLM Cost Calculator CSS Container Query Builder LLM Context Window Calculator AI Prompt Cost Calculator LLM JSON Schema Builder AI Agent Run Cost Tracker AI Pipeline DAG Builder LLM Benchmark Calculator Prompt Injection Tester LangChain PromptTemplate Builder AI Token Cost Calculator MySQL Query Explainer PostgreSQL EXPLAIN Analyzer AI Model Benchmark Comparator Cron Expression Explainer Font Pairing Preview LLM Prompt Cost Calculator AI Model Context Window Visualizer OpenAI Prompt Tester AI Rate Limit Calculator LLM System Prompt Analyzer Vibe Coding Prompt Optimizer AI IDE Comparator Token Counter & Cost Estimator AI Model Comparison Table RAG Chunk Size Optimizer LLM Prompt Template Builder AI Commit Message Generator AI Doc Generator — Pro Tool AI Regex Explainer — Pro Tool AI System Guardian Mermaid Diagram Generator Elasticsearch Query Tester mTLS Certificate Chain Builder Prompt Token Estimator JS Prototype Chain Visualizer OpenAI Token Counter System Prompt Builder AI Agent Memory Planner Token Context Calculator LLM Prompt Caching Calculator Multi-Agent Orchestration Planner AI Prompt Token Estimator OpenAI Function Calling Generator AI Context Window Visualizer Embedding Storage Calculator AI API Rate Limit Calculator HTTP Headers Analyzer AI Code Review — Pro Tool AI Error Explainer — Pro Tool AI SQL Builder — Pro Tool AI Unit Test Generator — Pro Tool Color Palette Generator Docker Compose Generator JWT Decoder Prompt Template Builder Regex Tester RSA Key Pair Generator SMTP Server Tester Biome Config Generator Terraform Variable Validator Haproxy Config Validator SBOM Generator AI Variable Namer AI PR Description Generator AI JSDoc Generator K8s Resource Limits Calculator Regex Flags Explainer LLM Token Counter OAuth2 Flow Visualizer Playwright E2E Testing Guide Core Web Vitals Calculator RAG Chunking Calculator Solana Program ID Generator Multi-Chain Wallet Address Validator RAG Chunking Calculator TypeScript Discriminated Union Builder Core Web Vitals Budget Calculator JWT Decoder & Validator Blockchain Transaction Fee Calculator Database Query Cost Analyzer

Related Articles

Apr 2, 2026 · 11 min read

LLM Observability Tools 2026: OpenTelemetry, Langfuse, Arize Phoenix Compared

Compare LLM observability tools for 2026: Langfuse, Arize Phoenix, Helicone, LangSmith, and OpenTelemetry for LLMs. Tracing, evals, cost tracking, and self-hosting options.

Apr 2, 2026 · 13 min read

Prompt Engineering Techniques 2026: Chain-of-Thought, RAG, and Advanced Patterns

Advanced prompt engineering guide for 2026: Chain-of-Thought, Tree-of-Thought, RAG integration, few-shot learning, prompt chaining, and evaluation techniques.

Apr 1, 2026 · 11 min read

LLM Observability 2026: LangSmith vs Helicone vs Arize Phoenix Compared

Complete guide to LLM observability platforms in 2026. Compare LangSmith, Helicone, and Arize Phoenix for tracing, evaluation, cost tracking, and debugging AI applications in production.

Apr 1, 2026 · 13 min read

Prompt Engineering Techniques 2026: Chain-of-Thought, Few-Shot, and RAG Patterns

Master practical prompt engineering in 2026. Learn chain-of-thought prompting, few-shot examples, RAG integration patterns, and advanced techniques like tree-of-thought and self-consistency with real code examples.

Apr 1, 2026 · 14 min read

AI Observability in 2026: How to Monitor, Debug, and Improve LLM Applications

A comprehensive guide to AI observability for LLM applications: key metrics, tool comparisons (Langfuse, Helicone, Arize Phoenix, LangSmith), tracing code examples, evaluation frameworks, and production best practices for debugging and cost control.

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →