LM Studio vs Ollama vs llama.cpp: Tested on a 12GB GPU

Affiliate disclosure: As an Amazon Associate, I earn from qualifying purchases.

Quick answer

Once you set them up, they run at the same speed. On my RTX 5070 graphics card (12 GB) with the same 27B model file, Ollama, LM Studio and llama.cpp all reached about 45 to 46 tokens per second. Left to choose for themselves, they did not. LM Studio ran at about 13, Ollama at about 29 and llama.cpp at about 45.

The cause: Ollama and LM Studio left some of the model on the CPU, and LM Studio also turned on a speed-up called MTP. The check: in Ollama, run ollama ps and look for “100% GPU”. In LM Studio, drag the GPU Offload slider all the way to the right. Which to install: Ollama for the simplest start, LM Studio to click through every setting, llama.cpp if you like the command line.

  • Card: RTX 5070, 12 GB
  • Model: Qwen 3.8 27B, 9.95 GB file
  • Windows 11, tested 22 and 23 Nov 2026
  • After the fix: all 3 at about 45 to 46

I’m Afroz Ahmad, a CCIE network engineer. I ran this test on my own Windows PC and made a video of it. Every speed below comes from my own test script, not from the apps’ on-screen counters. Speed is in tokens per second: how many word pieces the model writes each second. Higher is faster.

Watch the full test (about 10 minutes), or read the results and fixes below:

Video LM Studio vs Ollama vs llama.cpp : Which One Is Actually Faster? (10:19) · Subscribe on YouTube

Results: how fast was each app?

All three apps used the same model file on the same card, with an 8K context. Context is the model’s working memory, counted in tokens.

AppLeft to choose for itself (tokens per second)After the fix
llama.cppAbout 45. It put all 66 layers on the graphics card.About 45. No fix needed.
OllamaAbout 29. It kept 4 of its 66 layers on the CPU.About 46.
LM StudioAbout 13. It set GPU Offload to 57 of 65 and turned MTP on.About 46.

Each speed is the middle value of 5 runs. Most setups were loaded 2 to 5 separate times, and the results agreed. LM Studio’s default was the least steady: between about 12 and 16 across 5 loads.

Why were the defaults so different?

The engine was not the difference. On my PC, Ollama and LM Studio each started their own copy of llama-server, the server program from llama.cpp. So the gap came from what each app decided for you.

A model is a stack of layers. Each app decides how many layers go on the graphics card (the GPU) and how many stay with the CPU and system memory. Every word the model writes passes through the whole stack. So a few layers on the slower CPU side hold up the rest.

Four horizontal bars. Blue is the share of layers on the graphics card, orange the share on the CPU. llama.cpp: all blue, about 45 tokens per second. Ollama: mostly blue with a small orange end, about 29. LM Studio: blue with a larger orange end plus MTP on, about 13. All three after the fix: all blue, about 45 to 46. Where each app put the layers Same 27B model, same 12 GB card On the graphics card On the CPU LEFT TO CHOOSE FOR ITSELF llama.cpp about 45 tok/s All 66 of 66 layers on the GPU Ollama about 29 tok/s 62 of 66 on the GPU, 4 on the CPU LM Studio about 13 tok/s GPU Offload 57 of 65, plus MTP on AFTER THE FIX All three 45 to 46 tok/s Every layer on the GPU, MTP off
My test on 22 and 23 November 2026: Qwen 3.8 27B (9.95 GB file), RTX 5070 with 12 GB, Windows 11. Each app counts layers its own way.

In Ollama, 4 layers out of 66 on the CPU cost more than a third of the speed: about 29 instead of about 46. LM Studio’s model loader set GPU Offload to 57, on a slider that goes up to 65. It also turned on MTP, a speed-up I explain below. Together, those two choices gave about 13.

One more detail about Ollama. Its documented default context is 4,096 tokens, but the Ollama app on my PC was already set to 8K. At 4K, it still kept 2 layers on the CPU and ran at about 35.

How do you check if your model is fully on the GPU?

Run this check before you trust any speed number. It takes a minute in each app.

  • Ollama: load a model and ask it something. Then open PowerShell: press the Windows key, type PowerShell and press Enter. Type ollama ps and press Enter while the model is still loaded. The PROCESSOR column should say 100% GPU. Mine said 9%/91% CPU/GPU, so 9% of the model was on the CPU.
  • LM Studio: open the model loader (the steps are in the LM Studio fix below) and look at GPU Offload. If the slider is not all the way to the right, some layers are on the CPU.
  • llama.cpp: in the llama-server window, look for a line such as load_tensors: offloaded 66/66 layers to GPU. The two numbers should match.
  • Any app: press Ctrl + Shift + Esc to open Task Manager. Go to Performance, then click your NVIDIA card. Look at Dedicated GPU memory. With this model, mine sat at about 11.5 of 12 GB.
The Processor column will show which memory the model was loaded into: 100% GPU means the model was loaded entirely into the GPU. 100% CPU means the model was loaded entirely in system memory. 48%/52% CPU/GPU means the model was loaded partially onto both the GPU and into system memory.
Ollama FAQ, “How can I tell if my model was loaded onto the GPU?” (read 29 November 2026)

How to fix Ollama: put every layer on the GPU

One setting took Ollama from about 29 to about 46 on my PC. You make a copy of your model with that setting, and your original model stays as it was.

  1. Open PowerShell (Windows key, type PowerShell, press Enter). Type ollama list and press Enter. Note your model’s exact name in the NAME column. It looks like model-name:tag.
  2. Open Notepad (Windows key, type Notepad, press Enter). Type these 2 lines, with your model’s name after the word FROM:
    FROM your-model-name:tag
    PARAMETER num_gpu 99
    99 is more layers than this model has, so Ollama puts all of them on the card.
  3. Press Ctrl + S to open Notepad’s Save box. Click the address bar at the top of that box. PowerShell’s line starts with something like PS C:\Users\YourName>. Type the folder part, between “PS” and “>”, for example C:\Users\YourName, and press Enter.
  4. In the File name box, type "Modelfile" with the quotes, so Notepad does not add .txt. Click Save.
  5. Back in PowerShell, type ollama create qwen-gpu -f Modelfile and press Enter. Here qwen-gpu is the new copy’s name, and you can pick any name. Wait until it prints success.
  6. Type ollama run qwen-gpu, ask it a question, then type /bye to leave the chat.
  7. Type ollama ps. The PROCESSOR column should now say 100% GPU.
If it doesn’t work

If ollama create prints an error instead of success, check 3 things. The file must be in the folder from step 3. Its name must not end in .txt. The name after FROM must match ollama list exactly.

If ollama ps still shows some CPU, close other apps that use the graphics card, type ollama stop qwen-gpu and run it again. If you still see CPU after that, the model does not fit your card, so pick a smaller one.

Ollama’s Modelfile docs do not list num_gpu, so I can only say it worked on my PC, with Ollama 0.40.16.

How to fix LM Studio: GPU Offload and MTP

Two settings took LM Studio from about 13 to about 46 on my PC, with LM Studio 0.4.28.

  1. In a chat, click Pick a model at the message box, then click Open model loader.
  2. Switch on Manually choose model load parameters, then click your model.
  3. Drag GPU Offload all the way to the right. For this model the slider went up to 65, and LM Studio had set it to 57.
  4. Click Show advanced settings and find Speculative Decoding. For this model it was set to MTP. Set it to Off.
  5. Click Load Model, then ask the model something to check the speed.

From the command line, my test script loaded the same setup with lms load qwen3.8-27b --context-length 8192 --gpu max --parallel 4 --no-speculative-draft-mtp. The model name there is my own copy’s name. Type lms ps to see what is loaded.

Leave Parallel alone. LM Studio’s Max Concurrent Predictions setting (Parallel) did not change the speed. With MTP off, 4 and 1 both ran at about 45.9. Setting 4 used about half a gigabyte more of the card.

llama.cpp: fast by default, but get the right build

llama.cpp is the open-source engine with no app around it. You start one program, llama-server, and it gives you a chat page in your web browser. I didn’t tell it how many layers to use. It put all 66 on the card and ran at about 45.

This is the command I ran in PowerShell, from the folder where llama-server is. Change the path after -m to where your model file is. On a phone, swipe the box sideways to see the whole command:

llama-server -m C:\models\Qwen3.8-27B-UD-Q2_K_XL.gguf -c 8192 -t 8 -ngl 99 -fa on --device CUDA0 --host 127.0.0.1 --port 8080 -np 1

-c 8192 sets an 8K context. -ngl 99 asks for every layer on the card, and its default is “auto”. --port 8080 is my choice, because this build’s own default port is 9931. When the window says the server is listening, type http://127.0.0.1:8080 into your browser’s address bar to open the chat page.

If llama.cpp is very slow

One llama.cpp build I tried ran on the CPU, at about 3.6 tokens per second. When you start llama-server, check its window. It should find your NVIDIA card and offload the layers.

If it doesn’t, go to llama.cpp’s releases page on GitHub. Download the Windows build with “cuda” in its name, such as llama-…-bin-win-cuda-13.5-x64.zip. Also download the cudart-llama-bin-win-cuda-13.5-x64.zip file with the same CUDA number, and unzip both into the same folder.

Is MTP worth turning on?

MTP stands for multi-token prediction. It is an extra part of this model file that makes a quick early guess at the next words. When the guess is right, the model writes more than one word at a time. It is a kind of speculative decoding, and LM Studio’s own docs warn that this can backfire:

If the draft model is not fast enough or effective enough at making “good” suggestions to the main model, the generation speed will not increase, and could actually decrease.
LM Studio docs, “Speculative Decoding” (read 29 November 2026)

On my card, MTP was fast on some loads and slow on others, with the exact same settings. I could not tell in advance which one I would get.

Setup, every layer on the GPULoadsSpeed
LM Studio, MTP on, Parallel 15About 65 on 3 loads, about 25 on the other 2.
LM Studio, MTP on, Parallel 4424 to 30 every time.
llama.cpp, MTP on3About 70 once, 32 to 33 the other 2 times.
Any of the three, MTP off13About 44 to 46 every time.

One more llama.cpp load ran at about 40 while my recording tools were starting, so I left it out of the table.

MTP also took about 0.8 GB more of the card. My best guess is memory. With MTP on, the card was almost full. Task Manager also shows Shared GPU memory, which is ordinary system memory the card can borrow. On the slow loads it went up by about 600 MB or more, and on the fast loads by only 160 to 340 MB. That points to part of the work spilling off the card, but I couldn’t prove it, so treat it as a guess.

If your speed jumps around from one load to the next, turn MTP off and compare. For this model on a 12 GB card, I’d leave it off. In llama.cpp, MTP stays off unless you turn it on yourself.

What if the model fits with room to spare?

I also ran Gemma 4 12B, a 7.12 GB file, on the same card. It fits easily. Ollama put it 100% on the GPU by itself, and in LM Studio and llama.cpp I asked for every layer on the card.

AppGemma 4 12B speed
llama.cppAbout 72 tokens per second.
OllamaAbout 71 tokens per second.
LM StudioAbout 63 tokens per second, even with GPU Offload at the maximum.

All three were fast, but LM Studio stayed about 12% behind. I don’t know why. Parallel 4 against 1 gave the same speed here too, and 4 used about 1 GB more of the card.

Which one should you install first?

InstallIf you want
OllamaThe simplest start, and other apps on your PC that can talk to it.
LM StudioTo see and change every setting with a mouse.
llama.cppFast defaults with no app in the way, and you don’t mind the command line.

Whichever you pick, make sure every layer is on the GPU before you trust a speed number. ollama ps should say 100% GPU. LM Studio’s GPU Offload should be at the maximum. The llama-server window should say every layer went on the card.

A network engineer’s check: Ollama’s FAQ says “Ollama binds 127.0.0.1 port 11434 by default.” 127.0.0.1 is the loopback address, and traffic to it never leaves your PC. Keep it that way unless you really need another device to reach Ollama.

How I tested

  • PC: Windows 11, an NVIDIA GeForce RTX 5070 with 12 GB, and 32 GB of RAM.
  • Apps: Ollama 0.40.16, LM Studio 0.4.28 and llama.cpp build b12633 (the CUDA build).
  • Models: Qwen 3.8 27B as Unsloth’s UD-Q2_K_XL file (9.95 GB), and Gemma 4 12B as a Q4_K_M file (7.12 GB).
  • Method: the same prompt every time (a beginner explanation of DHCP and subnet masks), 512 tokens, temperature 0 and a fixed seed. One warm-up run was thrown away, then 5 runs were timed.
  • Timing: my script timed the streamed answer from the first token to the last. The apps’ own speed readouts were not used.
  • Dates: 22 and 23 November 2026.

Some things were not identical, and you should know them. Ollama’s model was set to an 8K context, while Ollama’s own default is 4K. Ollama’s copy of Qwen also carried a 931 MB vision file that the other two apps did not load. Each app has its own build of llama.cpp. I only tested a 12 GB card on Windows, so an 8 GB or 16 GB card may behave differently. I did not compare load times, because each app reports them in a different way.

The card I tested on

All the numbers on this page come from an NVIDIA GeForce RTX 5070 with 12 GB of memory. Card makers sell it under their own names, so check that the listing says RTX 5070 and 12 GB.

Check latest price on Amazon

As an Amazon Associate I earn from qualifying purchases. It costs you nothing extra.

LM Studio vs Ollama FAQ

Is LM Studio faster than Ollama?

Not once both are set up. On my 12 GB RTX 5070 with Qwen 3.8 27B and MTP off, both ran at about 46 tokens per second. With their own default choices, Ollama ran at about 29 and LM Studio at about 13. With a smaller model that fit easily, Gemma 4 12B, Ollama was faster: about 71 against 63.

Does Ollama use llama.cpp?

On my PC, with this model, it did. Ollama started its own copy of llama-server, the server program from llama.cpp, and so did LM Studio. That is why all three apps reached the same speed once every layer was on the GPU.

Why is Ollama using my CPU instead of my GPU?

On my PC, Ollama decided the whole model would not fit on the card at an 8K context, so it kept 4 layers on the CPU. Run ollama ps in PowerShell. Anything other than 100% GPU means part of the model is on the CPU. Close other apps that use the card, try the num_gpu 99 Modelfile on this page, or pick a smaller model.

What does GPU Offload mean in LM Studio?

It is how many of the model’s layers LM Studio puts on the graphics card. All the way to the right means every layer. If you don’t set it, LM Studio decides by itself. On my PC it chose 57 of 65 for a 27B model, and that was slower.

What is MTP in LM Studio?

MTP means multi-token prediction. It is a part of some model files that guesses the next words early, so the model can write more than one word at a time. On my 12 GB card it was fast on some loads and much slower on others, so I turned it off.

Can a 12 GB GPU run a 27B model?

This one did. A 2-bit file of Qwen 3.8 27B, 9.95 GB on disk, ran fully on my 12 GB RTX 5070 at about 45 to 46 tokens per second with an 8K context. It filled about 11.5 GB of the card, so there is very little room to spare.

Terms used on this page

Tokens per second
how many word pieces the model writes each second. Higher is faster.
Layer
one step in the stack a model is made of. Every word passes through every layer.
GPU offload
putting a model’s layers on the graphics card instead of the CPU.
Context
the model’s working memory, counted in tokens. A bigger context needs more memory.
VRAM
the graphics card’s own memory. Task Manager calls it Dedicated GPU memory.
MTP (multi-token prediction)
a part of some model files that guesses the next words early, to write faster.
Modelfile
a small text file that tells Ollama how to build a model, including its settings.
llama-server
the server program from llama.cpp. It runs a model and serves a chat page in your browser.
The short version: on one 12 GB card with one model file, Ollama, LM Studio and llama.cpp all reached about 45 to 46 tokens per second once every layer was on the GPU. Their defaults were very different: about 29, 13 and 45. Check ollama ps or LM Studio’s GPU Offload slider first, and leave MTP off if your speed jumps around.

Next steps

Standards and primary sources

  1. Ollama, FAQ — default context of 4,096 tokens, what ollama ps shows, and the default address 127.0.0.1 port 11434.
  2. Ollama, Context length — default context by graphics card memory (4k below 24 GiB).
  3. Ollama, Modelfile reference — the documented parameters (num_gpu is not among them).
  4. LM Studio, lms load — the --gpu and --context-length options, and automatic GPU offload when not set.
  5. LM Studio, Speculative Decoding — how it works, and why it can make generation slower.
  6. LM Studio, LM Studio 0.4.0 release notes — Max Concurrent Predictions, Unified KV Cache, and its llama.cpp engine.
  7. llama.cpp, llama-server README — -ngl defaults to auto, the default port, and the MTP option.
  8. llama.cpp, releases on GitHub — the Windows CUDA builds and the matching cudart files.
  9. My own test on my PC, 22 and 23 November 2026 — every speed, layer count and memory figure on this page, from my test script’s logs.
All sources above were re-checked and verified on 29 November 2026. The speed numbers are from my own tests on 22 and 23 November 2026.
Cite this page
Afroz Ahmad, “LM Studio vs Ollama vs llama.cpp: Tested on a 12GB GPU”, afrozahmad.com, reviewed 29 November 2026.
https://afrozahmad.com/blog/lm-studio-vs-ollama-vs-llama-cpp/