BrowserAI

BrowserAI

Run LLMs in your browser

Stars: 69

Visit
 screenshot

BrowserAI is a tool that allows users to run large language models (LLMs) directly in the browser, providing a simple, fast, and open-source solution. It prioritizes privacy by processing data locally, is cost-effective with no server costs, works offline after initial download, and offers WebGPU acceleration for high performance. It is developer-friendly with a simple API, supports multiple engines, and comes with pre-configured models for easy use. Ideal for web developers, companies needing privacy-conscious AI solutions, researchers experimenting with browser-based AI, and hobbyists exploring AI without infrastructure overhead.

README:

BrowserAI πŸš€

BrowserAI: Run LLMs in the Browser - Simple, Fast, and Open Source!

πŸŽ₯ Demo

BrowserAI Demo

Why BrowserAI?

  • πŸ”’ Privacy First: All processing happens locally - your data never leaves the browser
  • πŸ’° Cost Effective: No server costs or complex infrastructure needed
  • 🌐 Offline Capable: Models work offline after initial download
  • πŸš€ Blazing Fast: WebGPU acceleration for near-native performance
  • 🎯 Developer Friendly: Simple API, multiple engine support, ready-to-use models

🎯 Perfect For

  • Web developers building AI-powered applications
  • Companies needing privacy-conscious AI solutions
  • Researchers experimenting with browser-based AI
  • Hobbyists exploring AI without infrastructure overhead

✨ Features

  • 🎯 Run AI models directly in the browser - no server required!
  • ⚑ WebGPU acceleration for blazing fast inference
  • πŸ”„ Seamless switching between MLC and Transformers engines
  • πŸ“¦ Pre-configured popular models ready to use
  • πŸ› οΈ Easy-to-use API for text generation and more

πŸš€ Quick Start

bash
npm install @browserai/browserai

OR

bash
yarn add @browserai/browserai

Basic Usage

import { BrowserAI } from '@browserai/browserai';

const browserAI = new BrowserAI();

browserAI.loadModel('llama-3.2-1b-instruct');

const response = await browserAI.generateText('Hello, how are you?');
console.log(response);

πŸ“š Examples

Text Generation with Custom Parameters

const ai = new BrowserAI();
await ai.loadModel('llama-3.2-1b-instruct', {
quantization: 'q4f16_1' // Optimize for size/speed
});
const response = await ai.generateText('Write a short poem about coding', {
temperature: 0.8,
maxTokens: 100
});

Speech Recognition

const ai = new BrowserAI();
await ai.loadModel('whisper-tiny-en');
const audioBlob = await ai.stopRecording();
const transcription = await ai.transcribeAudio(audioBlob);

Text-to-Speech

const ai = new BrowserAI();
const audioBuffer = await ai.textToSpeech('Hello, how are you today?');
// Play the audio...

πŸ”§ Supported Models

More models will be added soon. Request a model by creating an issue.

MLC Models

  • Llama-3.2-1b-Instruct
  • SmolLM2-135M-Instruct
  • SmolLM2-350M-Instruct

Transformers Models

  • Llama-3.2-1b-Instruct
  • Whisper-tiny-en (Speech Recognition)
  • SpeechT5-TTS (Text-to-Speech)

πŸ—ΊοΈ Enhanced Roadmap

Phase 1: Foundation

  • 🎯 Simplified model initialization
  • πŸ“Š Basic monitoring and metrics
  • πŸ” Simple RAG implementation
  • πŸ› οΈ Developer tools integration

Phase 2: Advanced Features

  • πŸ“š Enhanced RAG capabilities
    • Hybrid search
    • Auto-chunking
    • Source tracking
  • πŸ“Š Advanced observability
    • Performance dashboards
    • Memory profiling
    • Error tracking

Phase 3: Enterprise Features

  • πŸ” Security features
  • πŸ“ˆ Advanced analytics
  • 🀝 Multi-model orchestration

🀝 Contributing

We welcome contributions! Feel free to:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • MLC AI for their incredible mode compilation library and support for webgpu runtime and xgrammar
  • Hugging Face for their Transformers.js library
  • All our contributors and supporters!

Made with ❀️ for the AI community

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for BrowserAI

Similar Open Source Tools

For similar tasks

For similar jobs