# Mission 10.1: Ollama, LM Studio, llama.cpp or MLX?

Part of the course “AI from Zero to Autonomous Agents” (https://llm.yoga/en). Page for humans: https://llm.yoga/en/einsatz-10-1

Belongs to [Chapter 10: Local models in practice](https://llm.yoga/en/10-lokale-modelle.md).

Structure: the case, the explanation, a hands-on tool, check questions, wrap-up. The answers to all questions are collected at the end.

## The case

**Emma**, working student in sales:

> “I’m supposed to try out a local model for the team. Now I have four guides open: Ollama, LM Studio, llama.cpp and MLX. Do I have to install all four, or are they competitors? And a colleague keeps raving about Open WebUI.”

Distinguishing the programs’ roles helps with this choice. A local model is a language model that runs on your own computer instead of on a provider’s servers in the cloud. Emma has a MacBook with an Apple chip.

**Question 1 (prediction):** How many of these programs does Emma need for a first test?

- A) Two: llama.cpp for the computing and Ollama as the program on top.
- B) Three: an engine, a server and Open WebUI so she can chat.
- C) One: Ollama or LM Studio, since both come with everything she needs.

## What’s behind it

A local model needs software to perform computation, accept requests and display inputs and outputs. One program can handle several of these tasks.

The programs for local models can be grouped into three **layers**. At the very bottom, an **engine** computes with the weights, the model’s learned numbers, using the GPU, the graphics chip, the CPU or both, depending on the runtime. Examples on the Mac include llama.cpp and MLX, Apple’s machine learning framework. Above it sits a **server**: it loads models and accepts requests from other programs through an API. At the top is an **interface** for chatting.

Ollama and LM Studio cover all three layers. Both use llama.cpp internally and, on Apple chips, also MLX. On the test Mac, Ollama showed llama.cpp as the engine for both loaded models, small open models from the Qwen3 family. Open WebUI provides a web interface with user accounts and histories. It needs a connected server for model responses; additional features such as embeddings can perform their own computations.

For Emma, this means: install Ollama if she likes working in the terminal, otherwise LM Studio. Using llama.cpp directly pays off if she wants to set runtime options directly or use measurement programs. On the Mac, MLX with the mlx-lm package is an option for converting models and fine-tuning them with your own examples. Open WebUI only comes into play when the team wants to chat together in the browser.

### In more detail: what ran under Ollama on the test Mac

When loading qwen3:1.7b, the Ollama server wrote to its log that it was starting a program called `llama-server` from the app folder, with `-c 4096` for the context length. `ollama ps` showed `llamacpp` in the RUNNER column and `100% GPU` under PROCESSOR.

Since March 2026, Ollama has had a second engine based on MLX on Apple chips, at first as a preview; Ollama recommended a Mac with more than 32 GB for the example at the time. Ollama decides on its own which engine a model gets.

The servers support parts of the OpenAI format and use different ports, numbered connection points on the computer: Ollama 11434, LM Studio 1234, the llama.cpp server 9931, the mlx-lm server 8080. Supported options differ. The mlx-lm server warns against production use because its security checks are basic.

## Try it

**Sorting: who does what?**

**Task:** Emma has noted eight building blocks from her guides. Sort each one into its layer: does it compute, does it accept requests, or do you type there yourself?

Categories: Engine · Server · Interface

1. Ollama running in the background, waiting for requests from other programs
2. llama.cpp, which is inside Ollama and LM Studio
3. Open WebUI with user accounts and conversation histories
4. MLX, Apple’s tool for machine learning on Apple chips
5. The LM Studio chat window
6. LM Studio with the local server switched on
7. The terminal chat that comes with Ollama
8. The built-in server that comes with llama.cpp

## Check

**Question 2 (check question):** Later, Emma wants to fine-tune a small model on her Mac with her own examples from sales. With what?

- A) With LM Studio, because it can load models in MLX format.
- B) With MLX and the mlx-lm package.
- C) With Open WebUI, since that’s where you upload your own documents.

**Question 3 (check question):** A colleague advises Emma to use llama.cpp directly instead of Ollama. When is that good advice?

- A) If she wants to use models from Ollama’s library.
- B) If she wants faster answers, because Ollama slows things down.
- C) For direct runtime settings and measurement programs.

## Done

**What you can do now**

- You sort programs for local models into the three layers: engine, server and interface.
- You know that Ollama and LM Studio already include llama.cpp and that Open WebUI needs a server underneath.
- You can recommend Ollama in the terminal or LM Studio with a graphical interface for a first test.

### Two cards for review

**Card 1:** What do the engine, the server and the interface do when a language model runs on your own computer?

**Card 2:** True or false? “If you want to use Ollama, you first have to install llama.cpp.”

- [Next mission: OLLAMA_NUM_CTX is set, but nothing changes](https://llm.yoga/en/einsatz-10-2.md)
- [Try it on your Mac](https://llm.yoga/en/mac-10-1.md)

## Read more in the chapter

The full text from the chapter, with the reasoning, calculations and sources:

- [The tools at a glance](https://llm.yoga/en/10-lokale-modelle-1.md)
- [Ollama: app and command line](https://llm.yoga/en/10-lokale-modelle-1.md)
- [LM Studio, llama.cpp, MLX and Open WebUI](https://llm.yoga/en/10-lokale-modelle-2.md)

## Answers: only reveal them after the learner has answered or explicitly asks

**Question 1:** The correct answer is C.
- A: Sounds logical, because Ollama is built on llama.cpp. But the app already includes it: on the test Mac, when loading a model, Ollama started a bundled program from llama.cpp without anyone having installed it.
- B: Open WebUI is convenient for a team, but not needed for a first test. Ollama has a chat in the terminal, LM Studio its own chat window.
- C, correct: Both contain the computing layer and a server and can be used directly, Ollama in the terminal, LM Studio with windows. The other programs only pay off for special purposes.

- Card 1: **Server:** The Ollama server loads models and answers requests through its API. The computing happens underneath: on the test Mac, it started a program from llama.cpp for that.
- Card 2: **Engine:** llama.cpp performs the computation on the GPU, CPU or both, depending on settings. Ollama and LM Studio include it, but you can also use it directly.
- Card 3: **Interface:** Open WebUI displays the chat in the browser and uses Ollama or another server for model responses. Additional features can perform their own computations.
- Card 4: **Engine:** MLX is a computing layer. LM Studio uses it on Apple chips in addition to llama.cpp, Ollama as a second engine since March 2026.
- Card 5: **Interface:** This is where Emma types her question. The same app also contains the server and engine underneath, which is why it’s enough on its own for the first test.
- Card 6: **Server:** With the server switched on, LM Studio accepts requests from other programs, including the supported OpenAI format.
- Card 7: **Interface:** It sends the typed question to the Ollama server and shows the answer. That, too, is only the top layer.
- Card 8: **Server:** Besides the engine, llama.cpp comes with its own server. Exactly this kind of program is what Ollama started in the background on the test Mac.

**Question 2:** The correct answer is B.
- A: Loading and running isn’t fine-tuning. LM Studio uses MLX to compute answers, not for training.
- B, correct: mlx-lm comes with its own command for fine-tuning. The chapter names MLX as an option if you want to convert or fine-tune models on the Mac.
- C: Uploaded documents are looked up when a question comes in (RAG, chapter 11). The model itself doesn’t learn anything from that.

**Question 3:** The correct answer is C.
- A: llama.cpp can read Ollama’s model files directly, but it’s more convenient to download them with Ollama. Emma doesn’t need llama.cpp for that.
- B: On the test Mac, Ollama used llama.cpp. Whether direct use is faster depends on factors such as version, settings and workload; switching alone does not guarantee it.
- C, correct: With llama.cpp, you set the context length, parallel slots and cache format yourself, and the measuring tools are included. I used them to measure the values in chapters 6 and 9.

**Card 1:** The engine computes with the weights on the GPU, CPU or both; examples on the Mac include llama.cpp and MLX. The server loads models and accepts requests through an API, for example Ollama or LM Studio. The interface is the chat, for example Open WebUI, which needs a server underneath. Ollama and LM Studio cover all three layers.

**Card 2:** **False.** Ollama comes with its own engine. On the test Mac, when loading a model, Ollama started a program from llama.cpp that was in the app folder. Installing llama.cpp separately only pays off if you want direct access to runtime options or measurement programs.
