mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-25 20:34:37 +02:00
fix(local-llm): wrap @mlc-ai/web-llm in dynamic import for Docker builds
Move hasModelInCache to local-llm package with dynamic import wrapper so the browser-only dependency doesn't break server-side builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d574dda6a4
commit
919cb4bf35
3 changed files with 17 additions and 1 deletions
|
|
@ -10,6 +10,7 @@
|
|||
MODELS,
|
||||
type ModelKey,
|
||||
} from '@manacore/local-llm';
|
||||
import { hasModelInCache } from '@manacore/local-llm';
|
||||
import { marked } from 'marked';
|
||||
import { Robot, Trash, PaperPlaneRight, ClockCounterClockwise } from '@manacore/shared-icons';
|
||||
|
||||
|
|
@ -29,7 +30,6 @@
|
|||
if (typeof caches === 'undefined') return;
|
||||
for (const [key, config] of Object.entries(MODELS)) {
|
||||
try {
|
||||
const { hasModelInCache } = await import('@mlc-ai/web-llm');
|
||||
modelCacheStatus[key] = await hasModelInCache(config.modelId);
|
||||
} catch {
|
||||
modelCacheStatus[key] = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue