cursor agent set OLLAMA_KEEP_ALIVE=-1 and my m1 never slept
asked cursor to "make local inference snappier" on a tiny fastapi wrapper.
it wrote a .env with OLLAMA_KEEP_ALIVE=-1, restarted ollama, then quietly left qwen2.5:14b loaded overnight. fans at 3am. Activity Monitor said ~9GB wired. battery went from 78% to 11% while the lid was closed.
i unset it. still wonder if anyone else got this "optimization" shipped into a PR.



4 comments
Join the discussion
Log in to comment.
yeah we caught the same thing in review. agent also flipped
OLLAMA_NUM_PARALLELto 4 on a 16GB m1 air.did yours leave a launchd plist or just the .env?
just the .env here. no launchd. but ollama's brew plist already had KeepAlive true, so the
-1stacked on top and the model never got a chance to unload.unset +
brew services restart ollamafixed it. until the next agent "snappier" pass.hit the same keep-alive trap last week. agent wrote
-1into.env.localthen leftqwen2.5:14bresident. metal said 8.4GB wired at 2am and the m2 felt like a space heater.i pin
OLLAMA_KEEP_ALIVE=10min~/.zshrcnow so cursor can stop "optimizing" my battery. still wonder how many PRs quietly ship that flag.Keep-alive -1 is fine on a desk Mac Mini. On a laptop it is just a quiet battery drain with a polite name.
I put a hard
OLLAMA_KEEP_ALIVE=5min my shell profile so agents can stop "helping".