Install Ollama and run your first model
In this lesson I install Olama on a Mac with Apple Silicon, start it as a background service and run a first language model on the Mac's own graphics processor. Nothing leaves the machine and there is no cost per question. Before you start you need two things, a Mac with an Apple Silicon chip and Homeblue. The package manager for macOS, one command checks both ARM64 means Apple Silicon. If brew is not found, the official installer is on brew.sa. Nothing else from other courses is needed. I work in an empty startup folder called localaiMac. Olama is a server that downloads, runs and serves open models. I install the version from Homebrew because it updates with everything else and it can run as a background service. Homebrew downloads the bottle, a ready-built package for this macOS version, and links the olama command, its dependencies are already on this mac, so it takes seconds. At the end, Homebrew shows how to run olama as a service. First the version. The command line tool is version 0.40.16 but it warns that no server is running, the olama command is only a client. The models run inside a server and the client talks to it over HTTP, the protocol of the web, on port 114034. Brew Services Tata registers the server with LaunchD, the macOS Service Manager, so it starts now and again at every login. The server answers and client and server agree on the version. Now a first model Gemma 4, size E4B, a small model from Google that fits easily in memory. If a model is not on your Mac yet, Olama Run downloads it first about 10GB for this one I downloaded it before recording, and the next lesson shows a real download. The think false flag turns off the model's thinking step, so the answer comes straight away. The first answer takes a few seconds longer because the server loads the model into memory. Without a question, olama.run opens a chat. A token is a piece of a word. The unit a model reads and writes to leave the chat, I type slash buy. Which models are loaded and where do they run? olama.ps answers both. The processor column says 100% GPU, for graphics processing unit. The whole model runs on the graphics processor, through Metal, Apple's graphics interface. The runner column says MLX, Apple's machine learning framework, which Olama uses for this model. On Apple Silicon, the processor and the graphics processor share the same memory, so the model does not have to fit in a separate graphics card. The until column says how long the model stays in memory after the last question, five minutes by default to free the memory right away use olama stop. Last the models on disk, olama list shows every model this server has. The files live in a hidden folder called olama models in the home folder of the user who runs the server. brew uninstall does not touch that folder, so when you reinstall olama your models are still there. You now have olama installed with homebrew running as a service on your mac and a first model answering on the graphics processor.