ShareYourGroupShareYourGroupLocal AI Guide

Ollama settings from its documentation

The settings that decide how much memory Ollama uses and for how long.

Read on 14 November 2026. This field changes fast: check the sources.

Context length

Set it in the Ollama app's settings slider, or when starting the server: OLLAMA_CONTEXT_LENGTH=64000 ollama serve. The documentation recommends the maximum context length that you need for best performance and says to avoid offloading the model to the CPU. To see what you got, run ollama ps: it lists the model, its size, the PROCESSOR column (for example "100% GPU") and the context.

Keeping a model loaded

By default a model stays loaded for a while after its last use. The documentation says that the keep_alive parameter of the API controls this, and that setting keep_alive to 0 in a request unloads the model, for example with a generate request. You can change the time for all models with the OLLAMA_KEEP_ALIVE environment variable, which takes the same kinds of values. The API parameter overrides the variable.

Several requests and models

The FAQ says Ollama supports two levels of concurrent processing: several models loaded at once, if there is enough memory, and parallel requests to one model. Parallel requests increase the context size by their number: a 2K context with 4 parallel requests becomes 8K, with extra memory. If there is not enough memory for a new model, requests are queued. For GPU inference, new models must fit completely in VRAM to be loaded together. The server settings the FAQ names include OLLAMA_MAX_LOADED_MODELS.

Setting environment variables

Setting OLLAMA_HOST to 0.0.0.0:11434 makes the server listen on all network addresses: do that only on a network you trust, because anyone who can reach it can use your models.

How do I see if the GPU is used?

ollama ps and its PROCESSOR column.

What if requests get HTTP 503?

The FAQ says Ollama answers 503 when too many requests are queued.

Sources

  • Ollama documentation: Local FAQ (docs.ollama.com/faq)
  • Ollama documentation: Context length (docs.ollama.com/context-length)

Read on 14 November 2026.

This is an independent guide. It is not connected with Ollama, the llama.cpp project or any company named here. This field changes quickly: statements about Ollama and llama.cpp were read on 14 November 2026 from the pages named under Sources. The memory numbers are estimates from arithmetic. We did not run any model for these pages.