diff --git a/infra/compute/hermes.md b/infra/compute/hermes.md index aadfb9f..bbd7dca 100644 --- a/infra/compute/hermes.md +++ b/infra/compute/hermes.md @@ -40,6 +40,22 @@ monthly_cost_usd: 0 - 인증 토큰: `/root/.hermes/auth.json` (device_code OAuth). **구독 계정/시크릿은 컨테이너 로컬, repo·Obsidian에 평문 없음** - 검증: `hermes -z '...'` 단발 추론 정상 응답 확인 (2026-06-09) +### 모델 분리 (메인 vs 보조) + +| 용도 | 모델 | 비고 | +|---|---|---| +| 메인 추론 | `openai-codex/gpt-5.4` (ChatGPT Plus) | 복잡한 대화·도구 호출 | +| 보조 (auxiliary) | kr1 [[ollama]] `qwen3:4b-instruct-2507-q4_K_M` | context compression·web_extract | + +보조를 로컬 ollama로 분리한 이유: ① Plus 5h/주간 한도를 보조 작업이 잠식하지 않음 ② 데이터 주권(보조는 내부 LAN 처리) ③ 비용 0. config.yaml `auxiliary.` 에 `provider: custom` + `base_url: http://192.168.9.214:11434/v1`(LAN 직결, tailscale 우회) + `model` 지정. ollama는 auth 불필요. ⚠️ 메인 Codex OAuth는 Hermes의 auxiliary 폴백 체인에서 의도적으로 제외됨(OpenAI 비공개 model allow-list) → 보조는 반드시 명시 지정해야 nous/openrouter probe 경고가 안 뜸. + +### Telegram 게이트웨이 + +- 봇: **HermesBot** (`@HermesTest71Bot`), 토큰·allowed_users는 Vault `secret/apps/hermes` +- `.env`: `TELEGRAM_BOT_TOKEN`, `TELEGRAM_ALLOWED_USERS`(접근 허용 단일 사용자), `TELEGRAM_HOME_CHANNEL` +- 서비스: systemd `hermes-gateway.service` (configuration.nix에 선언, `hermes gateway run`). `systemctl --user`는 incus 비대화형 root 환경에서 불가 → **system 서비스로 선언**. boot 자동시작 + `Restart=always` + `TimeoutStopSec=210`(drain 180s 대비) +- ⚠️ 보안: ALLOWED_USERS 미설정 시 봇 주소만 알면 누구나 터미널 권한 에이전트 조작 가능 → 게이트웨이 시작 전 반드시 잠글 것 + ## NixOS 설정 (정본) 선언적 정본은 Gitea `kaffa/nixos-infra` → `hosts/hermes/configuration.nix`. 적용 절차: diff --git a/infra/platform/ollama.md b/infra/platform/ollama.md index 48d6891..8adadb3 100644 --- a/infra/platform/ollama.md +++ b/infra/platform/ollama.md @@ -70,7 +70,7 @@ sudo -u ollama ollama pull ## 보안 -- **바인딩은 `0.0.0.0`이지만 노출 범위는 tailnet에 한정**. kr1 호스트의 외부 인터페이스(WAN)는 방화벽으로 차단. Tailscale을 통해서만 11434 포트 도달 가능. +- **바인딩은 `0.0.0.0`**. 도달 범위: **tailnet(`100.84.111.28`) + 서울 LAN(`192.168.9.214`)**. WAN(외부 인터페이스)은 방화벽으로 차단. (2026-06-09 확인: LAN `192.168.9.214:11434`도 도달 가능 — 같은 LAN의 워크로드는 tailscale 없이 LAN IP로 붙는 게 더 빠름. 예: [[hermes]] 컨테이너 auxiliary.) - 인증·TLS 없음. 별도 프록시를 붙이지 않음 (tailnet 신뢰 경계로 충분). - OpenClaw·ops-agent 등 다수 클라이언트가 공유할 경우 개별 API 키 구분 불가 → 사용처는 OpenMemory/Obsidian에 명시 기록.