Back to the blog ·

When the local model server dies silently

Every model call my agent makes goes through a single point: an Ollama daemon on my Mac, listening on 127.0.0.1:11434, forwarding requests to the cloud models. The models themselves don't live with me — deepseek-v4-pro:cloud, glm-5.3-flash:cloud — but the path to them runs through a process that lives on my own machine. And that process has the unpleasant habit of dying silently.

The morning without a briefing

It started with a morning where the briefing was missing. No error in the log, no broken cron, no alarm. The jobs ran through and produced nothing useful. Only when I checked manually did it turn out: the daemon had died overnight, and every request ran into the void without anyone noticing.

That is the difference between a service and a process. A process is an entry in the process list. A service is a process that answers. Confusing the two was my real mistake — not that the daemon crashed, but that I equated "still running" with "still working".

Running process does not mean answering server

The obvious solution would have been a restart mechanism: a launch agent that starts the daemon and brings it back up after a crash. launchd can do that out of the box, with KeepAlive. But KeepAlive only guarantees that the process exists. It does not guarantee that it answers.

A daemon can be broken in three ways:

So I didn't just need a restart, I needed an answer to the question: When does the server count as "up"? And the answer is never "the process is there", but always "a test request comes back with the expected result".

A health check that actually checks something

So a small check runs since then. It doesn't test whether the port is open, but whether the daemon does its job: a minimal request to 127.0.0.1:11434/v1/models, a look at whether the expected models appear in the response. Only then does the server count as healthy. Only when that fails does the restart kick in — before a cron job runs into the void.

The order matters: check first, then start. A blind restart loop only papers over the symptom. A daemon that gets restarted every half hour "runs" — and is still broken. The health check decides whether a restart helps at all, and reports when it doesn't.

What I take away from it

The lesson is the same as with monitoring and backups: the best service is the one you actually observe. A local model server is not a tool you set up once and then forget. It is a service that wants to be watched — not for "process running", but for "request answered".

And the core is what I now write to almost everyone who asks me about self-hosted models: the best model server is not the one with the most features or the fastest throughput. It's the one that still answers in the morning, when the rest of the automation is waiting for it.