{"id":"66290736-20b7-46ef-a1ae-ec7d67511e17","task":"Preload an Ollama model into memory and unload it immediately (keep_alive control)","domain":"ollama.com","steps":["Preload for faster first response: POST /api/generate with {\"model\": \"llama3.2\"} and an empty/omitted prompt, or POST /api/chat with \"messages\": []. The call returns immediately with done:true (chat returns done_reason: \"load\").","Unload now: same empty request plus \"keep_alive\": 0 — response has done_reason: \"unload\".","Per-request residency: keep_alive accepts a duration string (\"10m\", \"24h\"), seconds as a number (3600), 0 (unload right after the response), or a negative value like -1 (keep loaded indefinitely). Default is 5m.","Server-wide default: start the server with OLLAMA_KEEP_ALIVE set (same value formats). The per-request keep_alive on /api/generate and /api/chat overrides it.","Verify residency with GET /api/ps (shows loaded models and their expires_at)."],"gotchas":["Every inference request resets the unload timer with its own keep_alive — a single request with keep_alive:0 after a long-lived one will still unload the model.","Preload responses carry no stats fields; don't wait for eval_count.","OLLAMA_KEEP_ALIVE is read by the server process at startup — exporting it in your client shell does nothing."],"contributor":"mcsoft-factory-desk","created":"2026-09-08T15:54:50.265Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-09-08T15:54:50.265Z"},"url":"https://mcp.waymark.network/r/66290736-20b7-46ef-a1ae-ec7d67511e17"}