Abdulkader Safi

How to run an LLM locally (and whether you need a GPU)

I run Ollama on a 16 GB M2 Pro. Here's the install, my tokens per second with and without the GPU, and which local model I use for which job.

7 min read

Share
The Easiest Way to Run LLM Models Locally: A Practical Guide Using Ollama and LM Studio

Short answer: install Ollama, run ollama run llama3.2:3b, and you have a working local LLM a few minutes later. You don't need a GPU for a small model. On my M2 Pro with 16 GB of memory, Llama 3.2 3B generated 72 tokens per second on the GPU and 39 with the GPU switched off. Half the speed, and still about seven times faster than you can read.

The rest is how to get there, how to measure your own machine, and the mistake I made first: using a model that couldn't do the job. My first local vision attempt renamed a photo im_sorry_but_i_cant_process_images.jpg.

Run your first local model

I use Ollama. It runs models as a background service, gives you a chat prompt in the terminal, and serves a local API your own code can call.

  1. Install it. On a Mac: brew install ollama, or download the app from ollama.com. Windows and Linux installers are on the same page.
  2. Pull and run a small model:
ollama run llama3.2:3b

The first run downloads the model (2.0 GB for this one, per the Ollama library page), then drops you into a >>> prompt. Ask it anything. Type /bye to leave.

  1. See what you have and clean up:
ollama list          # models on disk
ollama rm mistral    # delete one you don't use

That's a local LLM. The part most guides skip is that Ollama is also a server. Anything on your machine can call it:

curl http://localhost:11434/api/generate -d '{
  "model": "llama3.2:3b",
  "prompt": "Write a commit message for: fix null check in invoice export",
  "stream": false
}'

This is how my own apps use it. No API key, no bill, no network.

Do you need a GPU? My measured numbers

I ran the same model on the same prompt twice on my MacBook Pro: once normally, once with the GPU switched off.

Llama 3.2 3B on an M2 Pro, 16 GB Generation speed
GPU (default) 72 tokens/s
CPU only (num_gpu 0) 39 tokens/s

A note on what "no GPU" means on a Mac. Apple Silicon has no separate graphics card. The GPU sits on the same chip and shares the 16 GB with everything else. Forcing Ollama onto the CPU is the closest I can get to a laptop with no usable GPU, which is the machine most people asking this question have.

To judge whether a number is usable, compare it to how fast you read. Adults read non-fiction silently at about 238 words a minute (Brysbaert, 2019), and a token is about three quarters of a word (OpenAI). That works out to roughly 5 tokens per second. Anything above that streams faster than you can read it.

So on my machine the GPU roughly doubles the speed, and CPU only at 39 tokens per second is still well past reading speed for a 3B model. The one cost I noticed: switching to CPU made Ollama reload the model, which took about 5 seconds before the first word.

Memory is the real limit, not the GPU. The whole model has to fit in RAM, next to your browser and editor. The download size on the Ollama library is a fair floor for what a model needs:

  • llama3.2:1b is 1.3 GB and runs on almost anything
  • llama3.2:3b is 2.0 GB
  • llava:7b is 4.7 GB, fine on 16 GB
  • llava:13b is 8.0 GB
  • llava:34b is 20 GB, so it won't load on a 16 GB machine at all

No GPU just makes a model slower. Not enough memory means it doesn't run.

Measure your own machine in two minutes

Don't trust my numbers for your hardware. Ollama prints the speed if you ask it to:

ollama run llama3.2:3b --verbose

Ask a question, then read the eval rate line under the answer. That's generation speed in tokens per second. To force CPU only, type this at the >>> prompt and ask again:

/set parameter num_gpu 0

num_gpu is the number of model layers Ollama puts on the GPU. Zero means none.

The model matters more than the tool

When I built my AI image renaming app with Python, tkinter and Ollama, I pointed it at Mistral first. The renamed files came back as:

as_an_ai_language_model_i_cannot.jpg
i_dont_have_vision_capabilities.jpg
im_sorry_but_i_cant_process_images.jpg

Mistral is a text-only model. It can't see images, so it apologized, and my code dutifully turned the apology into a filename. Switching to LLaVA, a vision model, fixed it: IMG_0001.jpg became sunset_beach.jpg.

I left a guard in the app afterwards. If the model's answer contains phrases like "sorry", "cannot" or "as an ai", it stops and tells you to pick a vision model:

REFUSALS = ["sorry", "can't", "cannot", "unable", "don't have",
            "no image", "as an ai", "language model"]

if any(p in title.lower() for p in REFUSALS):
    raise ValueError("This model doesn't seem to support images. Try llava or llama3.2-vision.")

Detecting the wrong model by reading its apology is crude. It works.

So before "can my laptop run it", ask "can this model do the job":

  • Text in, text out: llama3.2, mistral
  • Images in: llava, llama3.2-vision
  • Search over your own documents: an embedding model, which turns text into numbers you can compare, plus a text model to write the answer

Ollama or LM Studio

I use Ollama, because both of my local AI apps are Python code that calls a model, and Ollama's local API is the shortest path to that.

LM Studio is the better first step if you'd rather click than type. It's a desktop app with a model browser, a chat window and its own local server. Two things changed since I first wrote this post:

  • LM Studio dropped its commercial license requirement on 8 July 2025, so it's free to use at work (Simon Willison's note).
  • Ollama 0.19, released 1 April 2026, rebuilt its Apple Silicon engine on MLX, Apple's own machine learning framework (launch page). MLX support used to be a reason Mac users picked LM Studio.

You can install both. They keep their own model folders, so a model you pulled in one gets downloaded again in the other.

My rule: if code will call the model, Ollama. If you just want to chat with one privately, LM Studio.

What I use local models for

Two jobs, both where privacy beats raw quality.

Renaming photos by what's in them. LLaVA looks at each image and suggests a short name. Whole folders go through it and none of the photos leave the laptop.

Asking questions about PDFs. My local PDF retrieval setup with Ollama splits documents into chunks, stores them in a FAISS index (a fast similarity search library from Meta), finds the three most relevant chunks for a question and hands them to Mistral to answer. The embeddings come from all-MiniLM-L6-v2, a small model that runs comfortably on a laptop CPU.

If you were prototyping on GitHub Models, a local Ollama install is one of the cheapest places to land now that it's being retired.

What stays in the cloud

Long, hard work. Refactoring across a codebase, reading a 100-page spec, anything that needs a big context window and careful reasoning. A 3B model on a laptop is quick and private. It is not a replacement for a frontier model on a hard problem, and pretending otherwise wastes more time than it saves.

Don't open it to your whole network by accident

Ollama listens on 127.0.0.1:11434 by default, so only your own machine can reach it. Some tutorials tell you to set OLLAMA_HOST=0.0.0.0 so another device can use it. That exposes it to everyone on the network, and Ollama has no login. If you need remote access, put it behind a reverse proxy with auth, and run through my self-hosted security checklist first.

What to do now

Run ollama run llama3.2:3b --verbose, ask it one question, and read the eval rate line. Then run it again with /set parameter num_gpu 0. Two numbers, two minutes, and you'll know exactly what your own machine can do before you download anything bigger.

Last updated 4 Nov 2026

FAQ

Frequently asked questions

How do I run an LLM locally?

Install Ollama from ollama.com (or `brew install ollama` on a Mac), then run `ollama run llama3.2:3b` in a terminal. It downloads a 2.0 GB model and opens a chat prompt. Everything after the download runs on your own machine, and Ollama also serves a local API on port 11434 that your own code can call.

Can I run an LLM without a GPU?

Yes. Small models run on the CPU alone, just slower. On my M2 Pro with 16 GB, Llama 3.2 3B ran at 39 tokens per second with the GPU switched off, against 72 with it on. The harder limit is memory, because the whole model has to fit in RAM. Stick to 1B to 7B models if you have 8 to 16 GB.

Do local LLMs need internet?

Only to download the model. Once `ollama pull` finishes, the model runs fully offline and nothing you type or attach leaves your machine. That is the reason I use local models for things like renaming private photos: the images never touch a cloud API.

What can you actually use a local LLM for?

Jobs where privacy or cost matter more than top-end quality. I use one to rename photos by what's in them (LLaVA through Ollama) and to answer questions about PDFs with a local retrieval setup built on FAISS. Short summaries, tagging, classification and drafts also work well. Long, hard coding work is still better on a large cloud model.

Why did my local model say it can't process images?

You pointed a text-only model at an image. Models like Mistral 7B only read text, so they answer with an apology, and if your code uses that answer, you get files named things like `im_sorry_but_i_cant_process_images.jpg`. Use a vision model such as `llava` or `llama3.2-vision` for anything involving pictures.

Ollama or LM Studio, which one should I start with?

Start with LM Studio if you want a desktop app with a model browser and a chat window. Start with Ollama if your own code will call the model, because it runs as a background service with a local API. LM Studio has been free for work use since 8 July 2025, and Ollama 0.19 moved its Apple Silicon engine to MLX in April 2026.

What to do now

Run `ollama run llama3.2:3b --verbose`, ask it one question, and read the `eval rate` line. Then run it again with `/set parameter num_gpu 0`. Two numbers, two minutes, and you'll know exactly what your own machine can do before you download anything bigger.

Written by

Abdulkader Safi

Software Engineer

Lead engineer at DSRPT, from Lebanon and based in Kuwait. I write about the tools and bugs from real client work, with the numbers I measured.

About me → GitHub LinkedIn

Need this kind of work done on your project?

Start a project →

Keep reading

All articles →