Run Any AI Model Locally in Minutes with Ollama: A Beginner’s Guide to Private, Offline AI

Why Run AI on Your Own Computer?

Every AI interaction you have with ChatGPT, Claude, or Gemini travels to a remote server, gets logged, and may influence future training. For many tasks — summarizing documents, coding help, brainstorming — that’s fine. But what if you want to keep your notes private, avoid rate limits, or simply work without an internet connection? That’s where Ollama comes in [S1]. Ollama is an open-source application that downloads and runs large language models directly on your machine. It supports major models like Gemma, Llama, Qwen, and DeepSeek, and exposes both a chat interface and a local REST API at localhost:11434 [S2]. With 180,000+ stars on GitHub, it’s the most popular way to run LLMs locally [S1].

The core promise is simple: your data stays on your hardware. No cloud upload, no API key, no subscription fee [S2].

What You Need

  • A computer running macOS, Windows, or Linux
  • At least 8 GB RAM (16 GB recommended for larger models)
  • About 2–4 GB of free disk space per model (the smallest models are ~1 GB)
  • No account, API key, or cloud subscription required

The official install script handles everything on macOS and Linux [S3]. Windows users get a PowerShell one-liner or an installer download [S2].

Installing Ollama

Installation is a single command on any platform [S3]:

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

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

Windows:shell irm https://ollama.com/install.ps1 | iex

Paste the command into a terminal (macOS/Linux) or PowerShell (Windows) and press Enter. The installer downloads a small binary and adds the ollama command to your system PATH. After installation, verify it worked: “shell ollama --version ` You should see a version number like ollama version 0.5.x`.

Once installed, start Ollama as a background service — it auto-starts on login after the install completes [S2]. You can check the service is running: “shell ollama serve “ This command keeps the model server listening on port 11434. Leave it running in a terminal tab or as a background process.

Your First Chat

Pick a lightweight model to start. Gemma 2B is small, fast, and runs on any modern laptop [S2]. Download and chat with it in one command: “shell ollama run gemma2:2b ` Wait a moment while Ollama downloads the model (~1 GB) and loads it into memory. Once the prompt appears, type your question and press Enter: ` >>> What is the capital of France? The capital of France is Paris. “ That’s it — you’re chatting with an AI model running entirely on your computer. No data leaves your machine [S1]. The model responds token by token, so you see words appearing as they’re generated — a small but satisfying detail that makes the interaction feel immediate.

The first run may take a minute while the model downloads from the OCI registry. Subsequent runs use the cached copy and start in seconds.

Working with Documents

Ollama shines when you combine it with your own files. The simplest way is to use an Open WebUI or continue in the terminal with copy-pasted text. For a quick document workflow:

  1. Save your text file locally (e.g., notes.txt).
  2. Feed the content as context in the chat:

“` >>> Read the following and summarize:

<PASTE YOUR TEXT HERE>

Summary: “`

Because the model runs locally, you control what data it sees — no upload required [S2]. This makes Ollama suitable for sensitive notes, draft code, or personal journals where you’d rather not send the content to a remote API.

For more structured workflows, the Ollama Python library lets you process documents programmatically: “shell pip install ollama python -c "import ollama; print(ollama.chat('gemma2:2b', [('user', 'Hello!')])['message']['content'])" “ This gives you a private AI endpoint you can integrate into scripts, browser extensions, or local dashboards — without any cloud cost or API key [S1].

Building Your Own AI App

When you’re ready to go beyond the terminal, Ollama exposes a REST API at localhost:11434 [S3]. You can call it from any language using standard HTTP: “shell curl http://localhost:11434/api/chat -d '{ "model": "gemma2:2b", "messages": [{"role": "user", "content": "Why is the sky blue?"}], "stream": true }' ` The streaming option (set to true) sends tokens as they are generated — this is the mechanism that lets user interfaces display responses in real time. If you prefer a complete response in one block, set this option to false`.

You can also pull other models with ollama pull <model_name> [S1]. Check what’s available in the library at ollama.com/library.

Common Model Choices

| Model | Size | RAM needed | Best for | Notes | |—|—|—|—|—| | gemma2:2b | 1.5 GB | 4 GB | Quick chats, simple Q&A | Fastest download [S2] | | llama3.2:3b | 2 GB | 6 GB | General reasoning | Good balance [S1] | | qwen2.5:7b | 4 GB | 8 GB | Coding, analysis | Popular mid-range [S1] | | deepseek-r1:8b | 5 GB | 10 GB | Deep reasoning | Largest on this list [S1] |

Troubleshooting

  • Model downloads fail: Check your internet connection and disk space. Ollama stores models in ~/.ollama.
  • Out of memory: Use a smaller model (e.g., gemma2:2b instead of qwen2.5:7b).
  • Port 11434 in use: Restart Ollama — the service auto-starts on login after installation [S2].
  • Mac with Apple Silicon: Models run on GPU via Metal for faster performance [S2].

One Thing to Know

Ollama downloads each model only once and caches it locally. A 7B model needs roughly 5–6 GB of disk space, so plan accordingly. The REST API is only accessible from your own machine by default — do not expose localhost:11434 to the open internet without a firewall and authentication [S2].

Bottom Line

Ollama turns any modern computer into a private AI workstation with three steps: install, run, chat. No subscription, no cloud, no data leaving your desk. For beginners, start with ollama run gemma2:2b and your first answer appears in under five minutes. For developers, the local REST API unlocks custom AI apps without infrastructure. Try it tonight if you’ve ever wanted AI that stays on your machine.

Sources

  1. [S1] Ollama – GitHub Repository — Ollama Inc. (2023-03-01)
  2. [S2] Quickstart – Ollama Documentation — Ollama (2026-09-03)
  3. [S3] Ollama README – Installation and Usage — Ollama (2026-09-01)