Ollama CLI

Ollama CLI

Certified

Tasks that execute Ollama CLI commands for model management and generation.

Define the shell commands to run (pull, list, run), optionally set a remote host, container image, and model caching path, and capture output files so model runs and assets integrate cleanly with workflows.

How to use the Ollama plugin

Run Ollama models from Kestra flows against a local or remote Ollama server.

Authentication

No API key is needed for a local Ollama server. To use Ollama Cloud models, set auth.apiKey to your Ollama Cloud API key and store it in a secret.

Tasks

cli.OllamaCLI runs any Ollama CLI command inside a container. Set commands to a list of Ollama commands (e.g., ["ollama pull llama3.2", "ollama run llama3.2 'Summarize this text'"]). The task starts a transient ollama serve automatically when no host is set — set host to skip this and connect to an existing Ollama server instead.

Model caching is enabled by default (enableModelCaching: true): pulled models are stored in a Docker volume named kestra-ollama-cache and reused across executions, so you only pay the pull cost once. Set modelCachePath to use a specific host directory instead of the named volume.