# Chapter 10: Local models in practice

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

*From your first ollama run to your own API: choose tools, estimate memory requirements and check the main settings.*

About 25 min to read · about 30 min hands-on exercise

**Start with the missions**

This chapter also comes as 3 short missions with a case, a decision and feedback, about 10 minutes each:

- [10.1 Ollama, LM Studio, llama.cpp or MLX?](https://llm.yoga/en/einsatz-10-1.md)
- [10.2 OLLAMA_NUM_CTX is set, but nothing changes](https://llm.yoga/en/einsatz-10-2.md)
- [10.3 Switching a script from the cloud to a local model](https://llm.yoga/en/einsatz-10-3.md)

For agents, this page is split into 4 parts so that each part can be fetched in full. Read the parts the question needs.

## Parts

### Part 1: https://llm.yoga/en/10-lokale-modelle-1.md

- **Getting started**: A cloud service processes your input on the provider’s computers.
- **The tools at a glance**: Programs for local models can be grouped by their roles.
- **Ollama: app and command line**: Ollama comes as an app for macOS and Windows; on Linux you install it with a script.

### Part 2: https://llm.yoga/en/10-lokale-modelle-2.md

- **LM Studio, llama.cpp, MLX and Open WebUI**: LM Studio is a desktop app with a graphical interface for macOS, Windows and Linux.
- **The GPU memory budget on a Mac**: Apple advertises unified memory: CPU and GPU share the memory (chapter 6).

### Part 3: https://llm.yoga/en/10-lokale-modelle-3.md

- **Which model fits on 8, 16 and 24 GB?**: With the rule of thumb from chapter 9 and a GPU memory budget, you can estimate the requirements.
- **Using the local model from your own programs**: You can also call a local model from a script, an agent or a web interface.

### Part 4: https://llm.yoga/en/10-lokale-modelle-4.md

- **Exercise: your first local model**: Goal: you download a model, chat in the terminal, read the measurements, check memory and settings, and talk to the model through both APIs.
- **Common misconceptions**: A Mac with 24 GB can run a 20 GB model entirely and comfortably on the GPU.
- **Review questions**: 1. A colleague has a MacBook Air with 16 GB and wants a model for a programming project with 32,000 tokens of context.
- **Go further**: Ollama docs: FAQ (environment variables, Mac settings, parallel requests), context length, CLI, OpenAI compatibility, macOS.
