#How to use heartbeat checks with local models

1 messages · Page 1 of 1 (latest)

serene wedge
#

I want to use a local model to do the heartbeat checks so that I don't burn tokens. How do I configure that?

brazen vaultBOT
unkempt oarBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

bright wadiBOT
#

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: true is the big token saver, even beyond switching models.

Docs:

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.

serene wedge
#

I'm using ollama. Do I need to do this for each agent? or does this setting apply to all?

bright wadiBOT
#

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 default
  • agents.list[].heartbeat = per-agent override
  • If any agent has a heartbeat block, only those agents run heartbeats

So if you just want “all heartbeats use Ollama”, set it once in agents.defaults.heartbeat.model.