liveBook · Manning

Ollama serve

As explained in Build Applications with Local AI Models on a Mac

A command that starts the Ollama service and keeps it running while listening for requests.

Run `ollama serve` to start the Ollama service and keep it running while it waits for requests. It listens at 127.0.0.1:11434: localhost means this computer, and the port is like a numbered door. section 3.4.1

At startup, Ollama:

  • Checks available hardware, memory, and whether it can use GPU or Neural Engine acceleration. section 3.4.3
  • Opens port 11434 and waits for requests from terminal commands, Python scripts, or browsers. section 3.4.3
  • Occupies the current terminal. Leave it running and use a second terminal for other commands. section 3.4.1
Figure 3.3 The Ollama startup sequence. Steps ①–⑥ happen in order when you run ollama serve. Once Ollama reaches the “Ready!” state, it can receive requests from three different sources simultaneously: terminal commands, Python scripts, and browser requests.

Follow the startup sequence to see how Ollama reaches its ready state and accepts requests. section 3.4.3

How Build Applications with Local AI Models on a Mac covers it

How deep it goes
Describes hardware checks and port listening, without detailing the service’s internal implementation.
Examples
Uses `ollama serve`, localhost port 11434, and a second terminal as practical examples.
What you can do after
Operate Ollama by starting the service and keeping it available for requests.
How it connects
Connects local language models with terminal commands, Python scripts, browsers, and hardware acceleration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Applications with Local AI Models on a Mac. The section links point to the parts of the book it draws on.