Show availability and download progress
Know whether the model is ready, needs a download, or is unavailable. Components show these states for you; typed APIs give a custom interface the same information.
Vue · React · Svelte · Angular · Nuxt · TypeScript
Add chat, summaries, writing tools, and translation to your app. Chrome runs the models locally; the kit provides components and APIs for your framework. No inference server or API key needed.
Why Browser AI Kit
A useful AI feature needs more than a response. Give users clear download progress, streamed answers, saved conversations, and a way to stop, with state and cleanup that fit your framework.
Know whether the model is ready, needs a download, or is unavailable. Components show these states for you; typed APIs give a custom interface the same information.
Show answers as they arrive and let users stop a request. Stream updates are batched to keep the interface responsive, and sessions are reused across compatible requests.
Summarize long documents in chunks, translate text in order, and restore chat context as conversations grow. Shared workflows account for the model's input limits.
Start with a complete chat or writing tool. Keep your own design with Vue composables, React hooks, Svelte stores, Angular signals, or plain TypeScript controllers.
Quick start
Install one package and add a chat component, or connect the APIs to your own interface. Component styles are a single import; Nuxt adds them automatically.
npm install @desource/browser-ai-vue
<script setup lang="ts">
import { PromptApi } from "@desource/browser-ai-vue";
import "@desource/browser-ai-vue/assets/lib.css";
</script>
<template><PromptApi /></template>npm install @desource/browser-ai-nuxt
export default defineNuxtConfig({
modules: ["@desource/browser-ai-nuxt"]
});
// app/pages/feature.vue
<template><PromptApi /></template>npm install @desource/browser-ai-react
import { PromptApi } from "@desource/browser-ai-react";
import "@desource/browser-ai-react/assets/lib.css";
export function Feature() {
return <PromptApi />;
}npm install @desource/browser-ai-angular
import { Component } from "@angular/core";
import { BrowserAiPromptApiComponent } from "@desource/browser-ai-angular";
import "@desource/browser-ai-angular/assets/lib.css";
@Component({
standalone: true,
imports: [BrowserAiPromptApiComponent],
template: `<browser-ai-prompt-api />`
})
export class FeatureComponent {}npm install @desource/browser-ai-svelte
<script lang="ts">
import { PromptApi } from "@desource/browser-ai-svelte";
import "@desource/browser-ai-svelte/assets/lib.css";
</script>
<PromptApi />npm install @desource/browser-ai
import { createPromptApi } from "@desource/browser-ai";
const button = document.createElement("button");
const output = document.createElement("pre");
button.textContent = "Run PromptApi";
document.body.append(button, output);
button.addEventListener("click", async () => {
button.disabled = true;
const api = createPromptApi();
try {
const result = await api.prompt("Reply in one sentence.");
output.textContent = typeof result === "string" ? result : JSON.stringify(result, null, 2);
} catch (error) {
output.textContent = error instanceof Error ? error.message : String(error);
} finally {
api.dispose();
button.disabled = false;
}
});Open your app in Chrome on HTTPS or localhost. The first use may need a model download. Check browser setup →
A direct native call can be enough for a small experiment. Use the kit when your app needs download progress, streaming UI, saved chats, or long-input handling.
Live in your browser
Open an example to see what your browser can do. AI demos use the local models available on your device; WebMCP lets you try application tools. Required downloads start when you choose to use a feature.
Stream private chats, return schema-constrained JSON, and keep long sessions useful.
Turn long content into summaries, key points, headlines, or teasers on-device.
Draft text in the tone, format, and length your interface needs.
Make existing text clearer, shorter, longer, or more formal without a server.
Translate supported language pairs with Chrome-managed local packs.
Rank likely languages with confidence scores and long-text merging.
Correct grammar, spelling, and punctuation with inspectable edit ranges.
Publish lifecycle-safe app tools for compatible browser agents to discover and call.
Packages
Use familiar refs, hooks, stores, or signals. All four UI frameworks include the same chat and text tools. Nuxt adds client-safe auto-imports, and the TypeScript core works without a UI framework.
Components, composables, and complete TypeScript coverage.
Package guide →Auto-imports, client components, and SSR-safe defaults.
Package guide →Hooks, external-store state, and accessible components.
Package guide →Signals, injectable services, and standalone components.
Package guide →Readable stores, controllers, and Svelte components.
Package guide →Tree-shakeable lifecycle, text, attachment, and WebMCP controllers.
Package guide →Private, on-device AI
Chrome processes AI requests locally. The kit sends no prompts, responses, or telemetry to DeSource Labs. Once the model is downloaded, inference can work offline too. Your app's WebMCP tools and any cloud services you connect have their own data flows.
Read the privacy and fallback guide →Open source · MIT
Choose your framework, add a component, and try it with a model running on your device.