chapter three

3 Installing and Setting Up Ollama

 

This chapter covers

  • What Ollama is and how it works
  • The differences between cloud AI and local AI
  • Installing Ollama via Homebrew
  • Starting and verifying the Ollama service
  • Troubleshooting common startup issues

You now have a working terminal and Homebrew. In this chapter, you will install the most important tool in this book: Ollama, a program that lets you download and run large language models (LLMs) directly on your Mac. By the end of this chapter, Ollama will be running on your computer and ready to serve AI responses — entirely without an internet connection.

3.1 What Is Ollama?

Ollama is a runtime -- a program that lets you download, manage, and run large language models on your own computer.

Here is an analogy. To listen to music, you need two things: music files (the content) and a music player (the application). The music files contain the actual audio, but without a player, they are just data sitting on your hard drive. Ollama is the music player, and AI models are the songs.

You may already be familiar with applications that let you interact with AI models — tools like the ChatGPT app, Claude desktop, or similar interfaces. Ollama is similar in purpose, but it runs entirely on your own machine instead of connecting to a cloud server. Where those apps provide a polished interface to cloud-based models, Ollama gives you direct, offline access to open-source models that live on your own hard drive.

3.1.1 Why Ollama

3.1.2 How Ollama Works

3.2 Cloud AI vs. Local AI

3.3 Installing Ollama

3.3.1 Step 1: Update Homebrew

3.3.2 Step 2: Install Ollama

3.3.3 Alternative Installation Methods

3.3.4 Step 3: Verify the Installation

3.4 Starting the Ollama Service

3.4.1 Starting the Service

3.4.2 Verifying the Service

3.4.3 What Happens at Startup

3.4.4 Stopping the Service

3.4.5 Troubleshooting Common Issues

3.5 Summary

3.6 Exercises