// the default
Ollama's FAQ, under How do I keep a model loaded in memory or make it unload immediately?:
"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:
The dial: keep_alive
Send keep_alive with a request to /api/generate or /api/chat. It takes:
- a duration string, such as
"10m"or"24h"; - a number of seconds, such as
3600; - any negative number (
-1or"-1m"): keep the model loaded; 0: unload it immediately after the response.
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
- A coding agent or app you use all day: a negative value or a long duration, so the first reply after a meeting doesn't wait for a reload.
- A shared or small graphics card:
0or a short duration, so the memory is free for a game, a render or another model. - Several models: loading a new model can also push an idle one out. Ollama's FAQ: "As prior models become idle, one or more will be unloaded to make room for the new model."
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
