@browser-ai/web-llm

Installation

Setup @browser-ai/web-llm for AI SDK v7

Package Installation

npm i @browser-ai/web-llm

Version Compatibility

@browser-ai/web-llmAI SDKNotes
v3.0.0 and abovev7.xCurrent stable for AI SDK v7
v2.xv6.xUse for AI SDK v6
v1.0.0 and belowv5.xUse for AI SDK v5

For AI SDK v6, please refer to the v6 documentation, and for AI SDK v5 the v5 documentation.

Verifying Installation

After installation, you can verify browser support:

import { doesBrowserSupportWebLLM } from "@browser-ai/web-llm";

if (doesBrowserSupportWebLLM()) {
  console.log("Browser supports WebLLM!");
} else {
  console.log("WebLLM not available, use server fallback");
}

On this page