참고: 아무튼 로컬모델 1주차 kyung님의 글을 읽고 와 이거 대박이다 해봐야겠다하고 적용해본 후기입니다.
LM Studio에 Gemma 4 E4B를 올려두고, Hermes 에이전트까지 연결해 둔 상태였습니다.
이제 텔레그램에서 폰으로 바로 물어보면 되겠다 — 그게 목표였어요.
그런데 Windows + Hermes + LM Studio + 텔레그램 조합은 생각보다 함정 이 많았습니다.
1. 사용한 모델과 환경
항목
내용
모델
Google Gemma 4 E4B (google/gemma-4-e4b)
실행
LM Studio (로컬 서버, http://127.0.0.1:1234)
에이전트
Hermes AI Agent
메신저
Telegram (@BotFather 봇)
PC
RTX 3070 (VRAM 8GB), RAM 32GB, Windows 11
도움
Claude (설정·트러블슈팅 대화)
처음에는 Python으로 bot.py를 직접 만들어 LM Studio에 붙이는 방법도 시도했지만, 결국 Hermes Gateway + 텔레그램 조합으로 갔습니다.
2. Python 봇 시도 — Qwen3.5 thinking 함정
처음 속이기 시도를 할때 e4b모델보다 큰 Qwen3.5-9B를 썼습니다. 텔레그램 봇은 "⏳ 생각 중..."에서 멈췄고:
telegram.error.BadRequest: Message text is emptyLM Studio 로그:
"content": ""
"reasoning_content": "Thinking Process: ..."
"finish_reason": "length"원인: Qwen3.5는 thinking 모드로 먼저 긴 사고를 하고, content는 비어 있는 채 토큰이 소진됨.
시도한 해결:
MAX_TOKENS늘리기메시지에
/no_think붙이기reasoning_content를 읽도록bot.py수정
RTX 3070 8GB + 9B 모델 + thinking 조합은 속도·안정성 모두 한계가 있어 아 우선 e4b로 속도를 끌어 올려놓고 생각해야겠다 라는 생각이 들었습니다.
3. Hermes + 텔레그램 — kyung님의 1주차 글처럼 설정하기
config.yaml을 이렇게 맞췄습니다.
3-1. Hermes에는 64K라고 말하기
model:
default: google/gemma-4-e4b
provider: lmstudio
base_url: http://127.0.0.1:1234/v1
context_length: 65536
max_tokens: 20483-2. memory 끄기 (토큰 절약)
memory:
memory_enabled: false
user_profile_enabled: false3-3. toolsets 비우기
gpters 글처럼 tool schema만 11K 토큰을 먹을 수 있어서, 플랫폼별 toolsets를 비웠습니다.
platform_toolsets:
cli: []
telegram: []
discord: []
whatsapp: []
slack: []3-4. compression 끄기 + context engine
Gemma E4B는 context window가 작아 compression 모델 요구에 걸릴 수 있습니다.
compression:
enabled: false
context:
engine: truncate # compressor → truncate3-5. agent 설정
agent:
tool_use_enforcement: none
reasoning_effort: ''핵심 원리 (kyung님 1주차 글과 동일):
"짧은 메시지"가 "짧은 요청"은 아니다.
Hermes는 system prompt + memory + tool schema + 세션 정보가 붙으면 실제 토큰이 훨씬 커진다.
4. Gateway 재시작 및 설명
설정을 다하고 나면 게이트 웨이를 재시작해야합니다. 혹시몰라 게이트웨이 관련 사용설명