Connecting a Remote Daemon
A remote daemon runs on your local machine and connects outbound to a Reliant gateway. This is the standard setup for distributed mode — your code stays on your machine, and the daemon dials out to the gateway over a persistent gRPC stream.Registration
Before starting a daemon, register it to create authentication credentials:Starting the Daemon
Options
Global flags control which server the daemon connects to:
When
--gateway is not set, it’s derived from the server URL automatically (e.g., https://reliantapi.com becomes https://gateway.reliantapi.com).
Token-Based Authentication
For headless or CI environments where a browser flow isn’t possible, use the--token flag to provide a PAT directly:
Managing the Daemon
Auto-Recovery
If the daemon loses its connection or receives an authentication error, it automatically:- Deletes stale credentials
- Re-registers with fresh credentials
- Retries the connection
Managed Cloud Daemons
Managed daemons are cloud-hosted daemon instances provisioned by the Reliant control plane. Unlike local daemons that run on your machine and dial out to the gateway, managed daemons run as pods in the cloud and accept inbound connections from the gateway.How They Differ from Local Daemons
Reverse Connection Architecture
Managed daemons use a reverse connection model:- The control plane provisions a daemon pod and publishes a connect command to NATS
- The gateway receives the command and opens a gRPC stream to the daemon pod (instead of the other way around)
- The daemon’s identity (daemon ID, user ID) is stamped by the gateway from the connect command — the daemon pod itself doesn’t need credentials
Suspend and Resume
Managed daemons can be suspended when idle to save resources. When a workflow needs to execute tools on a suspended daemon, the system automatically resumes it:- The NATS daemon router resolves the daemon and sees its status is
IDLEorDISCONNECTED - It calls
ResumeDaemonon the control plane - The control plane brings the pod back up
- The gateway reconnects and tool execution proceeds
Daemon Selection
When you have multiple daemons (e.g., a local laptop daemon and a cloud daemon), Reliant uses a priority-based selection algorithm to determine which daemon handles tool execution.Selection Priority
The daemon is resolved in this order, from highest to lowest priority:- Node-level
daemonfield — A per-node override in workflow YAML. Takes highest priority. - Workflow-level
daemonfield — A top-level field on the workflow. Applies to all nodes unless overridden. - Session daemon — The daemon selected in the chat UI via the daemon picker. Stored as
active_daemon_idon the chat. - Default resolution — Automatic selection when nothing is explicitly set.
Default Resolution Algorithm
When no daemon is explicitly selected, resolution follows a three-step cascade: Step 1: Connected daemons. Check all daemons currently connected to the gateway for this user. If multiple are connected, prefer local over cloud. If multiple of the same type exist, pick the most recently connected. Step 2: Control plane lookup. If no connected daemon matched and a control plane is configured, ask it to resolve a daemon. The control plane prefers active daemons and can automatically resume suspended ones. Step 3: Database fallback. Query the database for the user’s daemons and return the first with anactive status.
Local daemons always win over cloud daemons in default resolution. If you have a local daemon running, it will be used unless you explicitly select a different daemon via the UI or a workflow
daemon field.Setting the Session Daemon
In the chat UI, use the daemon picker to select which daemon a chat session should use. This sets theactive_daemon_id on the chat, which is injected into all workflow executions from that chat as the session daemon.
Clearing the daemon picker returns to default resolution behavior.
The daemon Field in Workflows
Workflows and individual nodes can specify a daemon field to control which daemon runs their tools. The field supports three formats:
String shorthand — Use a type keyword or a daemon name:
local, cloud, and any are treated as type selectors. Any other string is treated as a daemon name.
Structured selector — Specify multiple criteria:
id, name, type, and labels keys.
Per-Node Overrides
Individual workflow nodes can override the workflow-level daemon:Daemon Labels
Labels are arbitrary key-value pairs attached to a daemon. They allow fine-grained selection when you have multiple daemons of the same type. Labels are stored in the daemon’s identity file (~/.reliant/daemon.json) and sent to the gateway on connection. Use them in workflow selectors:
{gpu: "true", env: staging, region: us-west-2} matches the selector above, but a daemon with only {gpu: "true"} does not.
Daemon Status Lifecycle
Daemons go through the following status transitions:disconnected. Reconnecting or resuming a managed daemon transitions back to active.
Troubleshooting
Daemon not connecting: Verify your credentials withreliant daemon status. If credentials are stale, delete the credentials file and re-register with reliant daemon register.
Wrong daemon being used: Check which daemon is selected in the chat UI daemon picker. If no session daemon is set, local daemons take priority over cloud. Use the workflow daemon field to explicitly target a specific daemon.
Managed daemon not waking: The auto-resume mechanism requires a control plane connection. Check that the server is configured with a control plane client and that the NATS broker is reachable.
TLS errors: Use --tls-mode insecure_tls_skip_verify for development environments with self-signed certificates. For production, provide valid certificates with --tls-cert and --tls-key.