Table of Contents
An AI assistant that runs entirely on your own computer. No subscription, no API bill, no internet needed once it is downloaded, and nothing you type ever leaves your machine. That is not a future promise; you can have it working in about ten minutes.
The tool is Ollama. This guide installs it on Windows, Mac and Linux with the actual commands, helps you choose a model that fits your RAM instead of one that crawls, and shows you how to use it from your own code.
What you will have by the end:
✓ Ollama installed and verified
✓ A model chosen to match your computer, not a random one
✓ A working chat in your terminal, offline
✓ A local API you can call from Node, PHP or Python
✓ Your own custom assistant with a Modelfile
What Ollama Actually Does
When you use a cloud AI service, your words travel to somebody else’s server, get processed there, and come back. With Ollama the model file sits on your disk and runs on your own processor and memory.
1Install Ollama
Windows
Go to ollama.com/download, get the Windows installer, run it and follow the steps. When it finishes, Ollama runs quietly in the background and its icon appears in the system tray near the clock.
macOS
Download the macOS file from the same page, open it, and drag Ollama into Applications. Launch it once; the icon appears in the menu bar at the top of the screen. If you prefer Homebrew: brew install ollama.
Linux (and WSL)
The original guide said to “run the installation command” without showing it. Here it is:
curl -fsSL https://ollama.com/install.sh | sh
Pasting a script from the internet deserves a glance first. Open https://ollama.com/install.sh in your browser and read it before running, which is good practice with any curl | sh command, from any project.
Check it worked
ollama --version
$ ollama --version
ollama version is 0.12.3
Example output. Any version number means you are ready.
PICK PROPERLY2Choose a Model That Fits Your Computer
This is where most people go wrong. They install the biggest model they have heard of, it crawls at one word per second, and they decide local AI is not viable. The model must fit comfortably in your memory, with room left for everything else you are running.
HOW MUCH RAM DOES YOUR COMPUTER HAVE?
The rule of thumb: a model needs roughly half a gigabyte of RAM per billion parameters in its compressed form, plus a couple of gigabytes of working room. So a 7B model wants about 5 GB, and a 14B model about 9 GB. If you have a dedicated graphics card with its own memory, the same arithmetic applies to that, and it will be considerably faster.
3Run Your First Model
ollama run llama3.2
The first run downloads the model, which is a few gigabytes, so it takes a while. After that it starts in seconds and never needs the internet again.
$ ollama run llama3.2 pulling manifest pulling dde5aa3fc5ff: 100% ▕████████████████▏ 2.0 GB verifying sha256 digest writing manifest success >>> Explain what a Docker volume is, in two sentences. A Docker volume is a storage area managed by Docker that lives outside a container's own filesystem. Because it is separate, the data inside it survives when the container is deleted or rebuilt. >>> /bye
Example session. Type /bye to leave, or /? to see the in-chat commands.
Turn off your Wi-Fi and ask it something else. It keeps working. That moment is when the idea stops being abstract: a genuinely useful AI assistant, running on a laptop, with no connection at all.
Models worth knowing
| Model | Good at | Try |
|---|---|---|
| Llama 3.2 | General chat and writing. Small sizes that run almost anywhere. | ollama run llama3.2 |
| Llama 3.1 8B | A noticeable step up in quality, if you have the memory. | ollama run llama3.1 |
| Qwen 2.5 Coder | Writing and explaining code. The one to use as a coding helper. | ollama run qwen2.5-coder |
| Gemma 3 | Google’s open models, several sizes including very small ones. | ollama run gemma3 |
| Mistral 7B | Fast, solid all-rounder that has been popular for a long time. | ollama run mistral |
| DeepSeek-R1 | Reasoning step by step. Slower, but shows its working. | ollama run deepseek-r1:7b |
Model names move. New versions appear constantly and old tags get superseded, so check ollama.com/library for what is current rather than trusting any article’s list, including this one. Add a size tag to be specific: ollama run gemma3:4b.
4The Commands You Will Use
| Command | What it does |
|---|---|
ollama run <model> | Chat with a model, downloading it first if needed |
ollama pull <model> | Download without starting a chat, useful before travelling |
ollama list | What you have downloaded, and how much space each takes |
ollama ps | What is loaded in memory right now |
ollama show <model> | Details: parameter count, context length, licence |
ollama rm <model> | Delete a model and reclaim the disk space |
ollama serve | Run the background service manually, if it is not already running |
ollama run <model> "question" | Ask one question and get the answer, without entering chat mode |
$ ollama list
NAME ID SIZE MODIFIED
llama3.2:latest a80c4f17acd5 2.0 GB 2 hours ago
qwen2.5-coder:7b 2b0496514337 4.7 GB yesterday
mistral:latest f974a74358d6 4.1 GB 3 days ago
$ ollama ps
NAME SIZE PROCESSOR UNTIL
llama3.2:latest 3.1 GB 100% GPU 4 minutes from now
Example output. In ollama ps, “100% GPU” means it is running on your graphics card, which is much faster. “100% CPU” means it is not.
5Use It From Your Own Code
Ollama quietly runs a local API on port 11434. This is what turns it from a terminal toy into something you build with: no key, no bill, and your data never leaves the machine.
curl http://localhost:11434/api/tags
const res = await fetch('http://localhost:11434/api/chat', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'llama3.2', stream: false, messages: [ { role: 'system', content: 'You summarise text in exactly 3 bullets.' }, { role: 'user', content: '...paste the text here...' } ] }) }); if (!res.ok) throw new Error(`Ollama error ${res.status}`); const data = await res.json(); console.log(data.message.content);
<?php $payload = [ 'model' => 'llama3.2', 'stream' => false, 'prompt' => 'Write a one-line product description for a blue mug.', ]; $ch = curl_init('http://localhost:11434/api/generate'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode($payload), ]); $data = json_decode(curl_exec($ch), true); echo $data['response'];
Projects this makes easy: summarise your own notes, tag support emails, generate alt text for images in bulk, draft commit messages, or process a folder of client documents that must never leave the office. All free to run, as many times as you like.
6Make Your Own Assistant
A Modelfile wraps an existing model with your own instructions and settings. Create a file named Modelfile, with no extension:
FROM llama3.2 # 0 is focused and repeatable, 1 is creative and loose PARAMETER temperature 0.3 # how much conversation it can remember at once PARAMETER num_ctx 4096 SYSTEM """ You are a senior Laravel developer reviewing code for a junior. Always: point out security problems first, keep answers under 150 words, and show a corrected code snippet. Never: suggest a package without saying why it is needed. """
ollama create laravel-reviewer -f Modelfile ollama run laravel-reviewer
Now you have a permanent assistant with that personality, usable from the terminal or the API like any other model.
Want a Chat Window Instead of a Terminal?
Ollama is a command-line tool at heart, but several free interfaces sit on top of it and look like a normal chat app.
docker run -d -p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui --restart always \
ghcr.io/open-webui/open-webui:main
# Then open http://localhost:3000
When It Does Not Behave
It is painfully slow, one word at a time
The model is too big for your memory, so your computer is swapping to disk. Run ollama ps: if it says “100% CPU” and you have a graphics card, it is not using it. Otherwise drop to a smaller model, for example from a 14B to a 7B, or from a 7B to a 3B. A smaller model you actually use beats a bigger one you wait for.
Error: model requires more system memory
Exactly what it says. Close other applications, or pick a smaller size tag: ollama run gemma3:1b instead of the larger variants. Check what you have with ollama list and remove what you do not need.
Error: could not connect to ollama app
The background service is not running. On Windows and macOS, open the Ollama application. On Linux, sudo systemctl start ollama, or just run ollama serve in a terminal and leave it open.
Port 11434 already in use
Ollama is already running, usually from the tray or menu bar app, so you do not need to start it again. If you genuinely need a different port, set OLLAMA_HOST=127.0.0.1:11500 before starting it.
My disk is filling up
Models are large. ollama list shows the size of each, and ollama rm <model> removes one. It is easy to collect six models you tried once; keep two or three you actually use.
Can I run it inside WSL?
Yes, and the Linux install command works there. If you already run Ollama on Windows, you do not need a second copy: from WSL you can reach the Windows one over the network. See our WSL setup guide for the general environment.
Being Honest About the Limits
Local models are genuinely useful. They are not the same as the largest cloud models, and pretending otherwise leads to disappointment.
| Local with Ollama | Large cloud models | |
|---|---|---|
| Privacy | Complete. Nothing leaves your machine | Your text goes to a provider |
| Cost | Free after download | Per request, or a subscription |
| Works offline | Yes | No |
| Quality on hard problems | Good; a clear step behind the best | Still the leaders |
| Speed | Depends entirely on your hardware | Consistently fast |
| Best for | Private documents, bulk jobs, offline work, learning, experiments | Hardest reasoning, longest context, newest capabilities |
Most people end up using both. Local models for the routine, high-volume and private work, cloud for the genuinely hard questions. That split costs almost nothing and keeps your sensitive material at home.
Common Questions
Is Ollama really free?
Yes. The tool is open source and the models in its library are free to download and run. You pay in disk space and electricity. Some models have licences that restrict commercial use, so check ollama show <model> if you plan to build a product on one.
Do I need a graphics card?
No, but it helps a great deal. Small models run acceptably on a modern CPU. A dedicated GPU, or an Apple Silicon Mac with its unified memory, makes larger models practical.
Can it read my files?
Not by itself, but you can feed them in. From the terminal, pipe a file into it; from code, read the file and include the text in your prompt. Interfaces such as Open WebUI add file uploads on top.
Does it train on my data?
No. Running a model does not change it. Your conversations are not used for training by anyone, which is the entire privacy argument for doing this locally.
Which model should I actually start with?
Start small and go up. On 8 GB of RAM begin with llama3.2; on 16 GB try llama3.1 or qwen2.5-coder for programming. If it answers quickly, try a larger one. If it crawls, go smaller.
Can I use this for client work?
That is one of its best uses, precisely because client material never leaves your machine. Check the licence of the specific model if the output goes into a commercial product, and tell clients what you are doing, since “it runs on my own computer” is usually a reassuring answer.
The Full Video Guide
Here is the whole setup on video:
New AI, Linux, Docker and Laravel tutorials every week.
Read next: Apple Just Made the Case That Your Next AI Server Is a Mac, which is the same idea at a larger scale: owning the hardware instead of renting the tokens.
Final Thoughts
Two things decide whether local AI feels magical or disappointing. Pick a model that fits your RAM, because an 8 GB machine running a 3B model is genuinely pleasant while the same machine running a 14B one is misery. And use the API on port 11434, because that is where it stops being a novelty and starts replacing work you currently pay for.
Install it tonight, run the model the picker suggested, then turn off your Wi-Fi and ask it something. Tell me in the comments which model you landed on and how it ran. I read every one.
If this was useful, share it with someone paying monthly for something their laptop can do.


