Skip to content

Guides > External tools & integrations

Set up Ollama

Open in ChatGPT ↗
Ask ChatGPT about this page
Open in Claude ↗
Ask Claude about this page
Copied!

Install Ollama, run LLMs locally, compare model performance, and integrate local models into your apps using Warp.

Run AI models locally — with no API costs, no data leaving your machine, and your choice of model. This guide walks through installing Ollama, running your first model, integrating it into an existing app, and customizing model behavior using Warp.

Hardware requirements

You'll need enough memory to load the model weights. The rule of thumb: roughly 1GB of memory per billion parameters.

Model sizeExample modelsMinimum RAM/VRAM
3BLlama 3.2 3B, Phi-3 Mini4GB
7–8BMistral 7B, Llama 3.1 8B8GB
13BLlama 2 13B16GB
30–34BMixtral, Codestral24GB
70BLlama 3.1 70B48GB

On Apple Silicon Macs, unified memory is shared between CPU and GPU. An M2 Mac with 16GB unified memory can run 7–8B models comfortably.

Software requirements

  • macOS 14 Sonoma+, Windows 10+, or Ubuntu 20.04+
  • No account required — Ollama is free and open source

macOS

Run the install script in your terminal:

Terminal window
curl -fsSL https://ollama.com/install.sh | sh

Or download the macOS app manually from ollama.com/download. The app runs as a background service and appears in your menu bar.

Linux

Terminal window
curl -fsSL https://ollama.com/install.sh | sh

The installer sets up Ollama as a systemd service that starts automatically on boot.

Windows

Run this in PowerShell:

Terminal window
irm https://ollama.com/install.ps1 | iex

Or download the installer manually from ollama.com/download. Ollama runs as a background service after installation.

Pull a model to download it locally. This example uses Llama 3.2 (3B), a lightweight model that runs on most hardware:

Terminal window
ollama pull llama3.2

Then start an interactive chat session:

Terminal window
ollama run llama3.2

Type your prompt and press Enter. Type /bye to exit the session.

To try a larger model with stronger reasoning:

Terminal window
ollama run llama3.1:8b

Use ollama ls to see all models you've downloaded, and ollama ps to see which models are currently loaded in memory.

When browsing ollama.com/library, you'll see labels on models that indicate their capabilities:

TermMeaning
ThinkingThe model "thinks" before answering; better for complex reasoning.
ToolsModels can call external functions or utilities (e.g., web search).
VisionCan process and respond to images.
EmbeddingConverts text to numeric vectors for search or RAG pipelines.
QuantizationReduces memory use by lowering weight precision (e.g., 4-bit, 8-bit).

Quantized models (e.g., q4_0, q8_0 variants) use significantly less memory than full-precision originals. Start with a quantized version if you're memory-constrained.

To benchmark models side by side, Warp makes it easy to run prompts in parallel tabs and compare results. Pass a prompt directly to ollama run for a quick, non-interactive response:

Terminal window
ollama run llama3.2 --verbose "Summarize the Rust ownership model in one paragraph"

Run the same prompt on two different models to compare output quality before committing to one. For detailed timing stats (tokens generated, throughput), add the --verbose flag:

Terminal window
ollama run --verbose llama3.2 "Summarize the Rust ownership model in one paragraph"

To see which models are currently loaded and their memory usage:

Terminal window
ollama ps

Ollama exposes an OpenAI-compatible REST API at http://localhost:11434/v1/. You can drop it in wherever you're currently using the OpenAI API — just update three values:

  1. Base URLhttp://localhost:11434/v1/
  2. API key → any non-empty string (e.g., "ollama" — required by the SDK but ignored by Ollama)
  3. Model name → the name of your local model (e.g., "llama3.2")

Python (OpenAI SDK)

from openai import OpenAI
client = OpenAI(
base_url="http://localhost:11434/v1/",
api_key="ollama", # required by the SDK but ignored by Ollama
)
response = client.chat.completions.create(
model="llama3.2",
messages=[
{"role": "user", "content": "Explain async/await in Python"}
]
)
print(response.choices[0].message.content)

Node.js (OpenAI SDK)

import OpenAI from "openai";
const client = new OpenAI({
baseURL: "http://localhost:11434/v1/",
apiKey: "ollama", // required by the SDK but ignored by Ollama
});
const response = await client.chat.completions.create({
model: "llama3.2",
messages: [{ role: "user", content: "Explain async/await in Python" }],
});
console.log(response.choices[0].message.content);

Ollama also provides native Python and JavaScript libraries (ollama-python, ollama-js) if you prefer an SDK built specifically for Ollama rather than the OpenAI compatibility layer. See the Ollama README for details.

Open your app's code in Warp and use the agent to locate the OpenAI client initialization, swap in the new values, and test the connection — all from the same terminal session.

You can create a custom model variant by writing a Modelfile — a configuration file that sets a system prompt, adjusts generation parameters, or builds on any existing Ollama model.

Create a file called Modelfile:

FROM llama3.2
SYSTEM """
You are a focused code review assistant.
Always identify security issues first, then logic errors, then style.
Keep feedback concise and actionable.
"""
PARAMETER temperature 0.3
PARAMETER num_ctx 8192

Then build and run your custom model:

Terminal window
ollama create code-reviewer -f ./Modelfile
ollama run code-reviewer

Your custom model is saved locally and available any time you run ollama run code-reviewer. Ask Warp's agent to generate a Modelfile for a specific use case — describe what you want the model to do, and let the agent write the configuration.

  • Unload to free memory — Use ollama stop <model> to unload a model from memory before loading a larger one.
  • Script with the REST API — For quick testing without the SDK: curl http://localhost:11434/api/chat -d '{"model": "llama3.2", "messages": [{"role": "user", "content": "Hello"}], "stream": false}'
  • Keep a model inventoryollama ls shows all locally cached models with their sizes and last-used dates. Use ollama rm <model> to delete models you no longer need.
  • Compare models in parallel — Open side-by-side Warp tabs and run the same prompt against two different models to compare quality and speed before deciding which to use in your app.

You have Ollama installed, a model running locally, and a path to integrate it into any app using the OpenAI-compatible API.

Explore related guides and features: