| Quick answer: To get started with Ollama, install it with one command (code>brew install ollama/code> on macOS, the official script on Linux, or the Windows installer), then run code>ollama run llama3.3:8b/code> — it downloads and opens a chat. Learn code>pull/code>, code>run/code>, code>list/code>, code>rm/code> and code>ps/code>, customize with a Modelfile, and call the API on port 11434. Setup takes under five minutes, runs free and keeps data private. |

How we compare: TechieHub installs each tool on real consumer hardware — an Apple Silicon Mac and an NVIDIA laptop — runs the same models and prompts, and reports what actually happens rather than repeating vendor claims. This guide is editorially independent; some outbound links may be affiliate links, but they never change which tools we recommend or what we tell you.
Table of Contents
What is Ollama, and why run AI on your own machine?
Ollama is an open-source runtime that downloads, manages and serves large language models on your own computer through a simple command line and a local REST API. Think of it as Docker for AI models: it packages model weights, quantization settings and parameters into an image you pull and run, handling GPU acceleration and serving for you. The payoff is concrete — zero per-token fees, no usage caps, complete privacy because your prompts never leave the device, and full offline operation once a model is downloaded.
That combination has made Ollama the default way people run local AI. The project has passed 169,000 stars on GitHub and its model library now lists 200+ ready-to-run models, from tiny 1B assistants to 100B-plus cloud variants. If you are still deciding whether a small on-device model or a frontier cloud model fits your task, our overview of the best AI models and our primer on what a small language model is put Ollama’s sweet spot in context.
This Ollama tutorial for beginners: what you will build in one afternoon
This walkthrough is deliberately sequential, so each step earns the next. You will install the runtime, run your first model in the terminal, learn the handful of commands that cover almost everything, bake your own assistant with a Modelfile, and finally call a local model from code through the API. None of it requires prior machine-learning knowledge — if you can open a terminal and copy a command, you can finish the whole path in an afternoon.
- Step 1: Install Ollama and verify it.
- Step 2: Run an 8B model and chat with it.
- Step 3: Learn the core commands.
- Step 4: Create a custom assistant with a Modelfile.
- Step 5: Call the OpenAI-compatible API from Python.
How do you install Ollama?
Installation takes under five minutes and looks slightly different per platform. On macOS, run code>brew install ollama/code> or download the installer from the official Ollama site. On Linux, use the official script: code>curl -fsSL https://ollama.com/install.sh | sh/code>. On Windows, download and run the installer, or use code>winget install Ollama.Ollama/code>. Each method installs the runtime plus a background service that stays ready in the tray or as a systemd unit.
On Linux you can manage that service with code>systemctl start ollama/code>, code>stop/code> or code>restart/code>. If you prefer containers, Ollama ships an official Docker image — pull code>ollama/ollama/code> and expose port 11434 with a named volume so your models persist, which is the standard pattern for servers and air-gapped machines. GPU acceleration works out of the box on NVIDIA (CUDA), AMD (ROCm) and Apple Silicon (Metal); Ollama detects your hardware and offloads as many layers to the GPU as memory allows. Whatever route you take, confirm the install with code>ollama –version/code>.
How do you run your first model?
The single most important command is code>ollama run/code>. Typing code>ollama run llama3.3:8b/code> downloads the model the first time, then drops you straight into an interactive chat where you type a prompt and get a reply generated entirely on your own hardware. For a first model on 8–16 GB of RAM, an 8B model such as Llama 3.3 or Qwen 3 is the ideal starting point — strong quality, comfortable memory footprint, quick responses.
Inside the chat, type your message and press enter; type code>/bye/code> to leave. For scripting, run a one-shot prompt by adding it in quotes: code>ollama run llama3.3:8b “Explain recursion simply”/code> prints one answer and exits. Beyond the built-in library you can import any GGUF model from Hugging Face by pointing a Modelfile at the downloaded file, which opens up the entire open-model ecosystem. If your goal is a coding helper specifically, our guide to the best AI model for coding maps which open models punch above their weight.
Which commands do beginners actually need?
Ollama is a command-line tool, and a small set of verbs covers nearly everything you will do day to day.

| Command | What it does |
| code>ollama pull <model>/code> | Download a model without running it |
| code>ollama run <model>/code> | Run a model interactively (auto-pulls if missing) |
| code>ollama list/code> | List all downloaded models |
| code>ollama ps/code> | Show currently running models and where they are loaded |
| code>ollama stop <model>/code> | Stop a running model and free memory |
| code>ollama rm <model>/code> | Delete a model to reclaim disk space |
Two more round out the set: code>ollama show <model>/code> prints a model’s parameters and template, and code>ollama cp <model> <new>/code> copies or renames one. These eight cover roughly 95% of real use. Handy flags on code>run/code> include code>–verbose/code> (tokens-per-second stats), code>–num-ctx 4096/code> (context window) and structured JSON output for programmatic calls. The underlying server runs via code>ollama serve/code>, which the background service usually handles, though you can start it manually to watch the logs.
How do you customize a model with a Modelfile?
A Modelfile is a short text file that defines a custom model variant, much like a Dockerfile. You pick a base with code>FROM/code>, tune behavior with code>PARAMETER/code> lines (such as code>temperature/code> for creativity or code>num_ctx/code> for context length), and set a persistent code>SYSTEM/code> prompt that shapes the model’s role for every conversation.
For example, a Modelfile beginning code>FROM qwen3:8b/code>, a low temperature, and a system prompt like “You are a senior Python developer; write clean, typed, tested code” produces a specialized coding assistant. Build it with code>ollama create python-coder -f Modelfile/code>, then run code>ollama run python-coder/code> like any other model. Adding code>PARAMETER num_gpu 40/code> can noticeably speed inference on Apple Silicon. This is how you turn a general model into reusable, purpose-built assistants — a tutor, a reviewer, a writer — without touching the underlying weights.
How do you call the Ollama API?
Chatting in the terminal is only the start; the real power is the API. Ollama exposes a local HTTP REST API on port 11434 with endpoints for generation, chat, embeddings and streaming, so you can wire local models into scripts, web apps, bots and automation. Crucially it is OpenAI-compatible — and as of 2026 also speaks the Anthropic Messages API — so pointing existing SDK code at code>http://127.0.0.1:11434/v1/code> and dropping the key generally just works.
For Python, the official SDK (code>pip install ollama/code>) lets you send a chat message and read the reply in a few lines, while a plain HTTP request to code>/api/generate/code> works from any language and returns JSON. The code>/api/chat/code> endpoint keeps message history, and the embeddings endpoint produces vectors for search and retrieval-augmented generation — the same building blocks behind our look at the best LLM for data analysis. If inference feels slow, run code>ollama ps/code> to confirm the model is on your GPU rather than falling back to CPU.

Ollama in practice: a real-world use case
Consider Priya, a solo product analyst at a mid-size fintech who cannot send customer-support transcripts to a cloud API for compliance reasons. On her 16 GB MacBook Air, she installs Ollama, pulls code>qwen3:8b/code>, and writes a Modelfile with a system prompt that instructs the model to tag each transcript by theme and sentiment and return strict JSON. A 40-line Python script loops through the day’s exported tickets, calls code>/api/chat/code>, and appends the results to a spreadsheet.
Because everything runs locally, no customer data leaves her laptop, there is no per-token bill to justify, and she can iterate on the prompt freely. The illustrative outcome is qualitative but real: a task that used to be manual triage now runs while she gets coffee, and her weekly theme report is drafted before the first meeting. That is the pattern most beginners hit within a week — the terminal chat is the demo, the API is the product.
How does Ollama compare to the alternatives?
Ollama sits between raw code>llama.cpp/code> (maximum control, more setup) and polished desktop apps like LM Studio (friendly GUI, less scriptable). Ollama’s edge is that it is a single binary with a clean CLI and a real API, so a workflow you prototype in the terminal deploys to a server unchanged. According to public project data, its rapid growth and huge model library have made it the lowest-friction path from “I want to run a local LLM” to a working endpoint. For a GUI on top, third-party clients and the official desktop app both talk to the same port 11434, so you never lock yourself in.
Frequently Asked Questions
How do I install Ollama?
Installation takes under five minutes. On macOS run brew install ollama or use the installer; on Linux run curl -fsSL https://ollama.com/install.sh | sh; on Windows run the installer or winget. An official Docker image exists too. Verify with ollama –version, then pull your first model.
How do I run a model in Ollama?
Use ollama run followed by a model name, for example ollama run llama3.3:8b. The first run downloads the model, then opens an interactive chat where you type prompts. Type /bye to exit. Add a quoted prompt to run one-shot. An 8B model suits 8–16 GB of RAM.
What are the most important Ollama commands?
Eight verbs cover almost everything: pull downloads a model, run runs it interactively, list shows downloads, ps shows running models, stop frees memory, rm deletes a model, show prints details, and cp copies or renames. Learning these handles roughly 95% of real-world use and keeps you productive.
What is a Modelfile in Ollama?
A Modelfile is a short text file, similar to a Dockerfile, that defines a custom model. It sets a base with FROM, tunes PARAMETER lines like temperature and num_ctx, and adds a persistent SYSTEM prompt. Build it with ollama create name -f Modelfile to make reusable, purpose-built assistants.
Does Ollama have an API?
Yes. Ollama exposes a local REST API on port 11434 for generation, chat, embeddings and streaming. It is OpenAI-compatible, and in 2026 also speaks the Anthropic Messages API, so existing SDK code works by pointing at http://127.0.0.1:11434/v1 and dropping the key. An official Python SDK exists too.
Is Ollama free?
Yes, Ollama is completely free and open-source under the MIT license, with no subscription, no API charges and no usage limits — you only pay for hardware and electricity. The open models it runs are free to download. An optional Ollama Cloud offers hosted execution, but local use costs nothing.
Conclusion
Ollama turns running your own AI from an intimidating project into a five-minute exercise: install it, pull an 8B model matched to your RAM, and start chatting privately and for free. From there, learn the eight core commands, bake a Modelfile assistant, and unlock the OpenAI-compatible API to build real tools. Keep the runtime and models updated, check code>ollama ps/code> when performance dips, and grow from terminal chat to full application integration at your own pace.

