# Model logs

> Read a model's deployment log, even days later, follow a running model's live output from the Servers page, and read an inference node's own, kernel and out-of-memory daemon logs through the API.

## Where the logs are

Every deployed model on the **Servers** page has a **⋯** menu in the upper right corner of
its card. Two items open a model's logs, both in the same large window:

- **Live logs** shows the running model's output: its recent lines first, then every new
  line as it is written, for as long as the window is open. Send the model a request and
  its output appears here.
- **Deployment log** shows what the model's containers printed from their start until
  the deployment finished (running, failed or stopped). It is offered once the inference
  node has deployed the model at least once since it last started.

Each line is prefixed with the name of the process it came from, dimmed, when the model
runs more than one: a container's name from the deploy profile, or `engine` for a model
that runs as a plain process on the inference node.

## Live logs

Opening **Live logs** asks the inference node to follow the model's output. Closing the
window stops it. A browser tab that is closed or loses its connection stops following on
its own within about a minute and a half, so a forgotten window never keeps an inference
node busy.

The window says why it stopped:

- **stopped**: you closed it, or it was not kept open.
- **was interrupted**: the model's processes ended while you watched, for example because
  it was restarted or undeployed. Open **Live logs** again to follow the new processes.
- **failed**: the inference node could not follow the model. The last line says why, for
  example that nothing is running for this model, or that the model was started before
  the inference node's last restart (restart the model to follow it).

An inference node follows at most eight models' output at a time. The recent history is
at most the last 1000 lines of each process.

## Deployment log

While a deployment runs, its log streams live. After it finishes, the control plane keeps
the whole log: the window shows it as it was, and **Download full log** saves it as a
text file. A very long log is shown from its end; the download always holds all of it.

When there is no copy to show, the window says why, for example that the inference node
was not connected when the deployment finished, or that the log was removed to keep the
newest ones. The control plane keeps the newest 1000 deployment logs.

When the inference node's software stops during a deployment (it was killed, ran out of
memory or crashed), the deployment log ends as **interrupted** once the inference node
is connected again, and the lines written until then are kept like any other deployment
log.

## Searching a log over the API or MCP

The same kept logs can be searched through the API the way `grep`, `head` and `tail`
search a file, which is how the DevOps agent reads them:

- `POST /api/v1/logs/list` (MCP: `logs_read`, operation `list`) answers the logs there
  are, the newest first, for an inference node or one replica. A log that was not kept
  is listed with the reason.
- `POST /api/v1/logs/read` (operation `read`) reads one, filtered: `pattern` (a regular
  expression, like `grep -E`), `ignore_case` (`-i`), `invert_match` (`-v`),
  `context_lines` (`-C`), `head_lines` and `tail_lines`. `"pattern": "error",
  "tail_lines": 20` is `grep error | tail -n 20`. An answer holds at most 2000 lines; a
  longer one says so and how to read on with `after_line_number`.

The same `logs/read` also reads three logs of the machine an inference node runs on, over
a time window, from the machine itself: `"log": {"inference_node_id": "...", "host_log":
"kernel"}` with `since` (and `until`, RFC 3339 with an offset). `host_log` is
`inference-node-service` (the inference node's own software, a run that crashed
included, and the service manager's lines about it), `kernel` (the kernel log of every
boot in the window: which process the kernel killed for running out of memory, GPU
driver messages) or `oom-daemon` (earlyoom or systemd-oomd, when one is installed: which
process it stopped). Each line starts with its time in UTC. Nothing of it is kept, and
`logs/list` does not list these logs. The inference node answers at most the newest
10000 lines of the window; when it left older lines out, the answer says so, and a
narrower window reads them. The inference node must be connected. When it may not read
the machine's system journal, the answer names the cause and the command that fixes it
(its service account needs the `systemd-journal` group).

All of these need the permission `inference-node-logs:read`, which the Administrator,
Operator and Viewer roles hold.

Secrets never reach a log: the inference node removes credentials, tokens, license keys
and signed URLs from every line before it leaves the machine.
