Skip to content

AI setup

Optional AI powers embeddings (hybrid search, related videos, category shelves), tags, summaries, chapters and chat. Horde talks to any OpenAI-compatible provider: you give it a base URL, an API key if the provider needs one, a chat model and an embedding model.

UI controls

Everything here is set in the setup wizard or Settings → AI → Providers. This page explains which URL to use, the optional bundled Ollama, GPU sizing, and budgets.

Pick a provider

You want Use Needs
No GPU, little setup A cloud provider: OpenRouter (one key for most models, reports cost per call), OpenAI, Google Gemini, Mistral, Groq, DeepSeek, Together An API key
Models on your own hardware, server already running Ollama, LM Studio, llama.cpp llama-server, vLLM, LocalAI, … The server's address
Models on this machine, no server yet The bundled Ollama container (below) A GPU passed through (CPU works, slowly)

In Settings → AI (and the setup wizard) there is one field: paste an API key or a server URL. A key from OpenRouter (sk-or-…), OpenAI (sk-proj-…, sk-svcacct-…), Google Gemini (AIza…) or Groq (gsk_…) is recognised on its own; for any other provider (DeepSeek and Anthropic keys also start with sk-) paste its API URL, then the key. A key is only ever sent to the provider that issued it. Connecting tests the server and shows which provider it found. Titles, descriptions, captions, notes and chat messages are sent to the provider, so a server you run keeps them on your network.

Providers without embeddings

Groq, DeepSeek and Anthropic's OpenAI endpoint have no /v1/embeddings. Leave the embedding model empty (embeddings stay off), or turn on Use a different server for embeddings and point that at one that has them, for example OpenRouter or a local Ollama with nomic-embed-text.

Which URL do I type? (Docker networking)

Horde runs in a container. Inside it, localhost / 127.0.0.1 is the Horde container itself, not your server, so a URL that works in your browser may not work from Horde.

Where the AI server runs URL to use in Horde
The bundled ollama service in Horde's compose file http://ollama:11434/v1
Another container in the same compose project http://<service-name>:<port>/v1
On the Docker host itself (Ollama app, LM Studio, …) http://host.docker.internal:<port>/v1
Another PC on your network http://<that PC's LAN IP>:<port>/v1, e.g. http://192.168.1.50:11434/v1
A cloud provider Just its API key (OpenRouter, OpenAI, Gemini, Groq), or its API URL, e.g. https://api.mistral.ai/v1
Horde run without Docker (local development) http://127.0.0.1:<port>/v1

Default ports: Ollama 11434, LM Studio 1234, llama.cpp 8080, vLLM 8000. A bare host:port gets http:// and /v1 added for you, and an address without a port gets Ollama's 11434. Find a server on this machine under the URL box tries the bundled Ollama and those ports on host.docker.internal.

Things that commonly get in the way:

  • host.docker.internal needs extra_hosts: ["host.docker.internal:host-gateway"] on the horde service. Horde's docker-compose.yml has it; add it if you wrote your own compose file.
  • The server only listens on localhost. Ollama does by default: set OLLAMA_HOST=0.0.0.0 (systemd: systemctl edit ollama, then restart). LM Studio: enable Serve on local network. llama.cpp: start with --host 0.0.0.0.
  • A firewall on the AI machine blocks the port from the Docker network or the LAN. Allow the port.
  • A different compose project or network. Containers only reach each other by service name on a shared network; otherwise use the host's address and published port.

Use Test in Settings: it lists the models the server offers, or says why it failed (unreachable, rejected credentials, no API at that path).

Bundled Ollama ("Run Ollama for me")

docker compose --profile ai up -d

That starts the optional ollama service with its models under OLLAMA_DATA_PATH (default ./ollama). Then choose Run Ollama for me in the setup wizard, or set the URL to http://ollama:11434/v1 in Settings. Horde picks models that fit the GPU (below) and asks Ollama to download them; AI jobs wait until they arrive.

update.sh keeps the profile on while the horde-ollama container exists and carries OLLAMA_DATA_PATH over.

GPU templates

Without a GPU, Ollama runs on the CPU, which works but is slow. Give the ollama service a GPU in docker-compose.override.yml (next to docker-compose.yml; Compose reads it automatically and updates leave it alone), then run docker compose --profile ai up -d. For NVIDIA (needs the NVIDIA Container Toolkit on the host):

services:
  ollama:
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

For AMD (ROCm), use Ollama's ROCm image and pass both devices. Use the same version as the image: line in docker-compose.yml, and the host's group numbers from getent group video render:

services:
  ollama:
    image: ollama/ollama:0.40.17-rocm
    devices:
      - /dev/kfd:/dev/kfd
      - /dev/dri:/dev/dri
    group_add:
      - "44"    # video, from getent
      - "105"   # render, from getent

Keep these in the override file rather than uncommenting the examples in docker-compose.yml, because update.sh stops when that file has local edits.

Horde's H.264 encode GPU (for playback compatibility copies) is a separate pass-through on the horde service. Settings → System → GPU / None detected is that container, not Ollama. See GPU.

Ollama extras

When the provider URL points at an Ollama server (Horde checks for Ollama's /api/version beside /v1), Settings → AI shows an Ollama section:

  • Download recommended models: picks chat and embedding models for the GPU and downloads them.
  • Download missing models: when on, a configured model that is not installed is downloaded automatically.
  • Ollama VRAM (GB): tells Horde the GPU size when it cannot read it (Ollama on another PC).

Other servers load whatever model you name; Horde does not manage their models.

VRAM tiers

Horde sizes Ollama models against the Ollama machine's GPU (override → Ollama /api/info → same-host probe), not necessarily the Horde host.

Tier VRAM Default embed Default chat
critical < 3 GB all-minilm llama3.2:1b
small 3–8 GB nomic-embed-text qwen2.5:3b
medium 8–16 GB mxbai-embed-large qwen2.5:7b
large ≥ 16 GB mxbai-embed-large qwen2.5:14b
unknown undetected nomic-embed-text qwen2.5:3b

Workload profiles

Profile scales invent/sample intensity and enqueue batch limits for any provider; on Ollama, applying one also picks the tier's models:

Profile Intensity multiplier Notes
Light 0.4× Smaller samples, higher category match threshold
Normal 1.0× Default for small/medium
Heavy 1.75× Larger samples; enqueue limits ×2

Critical VRAM locks the profile to Light so models fit. Recommended defaults: critical→light, large→heavy, medium/small→normal.

Re-embed after an embedding model change

Vectors are model-specific. Changing the embedding model (or the server that runs it, when the model differs) requires re-embedding the library; Settings offers to. Stale vectors break hybrid search and recommendations.

Costs and the weekly budget

Only providers that report a cost per call (OpenRouter's usage.cost) have costs: Settings → AI → Costs then shows the totals, kept locally in openrouter_usage (rolling windows). Other providers show no costs, and the budget never blocks them.

  • Set a weekly budget (USD).
  • Enable Stop AI calls when exceeded to block further calls and pause the AI queue when spend ≥ budget.

A budget alone warns in the UI without stopping the queue.

Environment variables

Variable Behavior
OPENROUTER_API_KEY Overrides the saved key while the provider URL is OpenRouter; never sent elsewhere
OLLAMA_BASE_URL Legacy: used when Settings has no provider URL, and when upgrading
OLLAMA_DATA_PATH Where the bundled Ollama keeps its models

Upgrading from the Ollama / OpenRouter split

Before this change Settings had separate Ollama and OpenRouter panes. On the first start after the upgrade Horde converts them once, keeping model names so nothing is re-embedded:

Before After
OpenRouter on, Tasks Specialized, Ollama on Chat: OpenRouter. Embeddings: the Ollama URL (second server; found as above if it was left empty)
OpenRouter on, Tasks All Chat and embeddings: OpenRouter
Ollama only Chat and embeddings: the Ollama URL with /v1
Ollama only, URL left empty (auto-discover) Horde looks for Ollama (compose service, then the Docker host) at start and then every minute, and saves the first one that answers. Until then those jobs wait; setting a provider in Settings ends the search

Queue visibility & recovery

Settings → AI → Jobs shows runnable / deferred / waiting / failed counts plus a blocked reason when the provider is down. Terminal failures list under Failed jobs with Retry / Retry all / Clear failed.

If the provider was offline, waiting jobs resume automatically once it is reachable again (no Horde restart required). See Troubleshooting — AI provider offline.