New to Kestra?
Use blueprints to kickstart your first workflows.
Keep local Ollama models warm with Kestra. A scheduled flow pulls your model list into a persistent cache so no pipeline pays cold-start download latency.
The first request against an unpulled Ollama model does not run inference, it downloads gigabytes. On a shared inference node or inside ephemeral task containers, that cold start lands on whoever asks first, usually a production pipeline at the worst time. This blueprint makes warmup an operational routine: a scheduled flow iterates over the team's model list with io.kestra.plugin.core.flow.ForEach and runs ollama pull for each one through io.kestra.plugin.ollama.cli.OllamaCLI, with model caching persisting the results between runs.
models input holds the team's model list as a typed array, so adding a model to the warm set is a one-line change or an execution-time override.warm_models (io.kestra.plugin.core.flow.ForEach) fans out over the list; inside it, pull_model runs ollama pull {{ taskrun.value }} for the current model.enableModelCaching: true persists pulled models between runs, which is the property doing the real work: without it, each containerized execution starts from an empty model store and warmup would warm nothing.notify posts the completed round to Discord; the errors block alerts when any pull fails.Schedule trigger runs the warmup nightly at 05:00, before the workday.Warmup is classic day-2 work: it must run on schedule, cover a list that changes, fail loudly, and leave a record. Kestra gives each of those for free, the ForEach fans the list out into individual task runs, the schedule and history answer when the cache was last refreshed, and the same enableModelCaching mechanism is shared by every other Ollama blueprint, so warming here speeds up all of them.
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 warm the local model store directly.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.DISCORD_WEBHOOK_URL secret to your Kestra namespace.disabled: false on the nightly trigger.llama3.2:3b) so upstream releases never change behavior silently.ollama run smoke test to verify the model loads, not just downloads.