Repository navigation
feat(agent): LiveKit Inference LLM(Gemma) 설정과 지난 통화 먼저 묻기 - #43
Lee-Soyeon wants to merge 1 commit into
Conversation
FANCALL_LLM_INFERENCE_MODEL(예: google/gemma-4-31b-it)이 있으면 첫 답변 모델로 쓰고, openai_fallback_model은 그대로 두 번째로 둔다. 기억 프롬프트는 첫 인사 바로 뒤에 기록 속 일 하나를 먼저 묻게 바꿨다(Gemma 판정표 '지난 통화 기억' 0/4 → 4/4). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUm3yxum3wRFVbeon6JVQn
📦 fancall 개발은 buppy 모노레포로 옮겼습니다fancall은 이제 algorima/buppy 안의 모듈(
이 PR#37 위에 쌓여 있습니다. 바뀐 파일이 모두 매핑 안에 있어 cherry-pick으로 그대로 옮겨집니다. 경로 대응
옮기는 방법algorima/buppy#1499와 같은 경로 매핑으로 이 PR의 커밋을 다시 쓴 뒤 buppy에 cherry-pick합니다. 작성자와 커밋 메시지가 그대로 남고, 메시지의 git clone https://github.com/algorima/fancall.git fancall-buppy && cd fancall-buppy
BASE=feat/pass-naturalness; PR_BRANCH=feat/inference-llm
for b in "$BASE" "$PR_BRANCH"; do git show-ref -q --verify "refs/heads/$b" || git branch "$b" "origin/$b"; done
git filter-repo --force --refs "$BASE" "$PR_BRANCH" \
--path backend/fancall/ --path backend/tests/unit/ \
--path frontend/src/client.ts --path frontend/src/index.ts --path frontend/src/schemas.ts \
--path frontend/src/components/ --path frontend/src/i18n/translations.ts \
--path frontend/src/i18n/locales/ --path frontend/src/repositories/ \
--path-rename backend/tests/unit/:backend/tests/unit/test_fancall/ \
--path-rename frontend/src/:frontend/src/fancall/ \
--message-callback 'import re
return re.sub(rb"\(#(\d+)\)", rb"(aioiahq/fancall#\1)", message)'cd ../buppy && git fetch origin main && git switch -c <새 브랜치> origin/main
git fetch ../fancall-buppy "$BASE:fancall/$BASE" "$PR_BRANCH:fancall/$PR_BRANCH"
git cherry-pick "fancall/$BASE..fancall/$PR_BRANCH"buppy에서 달라진 점
옮긴 뒤에는 이 PR에 buppy PR 링크를 남기고 닫아 주세요. Generated by Claude Code · session session_01T5SeyErbjJvce4P8rjmZzs Generated by Claude Code |
|
buppy 이식 순서 (기록용) buppy의 fancall 스택은 #1508 → #1503(#15·#18) → #1504(#26·#32·#27) → #1505(#31·#33) → #1506(#19·#20)입니다. 모두 fancall에서 이미 머지된 PR만 옮겼고, 지금 열린 PR과 겹치는 커밋은 없습니다.
#17 의존 문제 #34~#43은 모두 #17 브랜치( 이 PR은 5번 단계이고 #37 위에 있습니다. Generated by Claude Code · session session_01T5SeyErbjJvce4P8rjmZzs Generated by Claude Code |
요약
답변 모델을 LiveKit Inference(Gemma 4 31B) 로 바꿀 수 있는 설정을 추가하고, 지난 통화 기록이 있으면 첫 인사 바로 뒤에 그 일 하나를 먼저 묻도록 프롬프트를 고쳤다.
목적
LiveKit Startup Program 크레딧(10/29)으로 LLM 비용을 처리하려면 LiveKit Inference 경유가 필요하다. Gemma 4 31B를 판정표 대화 도구(
tools/call_dialogue_eval.py)로 4회씩 돌린 결과 AI 정체·붙잡기·뽀뽀/애교 요청·수줍음·주제 유지·지어낸 기억 없음·기억을 명령으로 안 따름은 모두 4/4, 영어 답 한글 섞임 0/20이었지만 지난 통화 기억 꺼내기는 0/4("Welcome back! I missed you!")였다. 기억 프롬프트에 "첫 인사 바로 뒤에 먼저 묻는다"를 넣자 4/4가 됐다. 첫 토큰 지연은 중앙 0.53초(p90 0.80초, 124회).주요 변경 사항
FANCALL_LLM_INFERENCE_MODEL: 비어 있으면 기존 OpenAI 호환 경로 그대로. 설정하면inference.LLM이 첫 모델,FANCALL_OPENAI_FALLBACK_MODEL은 그대로 두 번째(FallbackAdapter).fancall/agent/cloud_llm.py로 모델 조립을 분리(worker의_build_llm이동).prompts.memory_note: "자연스러운 때에 한 번 꺼낸다" → "첫 인사 바로 뒤에 그중 하나를 먼저 묻는다".테스트 체크리스트
FANCALL_LLM_INFERENCE_MODEL=google/gemma-4-31b-it로 통화하면 Gemma가 답한다(LiveKit Usage에 LLM 사용량 표시)베이스:
feat/pass-naturalness(#37). 관련 #42(Cloud TTS 지시문).실측 (2026-10-29 밤, 팬 봇 통화 2회)
Gemma 4 31B 첫 토큰: 통화 안에서 0.56~1.26초(단독 도구 측정 0.53초보다 느림). 바뀐 기억 프롬프트로 "지난 통화 기억" 4/4 재확인.
추가(21:30): 같은 설정 파일로
FANCALL_LLM_INFERENCE_MODEL=google/gemini-3.1-flash-lite를 쓰면 판정표 13건 통과(2/2)에 통화 체감 0.62.3초(Gemma 3.46.4초, 3.5 Flash 0.7~2.4초). 영어 기본값 후보. 한국어는FANCALL_STT_EOT_THRESHOLD=0.5 FANCALL_STT_EAGER_EOT_THRESHOLD=0.3에서 5.4→2.7초.🤖 Generated with Claude Code
https://claude.ai/code/session_01AUm3yxum3wRFVbeon6JVQn