What “Serverless Persistence” Means Here
Lesson 13’s Docker backend gets its persistence from a single container that keeps running, sleep 2h and beyond, for the life of the Hermes process. That works, but it means you’re paying for (or at least occupying) compute even during long stretches where nobody is talking to the agent.
Daytona and Modal solve the same problem, state that survives across calls and sessions, differently: the environment hibernates when idle and wakes on demand, so you get the practical benefit of persistence (installed packages, working directory, files) without the always-on cost.
flowchart LR
A["Tool call arrives"] --> CHECK{"Environment\nhibernating?"}
CHECK -->|yes| WAKE["Wake environment\n(brief cold-start delay)"]
CHECK -->|no| RUN["Already warm, run immediately"]
WAKE --> RUN
RUN --> IDLE["No activity for a while"]
IDLE --> HIBERNATE["Hibernate: costs\nnearly nothing"]
HIBERNATE -.-> CHECK
style A fill:#EEF0F7,stroke:#6366F1,color:#0F172A
style CHECK fill:#EEF0F7,stroke:#6366F1,color:#0F172A
style WAKE fill:#fff7ed,stroke:#f59e0b,color:#0F172A
style RUN fill:#f0fdf9,stroke:#0D9488,color:#0F172A
style IDLE fill:#EEF0F7,stroke:#6366F1,color:#0F172A
style HIBERNATE fill:#fff7ed,stroke:#f59e0b,color:#0F172A
Modal
Modal offers two integration paths: a direct connection, or routing through a Nous-managed gateway.
export MODAL_TOKEN_ID=ak-...
# or, alternatively, a ~/.modal.toml file with the same credentials
terminal:
backend: "modal"
Validate before relying on it:
hermes doctor # explicitly checks for MODAL_TOKEN_ID or ~/.modal.toml
Daytona
Daytona is a workspace platform purpose-built for exactly this kind of ephemeral, persistent development environment.
export DAYTONA_API_KEY=dtn_...
terminal:
backend: "daytona"
The Daytona SDK handles server URL configuration on its own, you generally only need the API key, which keeps setup close to the simplicity of the local backend while getting Docker-equivalent statefulness with none of the always-on cost.
Comparing Your Deployment Options So Far
| Backend | State persists? | Cost when idle | Cold-start delay | Best for |
|---|---|---|---|---|
| Local (Lesson 13) | Yes, on your machine | N/A (your machine) | None | Personal dev work |
| Docker (Lesson 13) | Yes, always-on container | Full compute cost, continuously | None | Frequent, sustained use; full control |
| SSH (Lesson 13) | Yes, on the remote box | Whatever that box normally costs | None | Keeping execution on infra you already run |
| Modal / Daytona | Yes, hibernates when idle | Near-zero between uses | Brief, on wake | Bursty or infrequent use, cost-sensitive deployments |
There’s no universally correct choice here, it’s a direct function of usage pattern. A bot that fields messages sporadically throughout the day (Module 6) is the textbook case for serverless persistence: you get the same continuity of state as Docker, without paying for the idle hours in between.
Common pitfall: choosing an always-on Docker backend for a low-traffic deployment out of habit, then being surprised by the compute bill. If your traffic pattern has long idle gaps, run the cost comparison before defaulting to the backend you’re most familiar with.
Exercise: if you have access to either a Modal or Daytona account, configure one as your terminal backend and run
hermes doctorto confirm it authenticates correctly. Note the response latency on a request after a period of inactivity versus one immediately following, that gap is the hibernate/wake cycle in action.