8B 로컬 모델 Agent 루프 원인: Hermes 하드 튜닝 3가지 (2026)
2026년 Llama 3.1/3.2 8B, Qwen 2.5 7B, Hermes 3 8B 로컬 실행은 저렴해 보이다가 Agent가 데스 루프에 빠지면 달라집니다. 잘못된 도구 JSON, terminal 반복, 「테스트를 실행하겠습니다…」만 말하고 도구는 안 부름—GPU는 괜찮고 샘플링+컨텍스트+도구 표면이 무너집니다.
Hermes Agent(NousResearch/hermes-agent, MIT)는 프론티어용이지만 OpenRouter, Ollama 등 OpenAI 호환 엔드포인트에서 동작합니다. 소형 모델이 Agent에서 깨지는 이유와 16–24GB VRAM Mac/Linux에서 장시간 안정화하는 하드 튜닝 3가지·7단계를 설명합니다(서울 리전 상시 Mac에도 적용).
config.yaml 사용자 temperature는 아직 제한적(#17565)—Ollama 서버 샘플링과 아래 reasoning·도구 강제를 병행하세요.8B가 function calling에서 막히는 이유
소형 instruct는 단발 채팅용이며 수십 턴 도구 기록에는 약합니다.
| 약점 | Hermes 증상 | 토큰 소모 |
|---|---|---|
| 구조화 출력 드리프트 | JSON에 산문, 잘못된 키, 가짜 텍스트 호출 | 파서 재시도 |
| 주의 희석 | 초기 HTML/로그가 목표를 밀어냄 | 중지 조건 망각·반복 |
| 고엔트로피 | 같은 계획의 다른 표현 | 미세 변경 curl/grep |
인용 정의:Hermes 「도구 호출」은 런타임이 파싱·실행하는 구조화 메시지입니다. 8B가 서술만 내면 루프는 진행되지 않습니다.
궤적 압축과 Mac mini 사양을 함께 보세요.
아키텍처: Hermes가 매 턴 보내는 것
| 계층 | 경로 | 8B 영향 |
|---|---|---|
| 모델 | hermes model | context_length 현실화 |
| 도구 | disabled_toolsets | 스키마 감소 |
| Skills | -s a,b | 최대 2개 |
| 강제 | tool_use_enforcement | 실행 강제 |
| Reasoning | reasoning_effort | medium은 숨은 thinking 토큰 |
| 위생 | compression.* | 거대 stdout 선제 절단 |
로컬은 Ollama temperature 0.2 등 서버 샘플링을 쓰고 #17565까지 YAML temperature는 보조입니다.
온도보다 중요한 튜닝 3가지
튜닝 1 — reasoning_effort: none
agent:
reasoning_effort: none # or minimal for light planning
display:
show_reasoning: false
/reasoning
/reasoning none
튜닝 2 — tool_use_enforcement
agent:
tool_use_enforcement: true
provider_routing:
require_parameters: true
"auto"는 GPT/Gemini만—로컬 8B는 수동 true.
튜닝 3 — skill 2개·최소 toolset
hermes chat --toolsets "terminal,file" \
-s github-pr-workflow,plan \
-m "qwen/qwen-2.5-7b-instruct"
- 사전 로드 skill 2개 이하
- 무거운 toolset 비활성(아래)
- 8B에 전체 MCP 비권장(MCP Mac 가이드)
agent:
disabled_toolsets:
- web
- browser
- image_gen
- moa
- memory
hermes profile create local-8b --no-skills
7단계: 안정 8B Agent
1단계 — 설치·현실적 context
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
source ~/.zshrc
hermes doctor
model:
context_length: 16384
선행: Hermes Mac 설정.
2단계 — 로컬 엔드포인트
hermes model
hermes chat -q "Reply OK only" -m "your-local-model-id"
3단계 — YAML 3튜닝
agent:
reasoning_effort: none
tool_use_enforcement: true
disabled_toolsets:
- web
- browser
- image_gen
- memory
compression:
enabled: true
threshold: 0.40
tool_output:
max_bytes: 20000
max_lines: 500
file_read_max_chars: 30000
4단계 — 서버 샘플링
PARAMETER temperature 0.2
PARAMETER top_p 0.9
5단계 — 2 skill 경계 작업
hermes chat --toolsets "terminal,file" \
-s plan \
-m "your-local-model-id"
Task: list top 5 largest files in ./src, write paths to /tmp/top5.txt.
Rules: max 8 tool calls; if stuck, stop and report blocker.
6단계 — /usage·/stop
/usage
/stop
7단계 — 상시 Mac mini(선택)
루프 안정 후 cron Discord 다이제스트. 8B는 GPU, 게이트웨이는 CPU.
문제 해결
매번 JSON 파싱 실패
해결: tool_use_enforcement: true, toolset terminal,file, 온도↓, 도구용 quant.
「곧…」만 있고 도구 없음
해결: SOUL.md에 반드시 도구 호출. skill 1개. reasoning_effort: high 금지.
16K에서 4턴째 만충
해결: compression.threshold: 0.35, 궤적 압축, 붙여넣기 전 /compress.
FAQ
reasoning_effort: none + enforcement. #17565.compression.*는 라이브 창—8B에서 둘 다.