2026-05-29 Hermes Agent Serverless: Modal/Daytona 하이버네이트 + Telegram 깨우기 (HK / JP / KR / SG / US·서울 노드)
AI agent용 24/7 클라우드 VM은 LLM token 비용 전에도 월 ₩7,000–28,000이 듭니다(서울 노드·KR 리전 기준). Hermes Agent(MIT, Nous Research)는 serverless terminal backend로 이 문제를 겨냥합니다: Modal과 Daytona sandbox가 idle 시 하이버네이트하고, Hermes가 shell tool을 실행할 때만 깨어납니다—휴대폰 Telegram에서 대화하는 동안.
운영 비용 문제
예산에 민감한 창업자와 automation 취미 사용자는 보통 세 가지 청구서를 봅니다:
| 비용 항목 | 일반적 구간 | 주요 요인 |
|---|---|---|
| Compute VM | ₩7,000–70,000/월 | gateway + tool용 상시 VPS/RDS |
| LLM API | ₩7,000–700,000+/월 | 모델 선택 × tool loop 횟수 |
| Egress / storage | ₩0–28,000/월 | 로그, artifact, Modal disk |
Hermes는 LLM 비용을 없애지 않습니다. terminal execution을 Modal/Daytona로 라우팅해 24/7 bash를 돌리는 두꺼운 상시 box 대신 burst 사이 idle compute 비용을 거의 0에 가깝게 줄일 수 있습니다.
iOS 빌드용 월정액 Mac mini M4에서 이미 Hermes를 돌리고 있다면 M4 Telegram gateway 가이드를 참고하세요—본문은 Xcode 동거 극대화가 아니라 클라우드 compute 최소화에 초점을 둡니다.
아키텍처: gateway vs terminal backend
인용 가능한 기술 요약: Hermes gateway(hermes gateway)는 messaging을 처리하고, terminal backend(~/.hermes/config.yaml의 terminal.backend)는 bash, file tool, script가 어디서 실행되는지 결정합니다.
| 계층 | idle 시 하이버네이트? | 일반적 호스트 |
|---|---|---|
| Telegram gateway (long polling) | 아니요 — outbound poll에 실행 중인 process 필요 | 월정액 약 ₩7,000 VPS, 가정용 Mac, lease Mac |
| Terminal backend: Modal | 예 — tool burst 사이 sandbox sleep | Modal cloud |
| Terminal backend: Daytona | 예 — tool burst 사이 sandbox sleep | Daytona cloud |
| LLM provider | 해당 없음 (token당 과금) | OpenRouter, Nous Portal 등 |
원하는 wake 경로:
- Telegram에서 bot에 메시지를 보냅니다.
- 경량 호스트의 gateway가 update를 받습니다.
- Hermes agent loop가 tool 호출 → Modal/Daytona wake, command 실행, output 반환.
- Sandbox가 다시 하이버네이트; gateway는 유지될 수 있습니다(적은 RAM).
진짜 전부 sleep하려면 upstream Telegram 문서의 Fly.io/Railway webhook mode(HTTPS ingress)가 있습니다—SSH-only Mac lease에서는 어렵습니다. 기본 long polling이 더 단순하지만 상시 gateway process가 필요합니다.
공식 참고: Terminal backends, Telegram setup, GitHub README.
비용 의사결정 매트릭스 (4행)
| 패턴 | 월 idle compute | 최적 | 트레이드오프 |
|---|---|---|---|
| Fat VPS 24/7 | ~₩7,000–17,000 (1 vCPU) | 가장 단순한 mental model | 잠자는 동안에도 과금 |
| Thin VPS gateway + Modal/Daytona tool | 월정액 약 ₩7,000 gateway + idle sandbox 거의 ₩0 | Telegram + burst automation | 두 vendor 모니터링 |
| 가정용 Mac / laptop gateway | 전기료만 | 개인 dev 테스트 | 온라인 유지 필요 |
| 월정액 Mac mini M4 (MacXCode급) | 월정액 lease(리전별) | 한 Apple Silicon 호스트에 Xcode + agent | chat-only bot 최저가 아님 |
Modal은 sandbox 실행 중 CPU-second·GB-second 과금; idle 하이버네이트 구간에는 해당 요금이 없습니다. Daytona도 유사한 sleep-when-idle을 표방합니다—프로덕션 전 각 vendor dashboard에서 현재 pricing을 확인하세요.
Apple Mac mini specs는 gateway와 빌드를 동거할 때만 의미 있습니다—serverless terminal routing에는 필수 아님.
Modal terminal backend
Modal이 맞는 경우
- Telegram 메시지 간격이 수 분인 burst shell 작업(script,
pip install, data pull). - ML 작업용 선택 GPU class(실행 중에만 과금).
container_persistent: true일 때 Modal snapshot으로 filesystem persistence.
~/.hermes/config.yaml 설정
terminal:
backend: modal
modal_image: "nikolaik/python-nodejs:python3.11-nodejs20"
container_cpu: 1
container_memory: 5120
container_disk: 51200
container_persistent: true
전제(upstream):
pip install modal
modal token new
hermes doctor
Modal이 맞지 않는 경우: 거대 monorepo checkout에서 sub-second 로컬 file edit—cold start + image pull latency. repo가 있는 machine에서 local 또는 SSH backend 사용.
Daytona terminal backend
Daytona는 tool execution을 idle 시 하이버네이트하는 cloud sandbox로 라우팅합니다(Hermes docs). 설정:
terminal:
backend: daytona
gateway 시작 전 API key export:
export DAYTONA_API_KEY="your_key"
# persist in ~/.hermes/.env for launchd
Daytona가 맞는 경우: VPS에서 Docker 없이 serverless persistence—Hermes README는 «세션 사이 비용 거의 없음»을 위해 Daytona를 Modal과 병렬로 둡니다.
Daytona가 맞지 않는 경우: on-prem만 허용하는 엄격한 data residency—cloud sandbox는 compliance 범위 밖.
Telegram: fat server 없이 agent 깨우기
Telegram을 한 번 연결(전체 단계는 Telegram gateway 가이드):
hermes gateway setup
저비용 gateway 호스트:
- 월정액 약 ₩7,000 VPS(1 GB RAM)—
hermes gateway+~/.hermes/.env만 실행 - Oracle Cloud free tier(리전별 가용—계정 한도 확인)
- 실험용 가정용 상시 Mac
같은 machine에서 terminal.backend를 modal 또는 daytona로—gateway는 경량; 무거운 작업은 serverless sandbox wake.
보안: 숫자 TELEGRAM_ALLOWED_USERS만—allowlist 없이 bot 노출 금지(@userinfobot로 ID 확인).
Hermes vs OpenClaw vs OpenHuman 매트릭스에서 agent framework 비교—OpenClaw는 headless launchd lease에, Hermes는 learning loop + Modal/Daytona offload에 강합니다.
8단계 runbook: near-idle compute 스택
- Hermes 설치 —
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash - Model auth —
hermes setup(BYO key; 비용 제어용 OpenRouter budget model). - Serverless backend 선택 — Modal(
modal token new) 또는 Daytona(DAYTONA_API_KEY). ~/.hermes/config.yaml작성 — 위 resource limit으로terminal.backend: modal또는daytona.- Telegram —
hermes gateway setup;~/.hermes/.env확인. - Thin gateway host — VPS에
hermes gateway install && hermes gateway start(비싼 GPU box 아님). - Smoke test — bot에 «
uname -a실행 후 보고»—Modal/Daytona dashboard에서 sandbox start/stop 관찰. - Cost guardrails — provider spend cap; gateway 불필요 시 휴가 중
hermes gateway stop예약.
문제 해결
Bot은 «hello»인데 tool이 Modal auth error
| 증상 | 수정 |
|---|---|
modal token 없음 | gateway host user에서 modal token new |
| Wrong Python env | hermes doctor; Hermes venv에 modal install |
| Stale sandbox | container_persistent 토글 또는 Modal app log 정리 |
Sandbox는 도는데 Telegram 무응답
- Gateway 미실행:
hermes gateway status ~/.hermes/logs/gateway.log에서 Telegram token error 확인- bot token당 poll process 하나만(
Conflict: terminated by other getUpdates)
예상보다 비용 높음
- LLM token이 대부분—model 전환, tool loop 단축, upstream CLI docs의 chat
/compress - Modal persistent disk snapshot은 storage 과금—
container_disk축소 - Gateway VPS가 4 GB RAM tier—poll만이면 1 GB로 downgrade
Modal backend에서 MEDIA: file attachment 실패
Gateway는 host path에서 file 전송—Modal 내부에서는 upstream docs Telegram + Docker section의 host-mounted volume path에 기록.
FAQ
hermes doctor 실행.두꺼운 VM 없는 예산형 automation
Telegram + 버스트형 도구만 필요하면 경량 게이트웨이 + Modal/Daytona 하이버네이트가 24/7 셸 호스트보다 저렴합니다—Xcode 동거가 필요할 때만 M4 렌탈을 검토하세요.