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.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
JSON Formatter & Validator
Format, beautify, and validate JSON online. Paste your JSON to instantly pretty-print it with 2-space, 4-space, or tab indentation. Minify JSON too. Free, runs in your browser.
Open free tool →
Regex Tester
Free regex tester. Test regular expressions against multiple strings with expected match/no-match assertions — see instant pass/fail results. Built-in presets for email, URL, IPv4, and phone. Pro: unl
Open free tool →
Base64 Encoder & Decoder
Free Base64 Encoder & Decoder. Convert text, images, and any file to Base64 and back. Supports URL-safe Base64, image data URIs, and file download from Base64. Runs 100% in your browser — no data sent
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
Best AI Code Review Tools 2026: CodeRabbit, Sourcery, DeepCode & Bito Compared
Compare top AI code review tools for 2026: CodeRabbit, Sourcery, DeepCode, and Bito. Features, pricing, GitHub/GitLab integration, and choosing the right tool for your team.
AI Code Review Tools 2026: GitHub Copilot, CodeRabbit, Qodo Merge Ranked
Compare AI code review tools for 2026: GitHub Copilot code review, CodeRabbit, Qodo Merge, Sourcery, and PR-Agent. Pricing, accuracy, and GitHub integration.
AI Coding Tools Comparison 2026: GitHub Copilot vs Cursor vs Windsurf vs Cline
Comprehensive comparison of the best AI coding tools in 2026: GitHub Copilot, Cursor, Windsurf, and Cline. Pricing, features, model support, and real-world benchmarks.
AI Pair Programming in 2026: GitHub Copilot vs Cursor vs Claude Code
Master AI pair programming in 2026. Compare GitHub Copilot, Cursor, and Claude Code for autocomplete, chat, and agentic workflows. Includes setup guides and productivity tips.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
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 |
|---|---|---|---|
| Interface | CLI + REST API | Desktop GUI | CLI + server |
| Ease of use | Very easy | Very easy | Technical |
| Model format | GGUF (auto) | GGUF (manual) | GGUF (manual) |
| OpenAI API compat | Yes | Yes | Yes (server) |
| GPU support | CUDA, Metal, ROCm | CUDA, Metal | CUDA, Metal, Vulkan |
| Ideal for | Developers, API apps | Non-technical users | Advanced customization |
| Model library | ollama.com registry | HuggingFace browse | Manual 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.
Related Products
on GumroadAI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →AI Developer Prompts Pack
55 battle-tested prompt templates for the workflows developers actually use: code review, debugging, architecture, documentation, and testing. Stop writing prompts from scratch.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
AI Hallucination Detector
Scan LLM-generated text for hallucination risk signals: fabricated citations, overconfident claims, suspect statistics, and verification gaps. Risk score 0-100 with highlighted problem spans.
Open free tool →
AI Safety Checklist Generator
Generate a customized AI safety evaluation checklist for your deployment. Covers technical safety, content moderation, security, bias, privacy, and regulatory compliance. Export to Markdown.
Open free tool →
CrewAI Agent Config Generator
Build CrewAI agent configurations visually. Define roles, goals, backstories, and tools. Generate YAML or Python code for multi-agent crews.
Open free tool →
More Free Tools
Related Articles
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.
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.
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.
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.
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.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →