Skip to content

System services

A model server often runs as a system service (systemctl --system), sometimes under a different account. The service agent finds such servers and reports them, but its account may not start or stop them until the machine’s administrator grants it once.

The grant is optional. A model server that runs as a user service of the agent’s account (systemctl --user) needs no root at all.

On the model machine, as root:

Terminal window
sudo prism-service-agent grant-system-units --user inference

inference is the account the agent runs as. The command:

  1. checks its own executable against the signed release (prism-service-agent verify-self) and grants nothing if the check fails;
  2. finds the model-server system units;
  3. writes /etc/polkit-1/rules.d/60-prism-service-agent-inference.rules, which lets that account run only start, stop and restart, and only for the listed units;
  4. writes /etc/prism-service-agent/granted-inference.json with the same list, so the agent reports those units as controllable.

The same rule lets the account power the machine off through logind, which Prism uses for Wake-on-LAN machines after it stopped their model servers. A machine without model-server system units gets this power-off permission alone.

If the rule cannot be written, nothing is written. If the record cannot be written, the rule is removed again.

Then press Find servers again on the machine in Compute providers and tick the system service.

Options:

  • --unit llama-coder.service (repeatable) grants only the named units. Run the command again after you add a model server.
  • --revoke removes both files.

The pairing script offers this grant on every machine that is not granted yet: when it finds system model servers, and also when the account cannot power the machine off. It asks for one sudo when a terminal is attached, or prints the command. Answering no leaves pairing complete; Prism then cannot start those services or power the machine off.

  • polkit 0.106 or later. The command reads the version from pkaction --version. On polkit 0.105 (Ubuntu 22.04, Debian 11), or when the version cannot be read, it refuses and writes nothing: polkit 0.105 cannot limit a grant to one unit and one verb.
  • A release build of the agent. A development build has no signed release to check against, so the grant is unavailable.
  • Prism still manages only the units you tick in the console. The rule is the upper limit.

Start and stop of a system unit run systemctl --system --no-ask-password: without the grant they fail instead of asking for a password.

To see which system model servers exist and which are not granted:

Terminal window
prism-service-agent system-units --ungranted