|
1 |
| -# BrowserAI |
2 |
| -Bring powere of AI into browser |
| 1 | +# BrowserAI 🚀 |
| 2 | + |
| 3 | +Bring the power of AI directly into your browser! BrowserAI is a lightweight JavaScript library that enables running AI models directly in the browser using WebGPU acceleration. |
| 4 | + |
| 5 | +## ✨ Features |
| 6 | + |
| 7 | +- 🎯 Run AI models directly in the browser - no server required! |
| 8 | +- ⚡ WebGPU acceleration for blazing fast inference |
| 9 | +- 🔄 Seamless switching between MLC and Transformers engines |
| 10 | +- 📦 Pre-configured popular models ready to use |
| 11 | +- 🛠️ Easy-to-use API for text generation and more |
| 12 | + |
| 13 | +## 🚀 Quick Start |
| 14 | +``` |
| 15 | +bash |
| 16 | +npm install @browserai/browserai |
| 17 | +``` |
| 18 | + |
| 19 | +OR |
| 20 | +``` |
| 21 | +bash |
| 22 | +yarn add @browserai/browserai |
| 23 | +``` |
| 24 | + |
| 25 | +### Basic Usage |
| 26 | + |
| 27 | +```javascript |
| 28 | +import { BrowserAI } from '@browserai/browserai'; |
| 29 | + |
| 30 | +const browserAI = new BrowserAI(); |
| 31 | + |
| 32 | +browserAI.loadModel('llama-3.2-1b-instruct'); |
| 33 | + |
| 34 | +const response = await browserAI.generateText('Hello, how are you?'); |
| 35 | +console.log(response); |
| 36 | +``` |
| 37 | + |
| 38 | + |
| 39 | +## 📚 Examples |
| 40 | + |
| 41 | +### Text Generation with Custom Parameters |
| 42 | +```javascript |
| 43 | +const ai = new BrowserAI(); |
| 44 | +await ai.loadModel('llama-3.2-1b-instruct', { |
| 45 | +quantization: 'q4f16_1' // Optimize for size/speed |
| 46 | +}); |
| 47 | +const response = await ai.generateText('Write a short poem about coding', { |
| 48 | +temperature: 0.8, |
| 49 | +maxTokens: 100 |
| 50 | +}); |
| 51 | +``` |
| 52 | + |
| 53 | +## 🔧 Supported Models |
| 54 | + |
| 55 | +### MLC Models |
| 56 | +- Llama-3.2-1b-Instruct |
| 57 | +- SmolLM2-135M-Instruct |
| 58 | +- SmolLM2-350M-Instruct |
| 59 | + |
| 60 | +### Transformers Models |
| 61 | +- Llama-3.2-1b-Instruct |
| 62 | +- DistilBERT (Sentiment Analysis) |
| 63 | + |
| 64 | +## 🗺️ Enhanced Roadmap |
| 65 | + |
| 66 | +### Phase 1: Foundation |
| 67 | +- 🎯 Simplified model initialization |
| 68 | +- 📊 Basic monitoring and metrics |
| 69 | +- 🔍 Simple RAG implementation |
| 70 | +- 🛠️ Developer tools integration |
| 71 | + |
| 72 | +### Phase 2: Advanced Features |
| 73 | +- 📚 Enhanced RAG capabilities |
| 74 | + - Hybrid search |
| 75 | + - Auto-chunking |
| 76 | + - Source tracking |
| 77 | +- 📊 Advanced observability |
| 78 | + - Performance dashboards |
| 79 | + - Memory profiling |
| 80 | + - Error tracking |
| 81 | + |
| 82 | +### Phase 3: Enterprise Features |
| 83 | +- 🔐 Security features |
| 84 | +- 🌐 Distributed processing |
| 85 | +- 📈 Advanced analytics |
| 86 | +- 🤝 Multi-model orchestration |
| 87 | + |
| 88 | +## 🤝 Contributing |
| 89 | + |
| 90 | +We welcome contributions! Feel free to: |
| 91 | + |
| 92 | +1. Fork the repository |
| 93 | +2. Create your feature branch (`git checkout -b feature/amazing-feature`) |
| 94 | +3. Commit your changes (`git commit -m 'Add amazing feature'`) |
| 95 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 96 | +5. Open a Pull Request |
| 97 | + |
| 98 | +## 📄 License |
| 99 | + |
| 100 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 101 | + |
| 102 | +## 🙏 Acknowledgments |
| 103 | + |
| 104 | +- [MLC AI](https://mlc.ai/) for their incredible mode compilation library and support for webgpu runtime and xgrammar |
| 105 | +- [Hugging Face](https://huggingface.co/) for their Transformers.js library |
| 106 | +- All our contributors and supporters! |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +<p align="center">Made with ❤️ for the AI community</p> |
0 commit comments