Introduction
The nteract Desktop runtime daemon (runtimed) is a singleton background process that manages:
- Environment pools - Prewarmed Python environments (UV and Conda) for instant notebook startup
- CRDT sync - Real-time notebook document synchronization across windows using Automerge
- Blob storage - Content-addressed storage for notebook outputs (images, HTML, large data)
- Kernel execution - Daemon-owned kernels for multi-window notebook sharing (experimental)
Architecture
Communication Channels
All daemon communication goes through a single Unix socket (~/.cache/runt/runtimed.sock on Linux, ~/Library/Caches/runt/runtimed.sock on macOS) with channel-based routing.
Handshake Protocol
Every connection starts with a JSON handshake declaring the channel:The handshake frame is sent using length-prefixed binary framing. See the IPC Protocol documentation for details.
Available Channels
Pool Channel
Purpose: Acquire and return prewarmed Python environments Lifetime: Short-lived request/response Protocol: Length-framed JSON Operations:Take- Acquire a UV or Conda environment from the poolReturn- Return an environment to the poolStatus- Get pool statistics (available, warming)Ping- Health checkShutdown- Graceful daemon shutdownFlushPool- Drain and rebuild all environments
SettingsSync Channel
Purpose: Real-time synchronization of user preferences Lifetime: Long-lived, bidirectional Protocol: Automerge sync messages How it works:- Client connects and exchanges Automerge sync messages with daemon
- Daemon holds canonical document, persisted to
~/.cache/runt/settings.automerge - Changes from any peer are broadcast to all connected windows
- Daemon watches
~/.config/nteract/settings.jsonfor external edits
NotebookSync Channel
Purpose: Real-time notebook document synchronization Lifetime: Long-lived, bidirectional Protocol: Automerge sync messages + JSON requests/responses/broadcasts Room architecture:- Each notebook gets a “room” in the daemon
- Multiple windows editing the same notebook sync through the room’s canonical document
- Rooms persist documents to
~/.cache/runt/notebook-docs/{sha256(notebook_id)}.automerge - Last peer disconnect evicts the room (document already on disk)
- v1 (legacy): Raw Automerge frames only
- v2 (current): Typed frames with first-byte type indicator
0x00- Automerge sync message (binary)0x01- NotebookRequest (JSON)0x02- NotebookResponse (JSON)0x03- NotebookBroadcast (JSON)
Blob Channel
Purpose: Write blobs to content-addressed storage Lifetime: Short-lived Protocol: Binary framing Flow:Platform Paths
The daemon uses platform-appropriate directories:Singleton Management
Only one daemon runs per user. A file lock ensures mutual exclusion: Lock file:~/.cache/runt/daemon.lock
Info file: ~/.cache/runt/daemon.json
Unix socket path for IPC
Process ID of the daemon
Daemon binary version
ISO 8601 timestamp when daemon started
HTTP server port for blob reads (if blob server is running)
Git worktree path (development mode only)
Human-readable workspace description (development mode only)
Security Model
Write Operations (Unix Socket)
Authentication: Filesystem permissions on the socket Access: Only processes running as the same user can connect Mechanism: Unix domain socket or named pipe (Windows)Read Operations (HTTP)
Authentication: None (unauthenticated localhost HTTP) Why this is safe:- Content-addressed with 256-bit SHA-256 hashes (not guessable)
- Read-only endpoint
- Non-secret data (notebook outputs the user produced locally)
- Binds to
127.0.0.1only (localhost)
Client Libraries
The daemon provides Rust client libraries:Next Steps
IPC Protocol
Learn about the Unix socket IPC protocol, framing, and message formats
Blob Store API
Explore the HTTP blob storage API for content-addressed outputs