Repo Models & Inference

ollama/ollama

Ollama lets you run open models locally via CLI, REST API, and Python/JS libraries, and connect them to coding agents and apps through launch integrations.

  • 188k GitHub stars
  • Go
  • ⚖️ MIT
  • 🎯 Beginner

Last verified: repo last pushed

curl -fsSL https://ollama.com/install.sh | sh
ollama/ollama preview image

What it is

Ollama is a tool for building with open models. It provides a CLI (ollama, ollama run, ollama launch), a REST API on localhost:11434, and official Python and JavaScript libraries. It can run chat models such as Gemma 4 and connect to agents and applications such as Claude Code, Codex, and OpenClaw. It lists llama.cpp as a supported backend.

Who it's for

  • Developers who want to run and chat with open models from the command line
  • Developers building apps against a local REST API or the Python/JavaScript libraries
  • Users who want to connect open models to coding agents or assistants such as Claude Code, Codex, OpenCode, or OpenClaw
  • Teams looking for existing community integrations (chat UIs, editors, RAG tools, SDKs, observability)

Requirements

Requirements

  • macOS, Windows, or Linux (install scripts and manual downloads provided), or the ollama/ollama Docker image
  • Python with pip for the ollama Python library
  • Node.js with npm for the ollama JavaScript library

Setup

  1. Install on macOS or Linux

    Run the install script (a manual macOS download is also offered).

    bash
    curl -fsSL https://ollama.com/install.sh | sh
  2. Install on Windows

    Run the PowerShell install script (a manual download is also offered).

    powershell
    irm https://ollama.com/install.ps1 | iex
  3. Get started

    Run ollama and you'll be prompted to run a model or connect Ollama to existing agents or applications.

    bash
    ollama
  4. Install the Python library

    Install the official Python client.

    bash
    pip install ollama
  5. Install the JavaScript library

    Install the official JavaScript client.

    bash
    npm i ollama

Examples

Chat with a model

bash
bash
ollama run gemma4

What it does: Runs and chats with Gemma 4. The full model list is at ollama.com/library.

Launch a coding integration

bash
bash
ollama launch claude

What it does: Launches a specific integration, here Claude Code.

REST API chat request

bash
bash
curl http://localhost:11434/api/chat -d '{
  "model": "gemma4",
  "messages": [{
    "role": "user",
    "content": "Why is the sky blue?"
  }],
  "stream": false
}'

What it does: Sends a chat message to the local REST API with streaming disabled.

Python chat

python
python
from ollama import chat

response = chat(model='gemma4', messages=[
  {
    'role': 'user',
    'content': 'Why is the sky blue?',
  },
])
print(response.message.content)

What it does: Uses the ollama Python library to send a chat message and print the reply.

Launch OpenClaw assistant

bash
bash
ollama launch openclaw

What it does: Uses OpenClaw to turn Ollama into a personal AI assistant across WhatsApp, Telegram, Slack, Discord, and more.

Pros & cons

Pros

  • Pro:Multiple access paths: CLI, REST API, and official Python and JavaScript libraries
  • Pro:ollama launch connects to coding tools such as Claude Code, Codex, Copilot CLI, Droid, and OpenCode
  • Pro:Large catalog of community integrations (chat UIs, editors, RAG, SDKs, observability)
  • Pro:Install options include scripts, manual downloads, a Docker image, and several package managers

Cons

  • Con:The README doesn't state hardware requirements, so model sizing and GPU needs must be checked elsewhere
  • Con:Community integrations are third-party projects listed in the README, not necessarily maintained by Ollama

Images