Skip to content

Guide · Open source

How to use Ollama: install, run models and call the API

Updated · written with AI from the project's own documentation and checked against our catalogue data

Ollama is an open-source tool for downloading and running open-weight AI language models on your own computer, with a simple command line and a REST API. This guide is for developers, students and anyone who wants to chat with open models without sending prompts to a hosted service. By the end you will know how to install Ollama, run a model, call it from code and connect a coding assistant.

Ollamaollama/ollama · ★ 186k · MIT

Quick start

  1. 1Install Ollama. Run the install script for macOS or Linux, or the PowerShell installer on Windows. You can also download the installer manually.
  2. 2Open a terminal. Run ollama to see the prompt that offers to run a model or connect an application.
  3. 3Run a model. Run ollama run gemma4 to download and chat with the Gemma 4 model.
  4. 4Test the REST API. Send a POST request to localhost port 11434 at /api/chat with a model name and messages.
  5. 5Install a client library. Install the Python package with pip install ollama or the JavaScript package with npm i ollama.
  6. 6Connect a tool. Run ollama launch followed by an integration name such as claude or openclaw.

Install Ollama on macOS, Linux or Windows

On macOS and Linux, install Ollama by running the install script from the README. On Windows, run the PowerShell installer instead.

You can also download the macOS app (Ollama.dmg) or the Windows installer (OllamaSetup.exe) manually from the Ollama download page. The official Docker image ollama/ollama is available on Docker Hub, and the README also includes manual install instructions for Linux.

  • macOS and Linux: use the install script
  • Windows: use the PowerShell installer
  • Manual downloads and Docker are also available
curl -fsSL https://ollama.com/install.sh | sh irm https://ollama.com/install.ps1 | iex

Start Ollama and run your first model

Running ollama with no arguments prompts you to run a model or connect Ollama to an existing agent or application. To chat directly, run a model by name. The example in the README is Gemma 4.

The full list of available models is on ollama.com/library. The README notes that Ollama can run models from cloud or local sources, so check the model page for details on each.

  • Run ollama to see the interactive prompt
  • Run ollama run gemma4 to chat with Gemma 4 in the terminal
  • Browse ollama.com/library for other models
ollama ollama run gemma4

Call the Ollama REST API from the command line

Ollama has a REST API for running and managing models. The example below sends a chat request to the local server at port 11434. Setting stream to false returns the full answer in one response.

The README links to the API documentation for all endpoints.

  • Endpoint used in the example: /api/chat on localhost port 11434
  • Set "stream": false to get one complete response
curl http://localhost:11434/api/chat -d '{ "model": "gemma4", "messages": [{ "role": "user", "content": "Why is the sky blue?" }], "stream": false }'

Use Ollama from Python or JavaScript

If you are building an app, the official Python and JavaScript libraries wrap the API. Install the Python client with pip and the JavaScript client with npm, then call the chat function with a model name and a list of messages.

Both libraries are listed under Libraries in the README: ollama-python and ollama-js.

  • Python: pip install ollama
  • JavaScript: npm i ollama
pip install ollama from ollama import chat response = chat(model='gemma4', messages=[{'role': 'user', 'content': 'Why is the sky blue?'}]) print(response.message.content)

Connect a coding assistant with ollama launch

Ollama can connect to coding tools and assistants. To launch a specific integration, pass its name to ollama launch. The README lists Claude Code, Codex, Copilot CLI, DeepSeek Harness, Droid and OpenCode as supported coding integrations.

The README also shows an AI assistant option, OpenClaw, which it describes as a way to turn Ollama into a personal assistant across chat apps such as WhatsApp, Telegram, Slack and Discord.

  • Coding integrations: Claude Code, Codex, Copilot CLI, DeepSeek Harness, Droid, OpenCode
  • Assistant integration: OpenClaw
ollama launch claude ollama launch openclaw

Choose a front end if you do not want the terminal

The README's Community Integrations section lists many third-party chat interfaces and desktop clients that work with Ollama, including Open WebUI, LibreChat, AnythingLLM and Msty. These are separate projects, so check each one's own documentation before installing.

The README mentions a download option for macOS and Windows, but it does not describe a full graphical app. Treat the terminal as the main path.

  • Open WebUI: self-hosted AI interface
  • AnythingLLM: all-in-one AI app for Mac, Windows and Linux
  • Msty: multi-model desktop client

What people use it for

  • Testing open models privately from a terminal
  • Building an app that calls a model through the local REST API
  • Connecting a coding assistant such as Claude Code or OpenCode to a model
  • Running a personal AI assistant through OpenClaw
  • Pairing Ollama with a self-hosted chat interface like Open WebUI

Frequently asked questions

Is Ollama free to use?

The Ollama repository is licensed under the MIT licence, which the listing shows. The README also mentions cloud access, and the source does not give pricing, so check the Ollama website for any paid cloud options.

What are the system requirements for Ollama?

The README does not list specific hardware requirements. Model files can be large and need capable memory and disk space, so check the model size before downloading.

How do I install Ollama on Windows?

Run the PowerShell command irm https://ollama.com/install.ps1 | iex in a PowerShell window. You can also download OllamaSetup.exe manually from the Ollama download page.

How do I use Ollama with Python?

Install the client with pip install ollama, then import chat from ollama and pass a model name such as gemma4 with a list of messages. The response text is in response.message.content.

Is Ollama the same as llama.cpp?

No. The README names llama.cpp as a supported backend, built by Georgi Gerganov. Comparable projects in this directory include LM Studio, Open WebUI and vLLM, which serve different needs.

Can Ollama run the most powerful closed models?

Ollama focuses on open-weight models. If you need the most capable closed frontier models, it is not the right tool for that job.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Ollama suits developers who want a local model API, people who want to chat with open models privately, and students testing models from a terminal. If you need the strongest closed hosted models, or a polished desktop app with no terminal use, consider a tool like LM Studio or one of the desktop clients listed in the README.

Install options & downloads