Ollama Add-on

Run Large Language Models (LLMs) locally on your Home Assistant hardware with complete privacy and no cloud dependency.

Features

Installation

  1. Add the J0rsa repository to your Home Assistant
  2. Search for “Ollama” in the Add-on Store
  3. Click Install and wait for the download to complete
  4. Configure the add-on (see Configuration below)
  5. Start the add-on

Configuration

# Example configuration
gpu_support: false  # Enable if you have compatible GPU
models_path: /data/models  # Where to store models
api_host: 0.0.0.0  # API listening address
api_port: 11434  # API port

Configuration Options

Option Description Default
gpu_support Enable GPU acceleration if available false
models_path Directory to store downloaded models /data/models
api_host API listening address 0.0.0.0
api_port API listening port 11434

Usage

Downloading Models

After starting the add-on, you can download models using the API:

curl http://homeassistant.local:11434/api/pull -d '{
  "name": "llama2"
}'

Running Inference

Send a prompt to the model:

curl http://homeassistant.local:11434/api/generate -d '{
  "model": "llama2",
  "prompt": "Why is the sky blue?"
}'

Integration with Home Assistant

You can integrate Ollama with Home Assistant using REST commands:

rest_command:
  ask_ollama:
    url: "http://localhost:11434/api/generate"
    method: POST
    headers:
      Content-Type: "application/json"
    payload: '{"model": "llama2", "prompt": ""}'

Hardware Requirements

Minimum Requirements

Model Size Guidelines

API Documentation

Endpoints

Endpoint Method Description
/api/generate POST Generate text from a prompt
/api/pull POST Download a model
/api/tags GET List available models
/api/delete DELETE Remove a model

Example: List Models

curl http://homeassistant.local:11434/api/tags

Tips and Tricks

  1. Model Selection: Start with smaller models (7B) and upgrade if needed
  2. Performance: Enable GPU support if you have compatible hardware
  3. Storage: Models are stored persistently in /data/models
  4. Memory: Monitor RAM usage, especially with larger models
  5. API Key: Consider adding authentication for external access

Troubleshooting

Add-on Won’t Start

Model Download Fails

Slow Performance

Support


← Back to Add-ons View on GitHub