How to Keep Ollama Models Loaded in Memory Permanently on macOS

Short answer By default, Ollama unloads a model from memory after 5 minutes of inactivity. To keep a model loaded indefinitely on macOS, you need to set the OLLAMA_KEEP_ALIVE environment variable using launchctl — not a .zshrc export, which Ollama Desktop (a GUI app) never sees. Because launchctl setenv resets on every reboot, the reliable fix is a LaunchAgent that sets the variable and launches Ollama Desktop in a controlled sequence at every login. ...

September 10, 2026 · 4 min · Çetin Ardal