Agent Runtime Server Setup
Running agents evergreen on a server came with its own set of problems. Your server has a fixed amount of RAM. When a runaway program consumes it all, Linux panics and starts killing processes almost at random (the OOM killer), sometimes killing the wrong thing, like your SSH connection, taking the whole box down with it. The setup should have a layered defense so that a single greedy process slows itself down rather than crashing everyone.
This is about agent runtime setup, not agent interface or inference setup. Three things are different. For example, for Claude, agent inference is Anthropic's server, agent interface can be your phone, but agent runtime should be some file system accessible to Claude (not the model, but the program) local binary (which can be separate from the interface layer).
Layers
1. A big overflow area (swap)
Think of RAM as your desk and swap as a filing cabinet next to it. When the desk fills up, rarely-used papers move to the cabinet instead of being thrown on the floor.
I set up a 128GB swap file on its SSD. Slower than RAM, but slow beats crashed. One gotcha baked into the setup: the file must be created with dd (which writes the bytes directly), not fallocate (which creates a file with holes that Linux refuses to use as swap).
2. A compression buffer in front of swap (zswap)
Before pages go to the slow filing cabinet, Linux compresses them (with zstd) and keeps them in a corner of RAM, like vacuum-packing clothes before boxing them. Most of the time, the swapped data never actually hits the disk, so things stay fast.