BrowserAI: Run Local LLMs Directly in Your Browser with WebGPU
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
BrowserAI is an innovative open-source project that enables running large language models (LLMs) directly within your web browser. Leveraging WebGPU for accelerated performance, it offers a private, cost-free, and offline-capable solution for integrating AI into web applications. Developers can easily build powerful, privacy-conscious AI experiences without server-side infrastructure.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
BrowserAI is an open-source project that revolutionizes how developers integrate large language models (LLMs) into web applications. It allows you to run powerful LLMs, such as Llama, DeepSeek-Distill, and Kokoro, entirely within the user's browser. This approach ensures 100% privacy, eliminates server costs, and provides offline capabilities, making it ideal for a wide range of AI-powered web solutions. The project leverages WebGPU for near-native performance, offering a fast and efficient way to deploy AI directly on the client side.
Installation
Getting started with BrowserAI is straightforward. You can install it using npm or yarn:
npm install @browserai/browserai
OR
yarn add @browserai/browserai
Examples
Basic Usage
import { BrowserAI } from '@browserai/browserai';
const browserAI = new BrowserAI();
// Load model with progress tracking
await browserAI.loadModel('llama-3.2-1b-instruct', {
quantization: 'q4f16_1',
onProgress: (progress) => console.log('Loading:', progress.progress + '%')
});
// Generate text
const response = await browserAI.generateText('Hello, how are you?');
console.log(response.choices[0].message.content);
Chat with System Prompt
const ai = new BrowserAI();
await ai.loadModel('gemma-2b-it');
const response = await ai.generateText([
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'What is WebGPU?' }
]);
console.log(response.choices[0].message.content);
Structured Output Generation
const response = await browserAI.generateText('List 3 colors', {
json_schema: {
type: "object",
properties: {
colors: {
type: "array",
items: {
type: "object",
properties: {
name: { type: "string" },
hex: { type: "string" }
}
}
}
}
},
response_format: { type: "json_object" }
});
console.log(response.choices[0].message.content);
Why Use BrowserAI?
- 100% Private: All AI processing occurs locally in the user's browser, ensuring data privacy and security.
- Zero Server Costs: Eliminate the need for expensive server infrastructure for AI inference, reducing operational costs significantly.
- Offline Capable: Once models are downloaded, applications can function without an internet connection, enhancing accessibility and reliability.
- WebGPU Accelerated: Benefit from near-native performance thanks to WebGPU acceleration, providing a fast and responsive user experience.
- Developer Friendly: A simple SDK and API make it easy to integrate various LLMs, speech recognition, and text-to-speech capabilities into web projects.
- Production Ready: Utilizes pre-optimized popular models, ready for deployment in real-world applications.
Links
Related repositories
Similar repositories that may be relevant next.
Guaardvark: Your Self-Hosted AI Studio for Agents, Media, and Code
September 21, 2026
Guaardvark is a comprehensive, self-hosted AI studio designed for local execution of advanced AI tasks. It integrates coding agents, media generation (video, image, music, voice), and robust RAG capabilities, all running on a single GPU. This platform prioritizes privacy and user control, enabling a full AI workstation experience on your own hardware.

APort Agent Guardrails: Deterministic Pre-Action Authorization for AI Agents
September 19, 2026
APort Agent Guardrails provides deterministic pre-action authorization for AI agents, running security checks before any tool execution. This crucial mechanism prevents prompt injection from bypassing policy, ensuring robust and auditable protection for AI-driven operations.

aport-spec: The Open Agent Passport (OAP) Specification for AI Agent Trust
September 18, 2026
The aport-spec repository introduces the Open Agent Passport (OAP) specification, a critical framework for establishing trust in AI agents. It defines a lightweight, cryptographically verifiable credential, enabling real-time, pre-action authorization for AI agents across various platforms. OAP provides the essential runtime trust layer for secure and scalable agentic commerce.

Atlas: Source Control for AI Coding Agents
September 17, 2026
Atlas is an innovative source control system designed specifically for AI coding agents. It allows developers to manage multiple agents, track their changes, and query their activities in a unified environment. Built in Rust, Atlas ensures that every agent's commit is linked to its session, providing full context including prompts and tool calls.
Source repository
Open the original repository on GitHub.
35 counted GitHub visits