← All articles

Tools3 min read

Ollama guide: download, install and run a local AI model

Install Ollama on macOS, Windows or Linux, pick a model, check memory use and make your first local API request.

Igor Karmazin · AI Technical Product Operations

Ollama: local models

Ollama runs models on your computer. Start with a small download and a short task you can check by hand. This guide uses Qwen3 to show the installation, terminal and API steps.

Download and install Ollama

  • macOS. Download Ollama, move it to Applications and open it. Install the command-line tool if prompted. The documentation lists macOS 14 or later. Apple Silicon supports GPU acceleration, while Intel uses the CPU. macOS instructions.
  • Windows. Run the official installer, open Ollama and start a fresh PowerShell window. Windows instructions.
  • Linux. Follow the official instructions for your system. If Ollama is not already running as a service, run ollama serve in another terminal. Linux instructions.

Download Ollama. Confirm that the CLI can talk to the service:

ollama --version
ollama list

An empty list is normal on a fresh installation. If the command cannot be found, reopen your terminal and check the CLI installation. If the CLI cannot connect, open Ollama or check its service.

Choose a model that fits

Tag Listed download size Try it for
qwen3:1.7b 1.4 GB A first run on a machine with limited memory
qwen3:4b 2.5 GB Short prompts, classification and simple extraction
qwen3:8b 5.2 GB Comparing quality and speed on the same task

Download size describes disk usage. Running the model takes additional memory for context and runtime overhead. Start with a short prompt and test before moving to a larger tag. Qwen3 library.

Run your first prompt

ollama run qwen3:4b

The first run downloads the model. Ask: “Extract the order number, quantity and day from ‘Ship two units for order 124 on Friday’. Return null for missing fields.” Run it again with Friday removed. Check that the known values stay the same and the missing day is reported as null.

Type /bye to leave the chat. Use ollama ps in another terminal to see loaded models and CPU/GPU allocation. Use ollama stop qwen3:4b to unload the model or ollama rm qwen3:4b to delete its downloaded files. CLI reference.

Try the local API

With the default local configuration, Ollama listens on port 11434. After downloading the model, run this in Bash or zsh:

curl --fail --silent --show-error http://127.0.0.1:11434/api/generate \
  -H 'Content-Type: application/json' \
  -d '{"model":"qwen3:4b","prompt":"Answer with one number: what is 2+2?","stream":false}'

The generated text is in the response field. Setting stream to false returns a single JSON response. An app running in Docker has its own localhost, so configure its route to the host separately and keep the model endpoint off the public internet. Generate API reference.

Check that inference is local

Download a local tag, disconnect the network and repeat the same prompt. Check ollama ps while it runs. Cloud models and external integrations follow the data handling rules of their respective services. Ollama quickstart.

FAQ

Can I run Ollama offline?

Yes, once a local model has been downloaded, provided the workflow does not call network-dependent tools.

Why is Ollama slow?

Try a smaller model, a shorter prompt and check CPU/GPU placement with ollama ps. Available memory also affects how comfortably a model runs.

Is Ollama itself a model?

Ollama runs models and exposes an interface to them. Qwen3 is the model used in this example.

How do I turn a local model into an agent?

Start by measuring how it performs on your task, then add only the tools and data needed to complete that task.

How to build an AI agent

Read on Telegram