Skip to main content
Ollama enables running large language models locally on your machine.

Overview

Ollama provides:
  • Local model execution (no API costs)
  • Privacy (data stays on your machine)
  • Offline operation
  • Fast inference on local hardware
Supported models:
  • Llama 2/3
  • Mistral
  • Mixtral
  • Phi
  • Gemma
  • And more

Prerequisites

Install Ollama

Start Ollama Server

Default endpoint: http://localhost:11434

Pull a Model

List installed models:

Configuration

Config File

CLI Usage

Features

Tool Calling

Ollama supports tool calling for compatible models:
Models with tool support:
  • llama3:70b
  • mixtral:8x7b
  • mistral
Smaller models may have limited tool calling capabilities.

Streaming

Real-time response streaming:

Custom Parameters

Model Selection Guide

For General Use

For Coding

For Maximum Quality

Performance Tuning

GPU Acceleration

Ollama automatically uses GPU if available (CUDA, Metal, ROCm). Check GPU usage:

Context Window

Adjust context size:
Larger contexts use more memory but allow longer conversations.

Batch Size

Request Format

Ollama uses a simple JSON format:

Troubleshooting

Solution:Start Ollama server:
Verify it’s running:
Solution:Pull the model first:
Solutions:
  1. Use smaller model:
  1. Reduce context window:
  1. Enable GPU acceleration (requires compatible hardware)
Solutions:
  1. Use smaller model
  2. Reduce context window
  3. Close other applications
  4. Reduce num_batch

Example: Complete Setup

Remote Ollama

Connect to Ollama running on another machine:

Docker Deployment

Run Ollama in Docker: