Run models locally

Install and check Ollama

Install Ollama, verify the local service, and distinguish a missing runtime from a missing model.

Download Ollama for macOS, Windows, or Linux from the official site and install it.

Open a terminal and check the installed version:

ollama --version

Then ask the local API which models are available:

curl http://localhost:11434/api/tags

A JSON response means the service is reachable. An empty model list is fine. It means the runtime works but you have not pulled a model yet.

A connection error means the service is not listening. Start the Ollama application or service before changing application code.

This small health check gives us two separate facts:

runtime reachable?
requested model installed?

Keep those checks separate in a real application. “AI unavailable” is harder to diagnose than “Ollama is not running” or “gemma3:1b is not installed.”

Lesson completed

Take this course offline

Get every free book, course edition, and software download.

Get the download library →