toolcall() ← all concepts

// concept · workflows

Ollama unloads your model after 5 idle minutes

Walk away from a local model for five minutes and Ollama takes it out of memory. The download stays on disk, but the next question has to load the weights back into memory before it can answer, which is the slow first reply you notice after a break. One setting moves the timer, in either direction.

// the default

Ollama's FAQ, under How do I keep a model loaded in memory or make it unload immediately?:

By default models are kept in memory for 5 minutes before being unloaded. This allows for quicker response times if you're making numerous requests to the LLM.

"In memory" means the weights are loaded where the model runs: video memory on a graphics card, or system memory on a CPU-only or unified-memory machine. Unloading frees that memory. It does not delete the model: the pulled files stay on disk.

To see what is loaded and for how long, run ollama ps. The FAQ's own example:

NAME ID SIZE PROCESSOR UNTIL llama3:70b bcfb190ca3a7 42 GB 100% GPU 4 minutes from now

The dial: keep_alive

Send keep_alive with a request to /api/generate or /api/chat. It takes:

# keep it loaded (an agent that runs all day) curl http://localhost:11434/api/generate -d '{"model": "llama3.2", "keep_alive": -1}' # free the memory right after the reply curl http://localhost:11434/api/generate -d '{"model": "llama3.2", "keep_alive": 0}'

To change it for every model, set OLLAMA_KEEP_ALIVE (same value types) when you start the Ollama server. A keep_alive sent with a request overrides it. To unload a model by hand, run ollama stop with its name.

Which way to turn it

How long the reload takes depends on the model's size and where it is loaded from, so time your own: ask a question, wait past the timer, and ask again.

Related: why Ollama sizes your context window from your card and where the rest of your video memory goes.

Source: Ollama docs, FAQ (keep-alive, GPU and concurrency sections). Verified 2026-10-22.

One concept a week. Free.

The deeper, copy-paste version of each ToolCall short — in your inbox.

// total: 0.00 · spam: void · unsubscribe: one click