DOCS/journey/troubleshooting/250803_LLM_서비스_연결_문제_해결.md
Claude-51124 22557e7132 docs: 오래된 트러블슈팅 아카이브 및 구조 정리
- 7-8월 초기 구축 문서 12개를 _archive/troubleshooting/2025_07-08_initial_setup/로 이동
- book/300_architecture/390_human_in_the_loop_intent_learning.md를 journey/research/intent_classification/로 이동 (개발 여정 문서)
- 빈 폴더 제거 (journey/assets/*)
2025-11-17 14:06:05 +09:00

1.7 KiB

LLM 서비스 연결 문제 해결

문제 상황들

1. LLM 서비스 응답 속도 문제

  • 증상: "넌 누구니" 같은 간단한 질문에도 타임아웃 발생
  • 원인: Gemini CLI 모드 사용으로 인한 subprocess 오버헤드

2. 422 Unprocessable Entity 에러

  • 증상 1: 멘션이 포함된 메시지에서 에러 발생
  • 증상 2: execution_plan 필드가 포함되어 에러 발생
  • 원인: LLM 서비스가 예상하지 않은 필드 전달

3. 일반 대화 실패

  • 증상: "죄송합니다. 현재 해당 기능을 사용할 수 없습니다." 메시지 반환
  • 원인: LLM 서비스 호출 실패 시 폴백 메시지

해결 방법

1. Gemini API 모드로 전환 (권장)

# /home/heejae/robeing-llm-service/.env
GEMINI_USE_CLI=false  # true -> false 변경

2. LLM 서비스 payload 최적화

# /home/heejae/rb10408_test/app/router/router.py
if skill_type_enum != SkillType.LLM:
    payload["action"] = skill.get("action")
    payload["execution_plan"] = execution_plan

LLM 서비스에는 필수 필드만 전송:

  • message
  • user_id
  • channel
  • robeing_id

3. 서비스 상태 확인

# LLM 서비스 실행 확인
ps aux | grep -E "(llm|8003)"

# 헬스체크
curl http://localhost:8003/health

기술적 세부사항

  • LLM 서비스 위치: /home/heejae/robeing-llm-service/
  • 포트: 8003
  • 기본 모델: gemini-flash
  • CLI 타임아웃: 15초 (느린 원인)

관련 파일

  • /home/heejae/robeing-llm-service/app/llm/gemini_handler.py
  • /home/heejae/robeing-llm-service/app/core/config.py
  • /home/heejae/rb10408_test/app/router/router.py