AUDIO

Listen to this page

0:00
Chapters

    ollama — the assistant's internal local LLM

    A pre-built plugin that closes the biggest gap of the keyword-matcher era: ANY request none of the tools can serve ("what is the weather?", small talk, "tell me about X") is answered by a LOCAL model instead of the "sorry, no tool" phrase.

    How it runs

    • The plugin server/plugins/ollama/ ships its own docker-compose.yml (service ollama-local, image ollama/ollama, named volume ollama-local-data) + a sibling docker-compose.gpu.yml (GPU reservation). The installer merges them into the stack (deployment) — no docker socket, no host SDKs, nothing extra to configure.
    • A bare-metal core starts the same file itself (docker compose -f plugins/ollama/docker-compose.yml up -d through the docker CLI; the containerized core never spawns docker).
    • Models download through the Ollama API (pull with progress) and STAY in the volume — restart/update/reinstall of the plugin never re-downloads (the state lives in the central db via ctx.sqlStore, models in the docker volume).
    • URL discovery order (first answering wins, persisted): persisted URL → OLLAMA_URL (env store / process env) → http://ollama-local:11434 → http://host.docker.internal:11434 → http://localhost:11434. No server → degrades with an exact start hint (status endpoint + tool message); the other tools keep working.

    Setup

    1. Install the plugin (the installer lists it; or enable it in the Plugins screen).
    2. Start the model container: the plugin's dashboard page offers download progress; on the compose deployment run docker compose -f server/plugins/ollama/docker-compose.yml up -d once.
    3. The default model qwen3:1.7b auto-installs on the first ask.
    4. Optional: switch the AI provider to Ollama in the AI provider screen, or keep the provider and let the tool be only a commandable LLM.

    Admin page (#/pui/ollama)

    Status (URL in use, default model, readiness), the model menu (installed models + suggestions + default), async model downloads with progress (ollama.pull events; the UI polls).

    Tool + fallback

    POST /api/v1/tools/ollama:

    action args what
    ask prompt send the prompt, return the model answer (first ask auto-installs the default model)
    models — installed models + suggestions + default
    install model start a download (async; progress events)
    set model make the model the default (auto-installs if missing)

    Model choices (ALL installable; menu on setup + admin page): qwen3:1.7b (default), gemma3:1b, llama3.2:1b, llama3.2:3b, qwen3:0.6b, tinyllama, or ANY other ollama.com tag. A language prompt is sent with every request ("answer in the language the user wrote in") — the model chooses; TTS follows the question language (see ../agent-and-language).

    As the conversational fallback

    The plugin exports chat(text, ctx) and registers itself as a FALLBACK: the agent's decide calls it exactly when (a) the mock matcher found no tool, or (b) the configured LLM provider threw. A REAL provider's own successful replies are never replaced. If the fallback model is also down, the localized "no matching tool" phrase stays as the last line of defense.

    When the orbit plugin is installed, the fallback ALSO receives a compact grounding line (home place, local time, current weather, the next public holidays, upcoming birthdays, set alarms) at every turn — cached inside orbit for 10 minutes — so weather/time/holiday questions are answered with real data without a tool hop.

    Testing

    server/tests/ollama.js (fake ollama server; install→ask→set + agent decides). The GPU/docker-compose integration is validated by the doctor (../getting-started) rather than unit tests.

    Last updated: October 2026