AI / 자동화

8B 로컬 모델 Agent 루프 원인: Hermes 하드 튜닝 3가지 (2026)

Mac에서 Llama 3.1 8B·Qwen 2.5 7B를 Hermes Agent로 안정적 함수 호출 튜닝

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에도 적용).

참고: ProxyMac은 Mac 호스팅 가이드를 게시하며 Hermes는 벤더 중립입니다. config.yaml 사용자 temperature는 아직 제한적(#17565)—Ollama 서버 샘플링과 아래 reasoning·도구 강제를 병행하세요.

8B가 function calling에서 막히는 이유

소형 instruct는 단발 채팅용이며 수십 턴 도구 기록에는 약합니다.

약점Hermes 증상토큰 소모
구조화 출력 드리프트JSON에 산문, 잘못된 키, 가짜 텍스트 호출파서 재시도
주의 희석초기 HTML/로그가 목표를 밀어냄중지 조건 망각·반복
고엔트로피같은 계획의 다른 표현미세 변경 curl/grep

인용 정의:Hermes 「도구 호출」은 런타임이 파싱·실행하는 구조화 메시지입니다. 8B가 서술만 내면 루프는 진행되지 않습니다.

궤적 압축Mac mini 사양을 함께 보세요.

아키텍처: Hermes가 매 턴 보내는 것

계층경로8B 영향
모델hermes modelcontext_length 현실화
도구disabled_toolsets스키마 감소
Skills-s a,b최대 2
강제tool_use_enforcement실행 강제
Reasoningreasoning_effortmedium은 숨은 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

Hermes 3 8B 공식 지원?+
OpenAI 호환 ID면 라우팅 가능. quant·context·도구 튜닝이 핵심. cron 전 7단계 검증.
config.yaml temperature?+
2026년 6월 제한적. 서버 sampling + reasoning_effort: none + enforcement. #17565.
Trajectory Compressor 관계?+
완료 궤적 배치용. 런타임 compression.*는 라이브 창—8B에서 둘 다.
Llama 3 vs Qwen 2.5?+
Qwen2.5-Instruct가 7B–8B JSON에 유리한 편. Llama 3.1 8B는 enforcement+소형 toolset. 자체 벤치.
GitHub MCP + skill 2?+
8B에서는 MCP 또는 skill 2개. 10턴 안정 후 확장.

상시 가동 Mac으로 로컬 Agent?

Mac mini로 8B 추론 중에도 Hermes 게이트웨이 유지.