#How to use heartbeat checks with local models
1 messages · Page 1 of 1 (latest)
Yep, use the heartbeat-specific model override:
{
agents: {
defaults: {
model: { primary: "anthropic/claude-sonnet-4-6" }, // normal chats
heartbeat: {
every: "30m",
model: "ollama/llama3.3", // or lmstudio/..., vllm/..., etc.
lightContext: true,
isolatedSession: true
}
}
}
}
CLI version:
openclaw config set agents.defaults.heartbeat.model "ollama/llama3.3"
openclaw config set agents.defaults.heartbeat.lightContext true --strict-json
openclaw config set agents.defaults.heartbeat.isolatedSession true --strict-json
A couple gotchas:
- If you use an allowlist in
agents.defaults.models, add the local model there too. - For Ollama local-only, make sure Ollama is enabled and the model exists, e.g.:
export OLLAMA_API_KEY="ollama-local" ollama pull llama3.3 openclaw models list --provider ollama
isolatedSession: true+lightContext: trueis the big token saver, even beyond switching models.
Docs:
- https://docs.openclaw.ai/gateway/heartbeat
- https://docs.openclaw.ai/gateway/local-models
- https://docs.openclaw.ai/providers/ollama
- https://docs.openclaw.ai/providers/lmstudio
One honest caveat: local models are usually fine for simple heartbeat checks, but tool-heavy heartbeat workflows can get flaky. If you want, tell me whether you’re using Ollama or LM Studio and I’ll paste the exact config block for that setup.
If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution so Answer Overflow can index it.
I'm using ollama. Do I need to do this for each agent? or does this setting apply to all?
If you set it under agents.defaults.heartbeat.model, it applies to all heartbeat runs by default.
Use per-agent only if you want an override:
{
agents: {
defaults: {
heartbeat: {
model: "ollama/llama3.3"
}
},
list: [
{
id: "research",
heartbeat: {
model: "ollama/qwen3:14b"
}
}
]
}
}
Important gotcha:
agents.defaults.heartbeat= global defaultagents.list[].heartbeat= per-agent override- If any agent has a
heartbeatblock, only those agents run heartbeats
So if you just want “all heartbeats use Ollama”, set it once in agents.defaults.heartbeat.model.