Ollama Tutorial
This Ollama tutorial shows you how to run large language models (LLMs) on your own computer instead of sending every request to a cloud API. Ollama is a free, open-source tool that downloads open-weight models, runs them locally, and exposes them through a simple command line and a REST API.
Think of Ollama as a package manager plus a runtime for AI models. One command pulls a model, a second command chats with it, and any app on your machine can talk to it over HTTP on port 11434.
What is Ollama?
Under the hood Ollama wraps a fast inference engine (based on the llama.cpp family of work) and adds model management, a model library, a server and client libraries. You do not need to know Python machine learning tooling, CUDA setup or model file formats to get started.
Ollama runs on Windows, macOS and Linux. It uses your GPU when one is available (NVIDIA, AMD, or Apple Silicon) and falls back to the CPU when not.
Why Run LLMs Locally with Ollama?
- Privacy: prompts and documents never leave your machine.
- No per-token bill: once a model is downloaded, using it is free.
- Works offline, on a plane or inside a locked-down network.
- Great for prototyping AI features before choosing a paid provider.
- An OpenAI-compatible endpoint means many existing tools work with it unchanged.
Your First Ollama Command
After installing Ollama (next chapter), open a terminal and run a small model. The first run downloads it; later runs start in seconds.
ollama run llama3.2 "Explain what an API is in one sentence."An API (Application Programming Interface) is a set of rules that lets one piece of software request data or actions from another. (Sample response - the exact wording varies between runs and models.)
What This Ollama Tutorial Covers
- Installing Ollama and checking hardware requirements
- Pulling, running, listing and removing models with the CLI
- Customising models with a Modelfile
- The REST API: /api/generate, /api/chat and /api/embed
- The OpenAI-compatible endpoint
- The official Python and JavaScript libraries
- Embeddings, structured output, quantization and GPU memory
- Open WebUI and using Ollama from Node.js and Laravel apps
Model names, versions and features in the AI world change quickly. Commands in this tutorial reflect Ollama at the time of writing (2026); always check ollama.com/library for the current list of models.
Frequently asked questions
Is Ollama free?
Yes. Ollama is open source and free to use. The models it runs are open-weight models, each with its own licence, so check the licence if you plan commercial use.
Does Ollama need internet?
Only to download models. Once a model is pulled, Ollama runs fully offline.
Is Ollama the same as ChatGPT?
No. ChatGPT is a hosted service. Ollama is a tool that runs open models such as Llama, Gemma, Qwen or Mistral on your own hardware.