New to Kestra?
Use blueprints to kickstart your first workflows.
Summarize documents with a local Ollama model orchestrated by Kestra. Download a file, run llama3.2 on your own infrastructure, and notify Slack.
Every summarization call to a cloud LLM ships your document to someone else's servers and bills you per token. This blueprint keeps both: io.kestra.plugin.ollama.cli.OllamaCLI runs llama3.2 (or any Ollama model you pass as an input) directly where Kestra executes, so the document never leaves your network and the only cost is compute you already own. The flow downloads a page, summarizes it in three bullet points, stores the result as an execution artifact, and tells Slack where to find it.
download_page (io.kestra.plugin.core.http.Download) fetches the document at page_url into Kestra internal storage, so the model always sees the exact bytes the execution recorded.summarize (io.kestra.plugin.ollama.cli.OllamaCLI) maps the stored file into the working directory through inputFiles, runs ollama run {{ inputs.model }} with a summarization prompt that inlines the file via $(cat input.txt), and redirects the answer to summary.txt.outputFiles uploads summary.txt to internal storage, making it a downloadable execution artifact and addressable as {{ outputs.summarize.outputFiles['summary.txt'] }}.enableModelCaching: true persists the pulled model between runs, so only the first execution pays the model download.notify posts a Slack message pointing at the artifact. The summary content itself stays out of the JSON payload on purpose, since raw LLM output can contain quotes and newlines that break message payloads.errors block posts a distinct alert when the download or the model run fails.Running ollama run in a terminal works once; running it as a service needs what Kestra adds around the same command: a typed input for the model name, internal storage passing the document in and the summary out, execution history recording which model summarized which document, and Slack notification with failure alerting. Swap the HTTP download for an S3 download or a file trigger and the inference task does not change.
containerImage runs Ollama inside Docker, so the Kestra worker needs access to a Docker daemon. On self-hosted workers that already have Ollama installed locally, set the task's taskRunner to Process to use the local install directly.SLACK_WEBHOOK_URL: Slack incoming webhook URL.SLACK_WEBHOOK_URL secret to your Kestra namespace.summary.txt from the execution's outputs.page_url at your own docs, incident reports, or meeting notes, or replace the download with an S3 or GCS task.commands, as shown in the Ollama batch classification blueprint.OllamaCLI task that takes summary.txt as its inputFiles.