@built-in-ai

Getting Started

Introduction to using @built-in-ai packages with Vercel AI SDK v6

Package Versions for AI SDK v6

PackageVersion RangeMinimum v6 Compatible
@built-in-ai/core≥ 3.0.03.0.0
@built-in-ai/transformers-js≥ 1.0.01.0.0
@built-in-ai/web-llm≥ 1.0.01.0.0

Installation

# For Chrome/Edge Built-in AI (Prompt API)
npm i @built-in-ai/core

# For Transformers.js (Hugging Face models)
npm i @built-in-ai/transformers-js

# For WebLLM (MLC models)
npm i @built-in-ai/web-llm

Available Packages

@built-in-ai/core

Access Chrome and Edge's built-in AI capabilities through the experimental Prompt API. The provider will automatically work in all browsers that support the Prompt API since the browser handles model orchestration. For instance, if your client uses Edge, it will use Phi4-mini, and for Chrome it will use Gemini Nano.

  • Language Models: Text generation with Gemini Nano (Chrome) or Phi Mini (Edge)
  • Text Embeddings: Generate embeddings using browser-native models
  • Multimodal Support: Image and audio input
  • Structured Data: Generate structured data
  • Tool Calling: Function calling with JSON format support

View Core Documentation →

@built-in-ai/transformers-js

Run Hugging Face Transformers models directly in the browser or server-side with WebGPU/WASM acceleration:

  • Open-source Language Models: SmolLM, Qwen, Llama, and more
  • Text Embeddings: GTE, MiniLM, and other embedding models
  • Vision Models: SmolVLM and other multimodal models
  • Web Worker Support: Efficient background processing
  • Transcription: Whisper models for speech-to-text
  • Tool Calling: Function calling support

View Transformers.js Documentation →

@built-in-ai/web-llm

High-performance in-browser LLM inference using WebLLM with WebGPU. Allows using a ton of popular open-source models such as Llama3 and Qwen3:

  • Open-source Language Models: Llama, Qwen, Phi, and many more
  • Download Progress: Real-time model download tracking
  • Web Worker Support: Efficient background processing
  • Tool Calling: Function calling support

View Web-LLM Documentation →

Easy Server Fallback

One of the biggest advantages is the ability to seamlessly fall back to server-side models:

import { builtInAI, doesBrowserSupportBuiltInAI } from "@built-in-ai/core";

// Prioritize local inference, fall back to cloud when needed
const { messages, sendMessage } = useChat({
  transport: doesBrowserSupportBuiltInAI()
    ? new ClientSideChatTransport(builtInAI())
    : new DefaultChatTransport({ api: "/api/chat" }),
});

On this page