Language ModelsExplainer
What Is Ollama? I Tried to Run the New Qwen4 on a 24 GB Laptop
Ollama is a free, open-source program that downloads open models and runs them on your own computer. I tried four Qwen3 models and the new Qwen4 on a MacBook Air with 24 GB. An 8-billion-parameter model took 5 GB and generated about 17 tokens per second. Qwen4, with only 3 billion active parameters, would not load at all.
8 min read

Ollama is a free, open-source program (MIT license) that downloads open-weight language models and runs them on your own computer. It works from the command line and as a local server on port 11434 with its own REST API and an OpenAI-compatible API, so other programs can use local models the way they use cloud ones. By default it serves a model compressed to roughly 5 bits per parameter. What you can run is limited by memory: the model should fit in GPU memory, and on a Mac only part of the RAM is available to the GPU.
On 4 December Ollama 0.40.21 added support for Qwen4-35B-A3B, a new open model from Alibaba that uses only 3 billion parameters per token. That sounds like a model made for a laptop. I downloaded it to a MacBook Air with 24 GB of memory, and Ollama refused to load it. The model needed 33.4 GiB. Ollama could give it 17.3.
That refusal says a lot about what Ollama is and what it can and cannot do for you.
What Ollama is
Ollama is a program that downloads open-weight language models and runs them on your own machine. It is open source under the MIT license, and as of December 2026 its GitHub repository has about 189,000 stars. It runs on macOS, Windows and Linux, and there is an official Docker image.
You use it in two ways.
- From the terminal.
ollama run qwen3:8bdownloads the model if needed and opens a chat. - As a local server. Ollama listens on
http://localhost:11434. Its own REST API and an OpenAI-compatible API live there, so a script written for a cloud model can be pointed at a local one by changing the address.
The models come from the library at ollama.com/library: Qwen, Gemma, gpt-oss, DeepSeek and others. Each model has tags for sizes and compression levels, such as qwen3:8b or qwen3:14b. Ollama now also offers cloud models. With those, your request goes to Ollama's servers, so "local" applies only to the models you download.
How it works
Ollama runs a background server. The ollama command is a client that talks to it.
When you request a model, the server loads its weights into memory and runs them with an inference engine. Ollama builds on llama.cpp and, on Apple silicon, can also use Apple's MLX. In my runs ollama ps reported the llamacpp runner for every Qwen3 model.
A few defaults matter in practice:
- Compression. The default tag is Q4_K_M: nominally 4 bits, about 5 bits per parameter on average. An 8-billion-parameter model that would take about 16 GB at full precision is a 5.2 GB file. Quality drops a little, and on a laptop that is the usual trade.
- Memory release. A loaded model stays in memory for 5 minutes after the last request.
ollama stop <model>unloads it at once. - Network. The server binds to 127.0.0.1, so only the same computer can reach it. The
OLLAMA_HOSTvariable changes that. The local API requires no authentication, so if you open it to a network, anyone who can reach the port can use your models. - Storage. On macOS, models are kept in
~/.ollama/models.
How much memory a model needs
A model is a set of numbers, its parameters, and all of them have to be in memory for it to answer. Ideally they sit in GPU memory. Whatever does not fit, Ollama runs on the CPU, more slowly.
On a Mac with Apple silicon, the CPU and GPU share one pool of memory, but macOS gives the GPU only part of it. On my 24 GB laptop Ollama saw 17.3 GiB available to the GPU, about 70%. The limit can be raised with the iogpu.wired_limit_mb system setting, at the cost of memory for the system itself.
What ran on a 24 GB MacBook Air
I gave four Qwen3 models and Qwen4 the same 10 questions with known answers: 5 arithmetic word problems and 5 made-up customer messages to sort into one of five categories. Ollama 0.40.21, default settings except two: reasoning turned off in the request and answers capped at 1,500 tokens.
Speed is generation speed in tokens per second on the arithmetic problems, where answers are long, excluding the first request after loading.
| Model | File | Loaded | Speed | Correct of 10 |
|---|---|---|---|---|
| Qwen3-4B-Instruct-2507 | 2.5 GB | 3.2 GB, 100% GPU | about 34 tokens/s | 9 |
| Qwen3-8B | 5.2 GB | 5.1 GB, 100% GPU | about 17 | 9 |
| Qwen3-14B | 9.3 GB | 9.7 GB, 100% GPU | about 8 | 9 |
| Qwen3-30B-A3B (3B active, thinking-only release) | 18.6 GB | 19 GB, 6% on CPU | about 22 | 10, reasoning before every answer |
| Qwen4-35B-A3B (3B active) | 35 GB | refused |
The 4B and 30B come from the later 2507 release. The 4B only answers, with no reasoning mode. The 30B always reasons, and that cannot be turned off.
Ten questions are too few to rank the models by quality, and they differed on only one: a complaint that a password reset email never arrives, which I had filed under "account" and the three smaller models filed under "technical". The table answers a different question: what runs at all, and how fast.
Going from 8 to 14 billion parameters halved the speed. Qwen3-30B-A3B generated tokens faster than the 14B, but it reasoned before every answer and wrote several times more text. So each answer took longer: 9 to 34 seconds for a one-word category. I scored its final line after the reasoning, which is how it got the password email right.
The 30B did not fit entirely in GPU memory. Its first load took 78 seconds, its first answer ran at 5 tokens per second, and swap grew from 4.9 to 12 GB. On this laptop, that is the edge.
What the Qwen4 error tells you
Qwen4-35B-A3B is a mixture-of-experts model. It contains many expert blocks and switches on only a few of them for each token, so its compute per token is close to that of a 3-billion-parameter model.
Which experts the next token needs is not known in advance, so all of them have to be loaded. The model card lists 35 billion parameters, plus a 20-billion-parameter n-gram embedding table and a 2-billion-parameter multi-token prediction module. The card says the n-gram embeddings add no accelerator memory overhead, but Ollama 0.40.21 still estimated 33.4 GiB for the model. That is about 36 GB, more than the laptop's entire memory. Ollama did not split the model between GPU and CPU, as it did with the 30B. It returned an error, and the log does not say why.
Active parameters set the compute. Total size decides whether the model loads. I did not try other runtimes or manual offloading of experts to system memory.
Ollama vs LM Studio
LM Studio does the same basic job: it downloads open models and runs them locally. The verifiable differences:
- License. Ollama is open source under MIT. The LM Studio desktop app is distributed under its own proprietary terms. Some of its components, such as the
lmscommand-line tool and the MLX engine, are open source under MIT. - Interface. Ollama's core is a server with a command line and an API. LM Studio is built around a desktop chat window with a model browser, and it can also run a local server.
- Engines. Both use llama.cpp. On Apple silicon both can also run models through MLX.
Neither changes the memory a model needs. If you want a server that other programs call, Ollama is built for that.
When a local model is not enough
I run local models wherever cloud models are not allowed, mostly because of NDAs and sensitive data. In those cases I deploy the model on our own hardware, and the data is not sent to outside services.
On a laptop, though, the models that fit are often too weak for hard problems, programming above all. They give weaker solutions, structure the code poorly and make more mistakes. That is a matter of hardware, not of local models as such. A larger model needs a server with more memory. I did not test programming or coding-specific models here; this part is my experience, not the table.
So the rule is simple. If your data may leave your machine and the task is hard, a cloud model is the easier choice. If it may not, you need a local model anyway, and Ollama is one of the simplest ways to run one. The question then is how much memory you give it.
How to start
- Install Ollama with the installer from ollama.com, which also starts the server. With Homebrew, run
brew install ollamaand thenbrew services start ollama. - Download a model:
ollama pull qwen3:8b(5.2 GB). - Chat with it:
ollama run qwen3:8b. - Check where it runs:
ollama ps.100% GPUin the PROCESSOR column means the model fits in GPU memory. - Unload it:
ollama stop qwen3:8b.
Pick a model whose file is well below the memory your GPU can use. On my laptop a 9 GB file ran fully on the GPU, and an 18.6 GB file already spilled onto the CPU.
Limits
One laptop, one run per model, 10 questions each. Speed varies between runs: the 4B gave 23 tokens per second in a morning check and 34 in the evening. It also depends on what else is open. During the test macOS held 4 to 6 GB of other apps in swap, and up to 12 GB while the 30B was running.
Sources
Vladimir Beskorovainyi, Enterprise AI Architect & CTO, author of the Amazon bestseller "Enterprise AI: The KATA Way", founder of Besk Tech (besk.tech)
More in this section
Language ModelsExplainer
What Is an LLM? I Asked One Who First Walked on Kepler-442b
An LLM, a large language model, continues text with the most likely next piece. I measured that on my laptop: the model named a first person on a planet no one has visited, and the numbers inside it showed it was guessing.
Language ModelsExplainer
What Is Inference in AI? My Laptop Spent 64 Seconds Reading the Prompt and 32 Writing the Answer
Inference is a trained model doing its job: reading your input and producing an output, on every request. I measured both halves on my laptop and lived with their limits on a production GPU. Reading a long prompt took twice as long as writing the answer, and on my own server the bill came in memory, not tokens.
Language ModelsExplainer
What Is a Token in AI? I Ran the Same 71 Tasks on Three Models
A token is the unit a language model reads, writes and bills in. I gave the same 71 tasks to three Claude models. The mid-size one got 57 of 63 right for about half the price of the largest, which got 58. In this test the model choice moved the bill far more than trimming the context did.
Get new articles by email
One message when something new is published. No other mail, and you can stop at any time.
The address is used for this one letter and nothing else. Privacy