Skip to product information

Ollama GPU Idle Cleanup n8n Workflow: HTTP Logs & Unload

Ollama GPU Idle Cleanup n8n Workflow: HTTP Logs & Unload

 (200+Reviews)
Regular price £41.99
Regular price £41.99 Sale price
SAVE Sold out
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
Ollama GPU Idle Cleanup n8n Workflow: HTTP Logs & Unload

Ollama GPU Idle Cleanup n8n Workflow: HTTP Logs & Unload

Regular price £41.99
Regular price £41.99 Sale price
SAVE Sold out

Keep your Ollama GPUs free: automatically log idle model states and unload when safe

This Ollama GPU Idle Cleanup n8n workflow checks which Ollama models are currently loaded, writes state changes to a log file, and can optionally unload models that have been idle too long—helping you free GPU memory without manual monitoring.

What this workflow does

  • Runs manually or on a 10-minute schedule to continuously monitor model activity.
  • Loads configuration such as your Ollama base URL, idleMinutes, assumedKeepAliveMinutes, dryRun, and logPath.
  • Calls Ollama’s /api/ps to list loaded models and read each model’s expires_at timestamp.
  • Determines model state (keep, pinned-skip, would-unload, or unload) based on idle thresholds and “pinned” logic using a far-future expires_at.
  • Appends a log line only when a model’s state changes since the last run, reducing noisy logs.
  • When dryRun is disabled, sends a POST to /api/generate with keep_alive: 0 for each model marked for unload.

Use cases

  • GPU cost control for SaaS environments running Ollama via HTTP, where idle models accumulate.
  • Hands-off model lifecycle management for n8n users who want automated cleanup every 10 minutes.
  • Safe rollout with dry-run: verify expected unload behavior by inspecting the log output before enabling live unloading.

Technical details (n8n + integrations)

  • Ollama integration over HTTP: GET /api/ps and POST /api/generate (with keep_alive: 0).
  • Nodes used: Manual Trigger, Schedule (10-minute), http request, code, if, set, sticky note.
  • Config checklist: ensure n8n can reach Ollama (e.g., http://host.docker.internal:11434 for Docker), create a writable logPath, and tune idleMinutes / assumedKeepAliveMinutes to match your Ollama behavior.
View full details