Vercel AI provider for Chrome's built-in Gemini Nano model
Top 84.8% on sourcepulse
This library provides a Vercel AI SDK provider for Chrome's built-in Gemini Nano model, enabling developers to integrate on-device AI capabilities into their applications. It targets developers building Chrome extensions or web applications that can leverage local LLM processing for enhanced privacy and offline functionality.
How It Works
The chrome-ai
package acts as an adapter, abstracting the underlying Gemini Nano model accessible via Chrome's experimental APIs. It integrates seamlessly with the Vercel AI SDK, allowing developers to use familiar functions like generateText
, streamText
, embedMany
, generateObject
, and streamObject
with the local model. This approach simplifies the integration of on-device AI, offering a consistent interface regardless of the backend LLM.
Quick Start & Requirements
npm install chrome-ai
chrome://flags/#prompt-api-for-gemini-nano
and chrome://flags/#optimization-guide-on-device-model
.chrome://components/
.Highlighted Details
generateObject
, streamObject
) with Zod schemas.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
This library is under active development, with potential for errors and breaking changes. Chrome's Gemini Nano integration is experimental and subject to change. Tool/function calling is not yet supported, with efforts focused on prompt engineering solutions.
10 months ago
1 day