Structural subset of WebLLM's engine API, including worker engines. The application creates, loads, and eventually unloads the engine.
API
interface WebLlmEngine<TUserContent = string> {chat: {
completions: {
create(request: WebLlmRequest<TUserContent>): Promise<AsyncIterable<WebLlmChunk>> | AsyncIterable<WebLlmChunk>;
};
};interruptGenerate(): void;}WebLlmEngine
@typeTUserContentchat
{
completions: {
create(request: WebLlmRequest<TUserContent>): Promise<AsyncIterable<WebLlmChunk>> | AsyncIterable<WebLlmChunk>;
};
}