Skip to main content

Overview

Ollama enables you to run large language models locally on your own hardware. Perfect for development, testing, privacy-sensitive applications, and offline use. Access Llama, Mistral, Gemma, and many more models without any API costs. Base URL: Your local Ollama server (default: http://localhost:11434)

Supported Features

  • ✅ Chat Completions
  • ✅ Streaming
  • ✅ Embeddings
  • ✅ Vision (multimodal models)
  • ✅ Custom Models
  • ✅ Model Library (100+ models)
  • ❌ Function Calling (limited support)
  • ❌ Image Generation

Prerequisites

Install Ollama

Pull a Model

Quick Start

Chat Completions

Streaming

Meta Llama

Mistral & Mixtral

Google Gemma

Vision Models

Specialized Models

Ollama excels at:
  • Privacy - Data never leaves your machine
  • Zero cost - No API fees
  • Offline use - Works without internet
  • Fast iteration - No network latency
  • Customization - Create and modify models

Configuration Options

Remote Ollama Server

Docker Container

Advanced Features

System Messages

Vision (Multimodal)

Local image:

Embeddings

Temperature Control

Model Management

List Models

Pull Models

Remove Models

Run Interactive

Custom Models

Create a Custom Model

  1. Create a Modelfile:
  1. Create the model:
  1. Use your custom model:

Fallback Configuration

Use local Ollama first, fallback to cloud:

Best Practices

  1. Choose appropriate model size - Match to your hardware
  2. Use quantized models - Smaller, faster (q4_0, q5_1)
  3. Monitor memory usage - Leave headroom for system
  4. Keep models updated - ollama pull to update
  5. Use GPU if available - Much faster inference
  6. Warm up models - First request may be slow
  7. Batch similar requests - Amortize startup cost
  8. Create custom models - Optimize for your use case

Hardware Requirements

Minimum Specs

  • CPU: Modern quad-core
  • RAM: 8GB (for 7B models)
  • Disk: 10GB free space
  • CPU: 8+ cores
  • RAM: 16GB+ (for 13B models)
  • GPU: NVIDIA with 8GB+ VRAM (optional but recommended)
  • Disk: 50GB+ SSD

For Larger Models

  • 70B models: 48GB+ RAM
  • 405B models: 256GB+ RAM or multi-GPU setup

Performance Tips

Use GPU

Ollama automatically uses GPU if available (NVIDIA, Apple Silicon).

Quantization Levels

Example:

Use Cases

Development & Testing

Privacy-Sensitive Applications

Offline Applications

Cost Optimization

Pricing

Ollama is completely free!
  • No API costs
  • No rate limits
  • No usage tracking
  • Run unlimited requests
Only costs: Your hardware and electricity

Troubleshooting

Model Not Found

Out of Memory

Slow Performance

Model Library

Browse 100+ available models

Fallback Routing

Fallback to cloud when needed

Cost Optimization

Optimize AI costs

Privacy

Private AI deployments