[fix] ontology: 임베딩 모델을 볼륨에 남김 — transformers.js 4.x 가 TRANSFORMERS_CACHE 를 무시

컨테이너를 새로 만들 때마다 모델 465MB 를 다시 받았다(실측 2분 49초). 그 사이 첫 발행은
publish 60초 상한을 넘겨 키워드 없이 나간다. 4.x 는 이 변수를 읽지 않고 node_modules 아래에
받아서 ontology-model 볼륨(/app/.cache)이 비어 있었다.

- config/env: embedding.cacheDir ← TRANSFORMERS_CACHE
- local.provider: transformers.js env.cacheDir 로 넘김

tsc 통과. 로컬 compose: 재생성 후 /app/.cache 465M, 다시 재생성하면 모델 로딩 1.7초

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
HyeongBaeYangandClaude Opus 5.5 committed 2026-10-01 15:05:16 +09:00
1 parent f32edfeaa1
commit 3538e2dbc9
3 files changed
+7 -1

No files matched your search

+2
View File
@@ -18,6 +18,8 @@ export const env = {
embedding: {
provider: (process.env.EMBEDDING_PROVIDER ?? 'local') as 'mock' | 'local' | 'openai',
localModel: process.env.EMBEDDING_LOCAL_MODEL ?? 'Xenova/multilingual-e5-small',
// transformers.js 4.x 는 이 변수를 읽지 않아 node_modules 에 받는다 — 볼륨에 남기려면 직접 넘긴다.
cacheDir: process.env.TRANSFORMERS_CACHE || null,
},
dedup: {
cosineThreshold: num(process.env.DEDUP_COSINE_THRESHOLD, 0.99),