sirius/js/ai-worker.js

8 lines
385 B
JavaScript
Raw Permalink Normal View History

// Web Worker for the in-browser assistant: runs the WebLLM engine off the UI
// thread. Weights and the model library are fetched by WebLLM itself and
// cached by the browser; nothing is sent anywhere.
import { WebWorkerMLCEngineHandler } from "../vendor/web-llm/index.js?v=0.2.85";
const handler = new WebWorkerMLCEngineHandler();
self.onmessage = (msg) => handler.onmessage(msg);