Playing with Chrome Built-in AI using Vercel AI SDK
Google's official documentation on Chrome Built-in AI and Vercel AI SDK is extensive, but upon completion, you'll find that the official example only teaches you how to print out "Hello World," and many pitfalls are left unaddressed. What if the model hasn't finished downloading? What if the browser doesn't support it? How can you safely connect the Tool Calling interface? Here are some notes on the pitfalls encountered on Chrome, aiming to help you add local LLM to the frontend with fewer detours (although the detours you remember are likely to be longer). The official examples provided by Google include two basic tutorials, both clearly written in Traditional Chinese: 1. Using Prompt API with Vercel AI SDK 2. Building UI with AI Elements (including a demo) After reading through these, you'll understand that you can use `browserAI()` to pass the model into `generateText`, `streamText`, and `Output.object`, which takes around 30...
Google's Chrome Built-in AI and Vercel AI SDK have limitations not clearly explained in official documentation. A developer has shared notes on using the technology, including handling model downloads and browser compatibility issues. The @browser-ai/core library is a key provider for Chrome Built-in AI, supporting multiple local engines and AI SDK versions.
Example projects, such as next-hybrid and domainstack.io, demonstrate how to integrate the technology into frontend applications, including tool calling and local model switching. The ecosystem is still in its early stages, but developers can use these resources to get started with integrating local AI into their projects.
Written by urgent.news from Dev.to's report — not a translation of it. Machine-written — may contain errors; check the original before relying on it.