Ollama Setup

Ollama Setup

Run AI locally with Ollama for privacy and offline usage.

Install Ollama

macOS

brew install ollama

Linux

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

Windows

Download from ollama.com

Start Ollama

ollama serve

This starts the Ollama server on localhost:11434.

Pull a Model

# Recommended for SEO tasks ollama pull llama3.2 # Alternatives ollama pull mistral ollama pull gemma2

Usage

CLI

# Ollama auto-detected when running capyseo analyze ./dist --ai --ai-provider ollama # Specific model capyseo analyze ./dist --ai --ai-provider ollama --ai-model llama3.2

Config File

// capyseo.config.js export default { ai: { enabled: true, provider: 'ollama', model: 'llama3.2', }, };

Programmatic

import { SEOAnalyzer } from '@capyseo/core'; const analyzer = new SEOAnalyzer({ aiProvider: 'ollama', aiModel: 'llama3.2', });

Recommended Models

Model Size Quality Speed
llama3.2 3B Good Fast
llama3.2:7b 7B Better Medium
mistral 7B Good Medium
gemma2 9B Good Medium

Recommended: llama3.2 for balance of speed and quality.

Features

All AI features work with Ollama:

  • Meta description generation
  • Alt text generation (limited)
  • Title suggestions
  • Content analysis

Note: Image analysis (alt text) may be limited depending on model.

No API Key Needed

Ollama runs locally, no API key required:

# Just start ollama and run ollama serve & capyseo analyze ./dist --ai --ai-provider ollama

Advantages

  • Privacy - Data never leaves your machine
  • Offline - Works without internet
  • Free - No API costs
  • Control - Choose any model

Disadvantages

  • Quality - May be lower than cloud APIs
  • Resources - Requires local GPU/CPU
  • Setup - More complex than cloud
  • Speed - Depends on hardware

System Requirements

Model Size RAM GPU (Optional)
3B 4GB 4GB VRAM
7B 8GB 8GB VRAM
13B 16GB 16GB VRAM

Troubleshooting

"Connection refused"

Ollama server not running:

ollama serve

"Model not found"

Pull the model first:

ollama pull llama3.2

Slow responses

  • Use smaller model (llama3.2 vs llama3.2:7b)
  • Ensure GPU is being used:
    ollama run llama3.2 --verbose

Out of memory

  • Use smaller model
  • Close other applications
  • Increase swap space

Check Ollama Status

# List models ollama list # Check if running curl http://localhost:11434/api/tags

Comparison

Feature Ollama Cloud APIs
Cost Free Pay per use
Privacy Full Data sent to API
Offline Yes No
Quality Variable Consistent
Setup Complex Simple
Speed Hardware dependent Fast

Use Ollama when:

  • Privacy is critical
  • Offline access needed
  • Cost is a concern
  • You have capable hardware