#changing keepalive duration for a specific ollama model
1 messages Β· Page 1 of 1 (latest)
Yes β set keep_alive as an Ollama model param for that specific model.
If youβre using the native Ollama provider (api: "ollama"), OpenClaw forwards keep_alive as a top-level Ollama /api/chat request field, not inside options.
Example config:
{
models: {
providers: {
ollama: {
baseUrl: "http://127.0.0.1:11434",
apiKey: "ollama-local",
api: "ollama",
models: [
{
id: "qwen2.5:7b",
name: "qwen2.5:7b",
params: {
keep_alive: "5m"
}
}
]
}
}
}
}
Or with CLI merge, for an agent/default per-model param:
openclaw config set agents.defaults.models '{"ollama/qwen2.5:7b":{"params":{"keep_alive":"5m"}}}' --strict-json --merge
Use the exact model ref you run, e.g. ollama/llama3.2:latest. If you already have that model listed under models.providers.ollama.models, put params.keep_alive on that provider model entry instead β explicit provider model params win over agents.defaults.models.
If it doesnβt take effect, please paste openclaw --version; this behavior depends on the newer native Ollama provider path.
great , thanks
Glad that helped! π
If this fixed it, please right-click the solution message β Apps β β
Mark Solution so Answer Overflow indexes it for future users.
I tried to do it. is it ok ?
Yep, that looks good β the β reaction came through. Thanks for marking it! π¦
thank you