← All articles

Run AI on Your Own Laptop: A Beginner's Guide to Ollama

· 5 min read

Run AI on Your Own Laptop: A Beginner's Guide to Ollama

This guide is for students, freelancers and developers who want to run an AI model on their own computer, for privacy, for offline use, or to learn how models work. You will install Ollama, run a model, check whether it fits your hardware, and learn the settings that matter. Every command comes from Ollama's own documentation.

What Ollama is

Ollama is an open-source tool for running language models on your own machine. Its GitHub README describes models from several families you can run, including Gemma, Qwen, DeepSeek, gpt-oss and others, and points to ollama.com/library for the full list. It runs on macOS, Windows and Linux.

Running locally has a clear benefit for privacy. Ollama's FAQ says that when you run locally, "we don't see your prompts or data". Cloud-hosted models are a separate option inside Ollama and work differently, which we cover below.

Local models also have limits. They run on your hardware, so they are slower than hosted services on a weak laptop, and the models you can fit are smaller than the largest hosted ones. Treat local AI as a private, free-to-run option for many tasks, not a replacement for everything.

Step 1: install Ollama

The README gives these install options:

- **macOS and Linux:** run curl -fsSL https://ollama.com/install.sh | sh in a terminal, or download the macOS installer. - **Windows:** run irm https://ollama.com/install.ps1 | iex in PowerShell, or download OllamaSetup.exe. - **Docker:** use the official ollama/ollama image.

Piping a script from the internet into your shell runs it with your permissions. If you prefer, download the installer from the official site and run it yourself.

Step 2: run your first model

The README's example is "ollama run gemma4". The first time you run a model, Ollama downloads it, which can be several gigabytes, so use a good connection. After that it opens a chat in your terminal. Browse ollama.com/library to pick other models.

Ollama's quickstart also lists desktop apps and coding agents you can connect, and it offers a command such as "ollama launch claude" to start Claude Code with an Ollama model. Check the quickstart page for the current list before relying on it.

Step 3: check that the model fits your machine

Model size decides speed. A model that does not fit in memory runs slowly. We do not give a table of RAM-to-model sizes here, because the right size changes with each model and its quantisation. Instead, use what Ollama shows you:

- The library page for each model lists its download size. As a rough guide, you need at least that much free memory. - Run "ollama ps" while a model is loaded. The PROCESSOR column tells you whether it sits 100% on the GPU, 100% on the CPU, or split between them. The FAQ explains that a split means part of the model is in system memory. - If it is too slow, try a smaller model from the same family.

For NVIDIA graphics cards, the GPU documentation says Ollama supports cards with compute capability 5.0 or higher and driver version 550 or newer.

Your first hour with Ollama: install, run a model, check memory, set context, stay private, build on it
The six steps in this guide, from the Ollama README and FAQ.

Settings worth knowing

- **Context window.** The FAQ says Ollama uses a context window of 4096 tokens by default. That is how much text the model can consider at once. For long documents you can raise it, at the cost of more memory. - **Keep alive.** Models stay loaded for a while after use so the next answer is faster. You can change this with the OLLAMA_KEEP_ALIVE variable. - **Model storage.** Models are stored under .ollama/models in your user folder on macOS and Windows, and the FAQ gives a different path on Linux. Set OLLAMA_MODELS to move them to another drive, which helps on small laptop disks.

Keeping it private and safe

Ollama listens only on 127.0.0.1, port 11434, by default, so other computers cannot reach it. The FAQ shows how to change this with OLLAMA_HOST. Do not expose it to the internet without putting authentication in front of it.

If you want local-only behaviour, the FAQ describes turning off Ollama's cloud features with the environment variable OLLAMA_NO_CLOUD=1, or a setting in the server.json file. You then lose cloud models and web search. Also remember that the model's answers can still be wrong, and a local model can still fall for prompt injection if it reads untrusted text; see our guide to [prompt injection](https://encoderbytes.com/Blog/prompt-injection-explained-security-hole-in-every-ai-app).

Building with it

Ollama exposes a local REST API at http://localhost:11434/api/chat, which takes a JSON body with a model name and messages. There are official libraries: "pip install ollama" for Python and "npm i ollama" for JavaScript. That makes it easy to prototype an app on your laptop with no API bill, then switch to a hosted model if you need more quality or scale.

Mistakes to avoid

- Downloading a model far larger than your memory and blaming Ollama for being slow. - Exposing the port to your network or the internet "for convenience". - Assuming local means correct. Check important outputs. - Forgetting how much disk space several models use.

Where to start

Install Ollama, run one small model, and ask it to summarise a text file you own. Run "ollama ps" to see how it loaded. If it is slow, try a smaller model. Once that works, try the Python library to script the same task.

Sources

Ollama README: https://github.com/ollama/ollama Ollama Local FAQ: https://github.com/ollama/ollama/blob/main/docs/faq.mdx Ollama GPU documentation: https://github.com/ollama/ollama/blob/main/docs/gpu.mdx Ollama quickstart: https://github.com/ollama/ollama/blob/main/docs/quickstart.mdx

Frequently asked questions

Is Ollama free?

Ollama is open source and running models locally has no per-use fee. It also offers cloud models, which are optional and use an account.

Does Ollama send my prompts to the internet?

Ollama's FAQ says it does not see your prompts or data when you run locally. Cloud models are processed on Ollama's servers, and you can turn the cloud features off.

How do I know if a model fits my laptop?

Check the download size on the model's library page and run ollama ps while it is loaded. The PROCESSOR column shows whether it runs on the GPU, the CPU, or both.

Can I use Ollama from my own code?

Yes. It serves a local REST API on port 11434 and has official Python and JavaScript libraries.

Contact

Let's Discuss Your Project

Tell us what you are building. Every conversation is covered by a mutual NDA.

What happens next

  1. 1Our team contacts you within one business day
  2. 2An initial discussion to understand your requirements
  3. 3A scope assessment and proposal

We reply from info@encoderbytes.com.