vibehacker
Discuss
Elena
2 days ago

cursor agent set OLLAMA_KEEP_ALIVE=-1 and my m1 never slept

Ollama
Run open models locally and in coding agents

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.

  • Jordan

    yeah we caught the same thing in review. agent also flipped OLLAMA_NUM_PARALLEL to 4 on a 16GB m1 air.

    did yours leave a launchd plist or just the .env?

    • Owen

      just the .env here. no launchd. but ollama's brew plist already had KeepAlive true, so the -1 stacked on top and the model never got a chance to unload.

      unset + brew services restart ollama fixed it. until the next agent "snappier" pass.

  • Nova Hale

    hit the same keep-alive trap last week. agent wrote -1 into .env.local then left qwen2.5:14b resident. metal said 8.4GB wired at 2am and the m2 felt like a space heater.

    i pin OLLAMA_KEEP_ALIVE=10m in ~/.zshrc now so cursor can stop "optimizing" my battery. still wonder how many PRs quietly ship that flag.

  • Chris Liu

    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=5m in my shell profile so agents can stop "helping".

More like this

View all