- model_adapter: measure_inference_latency() (max_tokens=1, 최소 부하)
- backend_registry:
- health latency baseline 학습 (초기 5회 max, 이후 EMA)
- get_load_status(): inference 우선, health/queue 보조
- cache 30s + cooldown 10s + asyncio.Lock으로 자기증폭 루프 방지
- 조건: health > baseline*3 또는 사용자 명시 요청 시에만 ping
- worker:
- "system_status" 액션 — 사용자 상태 조회 시 force_measure
- _build_system_status() 응답 빌더 (health/baseline/ping/queue)
- route busy 안내를 get_load_status 기반으로 변경
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
응답이 중간에 끊기는 문제 해결. ModelAdapter에 max_tokens
파라미터 추가, stream/complete 양쪽 payload에 반영.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- EXAONE: 분류기+프롬프트엔지니어+직접응답 (JSON 출력)
- 간단한 질문은 EXAONE이 직접 답변 (파이프라인 스킵)
- 복잡한 질문은 AI 최적화 프롬프트로 Gemma에 전달
- 모호한 질문은 사용자에게 추가 질문 (clarify)
- user별 최근 대화 기억 (최대 10개, 1시간 TTL)
- ModelAdapter: messages 직접 전달 옵션 추가
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ModelAdapter: 범용 OpenAI-compat 어댑터 (stream/complete/health)
- BackendRegistry: rewriter(EXAONE) + reasoner(Gemma4) 헬스체크 루프
- 2단계 파이프라인: EXAONE rewrite → Gemma reasoning (SSE rewrite 이벤트 노출)
- Fallback: 맥미니 다운 시 EXAONE 단독 모드, stream 중간 실패 시 자동 전환
- Cancel-safe: rewrite 전/후, streaming loop 내, fallback 경로 모두 체크
- Rewrite heartbeat: complete_chat 대기 중 2초 간격 processing 이벤트
- JobQueue: Semaphore(3) 기반 동시성 제한, 정확한 queue position
- GET /chat/{job_id}/status, GET /queue/stats 엔드포인트
- DB: rewrite_model, reasoning_model, rewritten_message 컬럼 추가
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>