feat: AI 서비스 MLX 듀얼 백엔드 및 모델 최적화

- MLX(맥미니 27B) 우선 → Ollama(조립컴 9B) fallback 구조
- pydantic-settings 기반 config 전환
- health check에 MLX 상태 추가
- 텍스트 모델 qwen3:8b → qwen3.5:9b-q8_0 변경

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-06 23:17:50 +09:00
parent cad662473b
commit 2f7e083db0
14 changed files with 231 additions and 140 deletions

View File

@@ -1,4 +1,4 @@
from fastapi import APIRouter, BackgroundTasks, Query
from fastapi import APIRouter, BackgroundTasks, HTTPException, Query
from pydantic import BaseModel
from services.embedding_service import (
sync_all_issues,
@@ -53,7 +53,7 @@ async def get_similar(issue_id: int, n_results: int = Query(default=5, le=20)):
results = await search_similar_by_id(issue_id, n_results)
return {"available": True, "results": results, "query_issue_id": issue_id}
except Exception as e:
return {"available": False, "results": [], "error": str(e)}
raise HTTPException(status_code=500, detail="AI 서비스 처리 중 오류가 발생했습니다")
@router.post("/similar/search")
@@ -69,7 +69,7 @@ async def search_similar(req: SearchRequest):
)
return {"available": True, "results": results}
except Exception as e:
return {"available": False, "results": [], "error": str(e)}
raise HTTPException(status_code=500, detail="AI 서비스 처리 중 오류가 발생했습니다")
@router.get("/embeddings/stats")