Ollama vs LM Studio speed on an M4 Pro: a tie

Same Mac, same model file, same 600 token limit: 11.74 tokens a second in LM Studio and 11.50 in Ollama. The difference is in what each lets you change.

0:00

Ollama vs LM Studio speed on an M4 Pro: we ran the same Gemma 4 31B file through Ollama 0.32.6 and through LM Studio on a Mac with an M4 Pro chip and 48 GB of memory. The writing speed was within 2%: 11.74 tokens a second in LM Studio and 11.50 in Ollama. What separates them is not speed. It is what each lets you change.

Ollama vs LM Studio speed: is Ollama faster on an M4 Pro?

No, not by a margin you would notice. Each ran 15 timed runs across five tasks with the same 600 token limit, the same machine and the same model file, so the weights were identical.

Measure LM Studio Ollama
Writing speed, middle of 15 runs 11.74 tokens a second 11.50 tokens a second
Slowest and fastest run 11.40 and 12.04 11.31 and 11.62
Wait for the first token, 3,800 token prompt 46.1 seconds 45.3 seconds
Same prompt sent again 0.11 and 0.32 seconds 0.11 and 0.13 seconds
Runs with no visible answer at 600 tokens 6 of 15 7 of 15

Does Ollama use more memory than LM Studio?

It may, but our test cannot prove it. Ollama’s own listing showed 19 GB for the loaded model at both 32,768 and 65,536 tokens of context, all on the graphics chip. The Ollama process measured by the operating system was 24.9 GB after its first run at 65,536 and 33.2 GB after 15 runs. LM Studio’s process measured 20.6 to 22.6 GB, but we sampled it differently, once during a run and once when idle, so the two numbers are not a fair match. The detail is in our test of Ollama’s context and memory.

Which handles a repeated prompt better?

They behave the same. Both read a 3,800 token document in about 45 to 46 seconds the first time, and both answered in a fraction of a second when sent the same document again, because each keeps the prompt it has just read. Change the first line and both read the whole document again. This is the trap described in our guide to measuring tokens per second.

Do both give empty replies at a 600 token limit?

Yes. Gemma 4 thinks before it writes, and at 600 tokens LM Studio returned nothing in 6 runs of 15 and Ollama in 7 of 15. The cause is the same in both, explained in our study of where its tokens go.

Which should I use for Gemma 4 31B on a Mac?

On speed it is a tie, so choose on what you need to change. Ollama let us turn thinking off with one setting, and that removed every empty reply and cut the typical wait roughly in half, as set out in our guide to turning off thinking in Ollama. In LM Studio, setting the reasoning effort to none did the same for one prompt on Qwen 3.8 27B, though we did not repeat that with Gemma 4, as set out in our guide to turning off thinking. If you already have the model file, importing it into Ollama takes two commands.

Which is faster on each kind of task, Ollama or LM Studio?

Neither. We broke the 15 runs down by task, and the two programs stayed within a few tenths of a token a second of each other on all five.

Task LM Studio Ollama
Explain, about 250 words 11.71 to 12.04 11.31 to 11.54
Write a Python function 11.74 to 11.76 11.55 to 11.59
Summarise, about 200 words 11.45 to 11.78 11.46 to 11.51
List ten checks 11.45 to 11.78 11.50 to 11.62
Work out a train time 11.40 to 11.74 11.41 to 11.49

Figures are tokens a second, slowest to fastest of three runs. LM Studio’s fastest runs were a little quicker and Ollama’s were a little more even, but no task favoured one program.

The same held when we repeated a prompt. Ollama took 45.3 seconds to read a 3,809 token document the first time and 0.11 seconds the second, which matches what LM Studio did with the same document.

What context window does each choose if you do not set one?

Here they differ, and it matters more than the speed. Ollama chose 32,768 tokens for this model on our 48 GB Mac. LM Studio, when another program asked for the model without stating a size, loaded it at 8,192. We know that because the coding agent that triggered the load refused to start and reported the figure. A long document or a coding agent will not fit in 8,192 tokens. In LM Studio we set 65,536 when loading the model. In Ollama we set it per request. Whichever you use, check the window before you trust a result.

How long does each keep the model in memory?

Ollama’s listing showed the model due to unload four minutes after its last use. After that the next request pays for a fresh load. LM Studio’s listing showed no time limit, and the model stayed loaded until we unloaded it. For a model of this size that is a real difference in feel: come back after a coffee and Ollama has to load 17.65 GB again.

How long does Ollama take to load Gemma 4 31B?

The first request after the import waited 8.2 seconds for the model to load. When we changed the context window, the next request waited 2.6 seconds while it reloaded. Once the model was in memory, the load step took about 0.24 seconds a request. We did not time the load in LM Studio in this test, so we are not comparing the two on it.

Does either program keep a second copy of the model file?

Ollama does. Importing our file made a second 17.65 GB copy inside Ollama’s own store, so the model took about 35 GB of disk across the two programs. LM Studio ran the file it had downloaded itself. If disk space is tight, that is a reason to pick one program and stay with it.

Which works better with coding agents?

We can only speak for LM Studio here. We ran three coding agents, Pi, OpenCode and Hermes, against this model through LM Studio’s server, and all three completed a task. Their largest requests ran to 10,243, 34,666 and 30,030 tokens. We have not run them through Ollama. One thing follows from the numbers all the same: the biggest of those requests is larger than the 32,768 token window Ollama picked on its own, so an agent that heavy would need the window raised in Ollama first.

Which should I use if I only want one of them?

If you want settings you can change on each request, including turning thinking off, Ollama made that simple in our test. If you want the model to stay loaded and to serve other programs such as coding agents, LM Studio did that without extra steps once the context window was set. On speed and on empty replies there is nothing to choose between them.

Ollama has since changed the engine it runs on a Mac: Ollama makes its MLX runner the default on Apple silicon.

How we tested Ollama against LM Studio

One Mac with an M4 Pro chip and 48 GB of memory, macOS 27.0.1. LM Studio with its llama.cpp Metal runtime 2.47.0, and Ollama 0.32.6, both loading the same 17.65 GB Q4_0 file. Five tasks, three runs each, 600 tokens allowed, temperature 0, and a different first line on every prompt. Ollama was run at a 65,536 token context to match LM Studio. Speed is each program’s own report. The method is on how we test.

Sources

  1. Google's Gemma 4 31B QAT model card
  2. LM Studio developer documentation
Cite this page

Hill. "Ollama vs LM Studio speed on an M4 Pro: a tie". Onticpost, published 4 October 2026, updated 26 October 2026. https://onticpost.com/ollama-vs-lm-studio-speed-m4-pro-gemma-4/

Updated 26 October 2026. This address stays the same when the piece is updated.

Share this

Subscribe to our newsletter

Checked: what AI can do for your business, checked by humans. Free, every Friday. One email a week, leave any time.

Free, every Friday. We send a link to confirm first. Our privacy policy says what we keep.