Run Hermes Serverless with Modal
π΄ Advancedβ± 12 min readπ
2026-04-14π€ HermesAgent Community
When Serverless Fits Hermes
Serverless is a good fit for bursty, stateless, or scheduled workloads. It is a bad fit for chat sessions that depend on long-lived local state or permanent websocket presence.
A Typical Modal Split
- One function for scheduled jobs
- One function for batch processing
- Persistent storage only for durable artifacts
Example Skeleton
import modal
app = modal.App("hermes-agent")
image = modal.Image.debian_slim().pip_install("hermes-agent")
@app.function(image=image, schedule=modal.Period(hours=1))
def hourly_digest():
...
Troubleshooting
Cold starts hurt latency
Use serverless for scheduled or async jobs, not for every interactive request path.
State disappears between runs
That is expected. Move durable state to persistent storage or external services.
Costs are unpredictable
Serverless is cheap when invocation patterns are spiky. It is not automatically cheaper for always-on workloads.
Next Steps
- Docker production deployment β Compare serverless with a container baseline
- VPS deployment guide β Compare with a fixed monthly host
- Automation recipes β Find workloads that actually fit scheduled serverless runs
Last updated: April 14, 2026 Β· Hermes Agent v0.8