AI / Automation

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로 이 문제를 겨냥합니다: ModalDaytona sandbox가 idle 시 하이버네이트하고, Hermes가 shell tool을 실행할 때만 깨어납니다—휴대폰 Telegram에서 대화하는 동안.

중요(예산 방어): upstream은 gateway가 listen하는 위치(보통 Telegram long polling용 소형 상시 호스트)와 무거운 command가 실행되는 위치(Modal/Daytona)를 구분합니다. 본문은 모델 API까지 포함해 «전부 ₩0»이 아닌 최저 비용의 정직한 아키텍처를 보여줍니다.
고지: MacXCode는 상시 가동 Xcode CI나 OpenClaw gateway가 필요한 팀에 Apple Silicon Mac mini M4 월정액 호스트를 제공합니다—비용 매트릭스에서는 대비용으로만 언급하며, 가장 저렴한 Telegram+Hermes 경로는 아닙니다.
Hermes Agent serverless Modal Daytona Telegram 하이버네이트 클라우드 Mac mini M4 서울 노드

운영 비용 문제

예산에 민감한 창업자와 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.yamlterminal.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 sleepModal cloud
Terminal backend: Daytona — tool burst 사이 sandbox sleepDaytona cloud
LLM provider해당 없음 (token당 과금)OpenRouter, Nous Portal 등

원하는 wake 경로:

  1. Telegram에서 bot에 메시지를 보냅니다.
  2. 경량 호스트의 gateway가 update를 받습니다.
  3. Hermes agent loop가 tool 호출 → Modal/Daytona wake, command 실행, output 반환.
  4. 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 거의 ₩0Telegram + burst automation두 vendor 모니터링
가정용 Mac / laptop gateway전기료만개인 dev 테스트온라인 유지 필요
월정액 Mac mini M4 (MacXCode급)월정액 lease(리전별)한 Apple Silicon 호스트에 Xcode + agentchat-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이 맞는 경우

  • 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.backendmodal 또는 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 스택

  1. Hermes 설치curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
  2. Model authhermes setup(BYO key; 비용 제어용 OpenRouter budget model).
  3. Serverless backend 선택 — Modal(modal token new) 또는 Daytona(DAYTONA_API_KEY).
  4. ~/.hermes/config.yaml 작성 — 위 resource limit으로 terminal.backend: modal 또는 daytona.
  5. Telegramhermes gateway setup; ~/.hermes/.env 확인.
  6. Thin gateway host — VPS에 hermes gateway install && hermes gateway start(비싼 GPU box 아님).
  7. Smoke test — bot에 «uname -a 실행 후 보고»—Modal/Daytona dashboard에서 sandbox start/stop 관찰.
  8. 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 envhermes doctor; Hermes venv에 modal install
Stale sandboxcontainer_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 sectionhost-mounted volume path에 기록.

FAQ

월정액 비용이 정말 ₩0일 수 있나요?+
엔드투엔드로는 unlikely합니다. idle Modal/Daytona compute₩0에 근접할 수 있지만, gateway host(월정액 약 ₩7,000 VPS), Telegram, LLM API는 보통 비용이 듭니다. free tier는 변하므로 매월 vendor page를 확인하세요.
Telegram idle 시 Hermes 전체가 하이버네이트하나요?+
Terminal sandbox는 합니다. 기본 long polling gatewaywebhook hosting으로 옮기거나 service를 중지하지 않는 한 깨어 있습니다.
Modal vs Daytona?+
GPU/CPU class와 snapshot persistence를 한 ecosystem에서 원하면 Modal. sandbox UX를 선호하면 Daytona—설정 후 hermes doctor 실행.
월정액 Mac mini M4 렌탈 대체가 되나요?+
Xcode CI: 아니요. Apple Silicon과 24/7 disk가 불필요한 개인 Telegram automation: 예.
공식 serverless 문서는?+
Hermes terminal backendsNousResearch/hermes-agent README(6 backends: local, Docker, SSH, Singularity, Modal, Daytona).

두꺼운 VM 없는 예산형 automation

Telegram + 버스트형 도구만 필요하면 경량 게이트웨이 + Modal/Daytona 하이버네이트가 24/7 셸 호스트보다 저렴합니다—Xcode 동거가 필요할 때만 M4 렌탈을 검토하세요.