{"id":28124352,"url":"https://github.com/sauravpanda/browserai","last_synced_at":"2026-04-18T02:21:22.764Z","repository":{"id":271789433,"uuid":"913574546","full_name":"sauravpanda/BrowserAI","owner":"sauravpanda","description":"Run local LLMs like llama, deepseek-distill, kokoro and more inside your browser","archived":false,"fork":false,"pushed_at":"2025-04-15T19:51:03.000Z","size":307308,"stargazers_count":1089,"open_issues_count":28,"forks_count":96,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-14T09:05:52.053Z","etag":null,"topics":["agents","ai","llama","llm","llm-inference","local","localllm","tts","webgpu"],"latest_commit_sha":null,"homepage":"https://browserai.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sauravpanda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-08T00:26:51.000Z","updated_at":"2025-05-13T14:22:07.000Z","dependencies_parsed_at":"2025-01-09T22:37:16.800Z","dependency_job_id":"6c24d025-2075-4bb9-a7da-275c8bba3732","html_url":"https://github.com/sauravpanda/BrowserAI","commit_stats":null,"previous_names":["sauravpanda/browserai","cloud-code-ai/browserai"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2FBrowserAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2FBrowserAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2FBrowserAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sauravpanda%2FBrowserAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sauravpanda","download_url":"https://codeload.github.com/sauravpanda/BrowserAI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","llama","llm","llm-inference","local","localllm","tts","webgpu"],"created_at":"2025-05-14T09:04:06.621Z","updated_at":"2026-04-18T02:21:22.756Z","avatar_url":"https://github.com/sauravpanda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# BrowserAI 🚀\n\n### Run Production-Ready LLMs Directly in Your Browser\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eSimple • Fast • Private • Open Source\u003c/strong\u003e\n\u003c/p\u003e\n\n[Live Demo](https://chat.browserai.dev) •\n[Documentation](https://docs.browserai.dev) •\n[Discord Community](https://discord.gg/6qfmtSUMdb)\n\n\u003cimg src=\"https://img.youtube.com/vi/BoxYT6SU7PQ/0.jpg\" alt=\"BrowserAI Demo\" width=\"600\"/\u003e\n\n\u003c/div\u003e\n\n\u003e 🎉 **Featured Project**: Check out [Browseragent.dev](https://browseragent.dev) - A no-code AI Agent builder powered by BrowserAI with unlimited executions! Build your own AI agents in minutes.\n\n## 🌟 Live Demos\n\n| Demo | Description | Try It |\n|------|-------------|--------|\n| **Chat** | Multi-model chat interface | [chat.browserai.dev](https://chat.browserai.dev) |\n| **Voice Chat** | Full-featured with speech recognition \u0026 TTS | [voice-demo.browserai.dev](https://voice-demo.browserai.dev) |\n| **Text-to-Speech** | Powered by Kokoro 82M | [tts-demo.browserai.dev](https://tts-demo.browserai.dev) |\n\n\n## ⚡ Key Features\n\n- 🔒 **100% Private**: All processing happens locally in your browser\n- 🚀 **WebGPU Accelerated**: Near-native performance\n- 💰 **Zero Server Costs**: No complex infrastructure needed\n- 🌐 **Offline Capable**: Works without internet after initial download\n- 🎯 **Developer Friendly**: Simple sdk with multiple engine support\n- 📦 **Production Ready**: Pre-optimized popular models\n\n## 🎯 Perfect For\n\n- Web developers building AI-powered applications\n- Companies needing privacy-conscious AI solutions\n- Researchers experimenting with browser-based AI\n- Hobbyists exploring AI without infrastructure overhead\n- No-code platform builders creating AI-powered tools\n\n## ✨ Features\n\n- 🎯 Run AI models directly in the browser - no server required!\n- ⚡ WebGPU acceleration for blazing fast inference\n- 🔄 Seamless switching between MLC, Transformers, Flare, and Demucs engines\n- 📦 Pre-configured popular models ready to use\n- 🛠️ Easy-to-use API for text generation and more\n- 🔧 Web Worker support for non-blocking UI performance\n- 📊 Structured output generation with JSON schemas\n- 🎙️ Speech recognition and text-to-speech capabilities\n- 🎵 Audio source separation (Demucs) - isolate vocals, drums, bass, and other stems\n- 💾 Built-in database support for storing conversations and embeddings\n\n\n## 🚀 Quick Start\n\n```bash\nnpm install @browserai/browserai\n```\n\nOR \n```bash\nyarn add @browserai/browserai\n```\n\n### Basic Usage\n\n```javascript\nimport { BrowserAI } from '@browserai/browserai';\n\nconst browserAI = new BrowserAI();\n\n// Load model with progress tracking\nawait browserAI.loadModel('llama-3.2-1b-instruct', {\n  quantization: 'q4f16_1',\n  onProgress: (progress) =\u003e console.log('Loading:', progress.progress + '%')\n});\n\n// Generate text\nconst response = await browserAI.generateText('Hello, how are you?');\nconsole.log(response.choices[0].message.content);\n```\n\n\n## 📚 Examples\n\n### Text Generation with Options\n```javascript\nconst response = await browserAI.generateText('Write a short poem about coding', {\n  temperature: 0.8,\n  max_tokens: 100,\n  system_prompt: \"You are a creative poet specialized in technology themes.\"\n});\n```\n\n### Chat with System Prompt\n```javascript\nconst ai = new BrowserAI();\nawait ai.loadModel('gemma-2b-it');\n\nconst response = await ai.generateText([\n  { role: 'system', content: 'You are a helpful assistant.' },\n  { role: 'user', content: 'What is WebGPU?' }\n]);\n```\n\n### Chat with System Prompt\n\n```javascript\nconst response = await browserAI.generateText('List 3 colors', {\n  json_schema: {\n    type: \"object\",\n    properties: {\n      colors: {\n        type: \"array\",\n        items: {\n          type: \"object\",\n          properties: {\n            name: { type: \"string\" },\n            hex: { type: \"string\" }\n          }\n        }\n      }\n    }\n  },\n  response_format: { type: \"json_object\" }\n});\n```\n\n### Speech Recognition\n```javascript\nconst browserAI = new BrowserAI();\nawait browserAI.loadModel('whisper-tiny-en');\n\n// Using the built-in recorder\nawait browserAI.startRecording();\nconst audioBlob = await browserAI.stopRecording();\nconst transcription = await browserAI.transcribeAudio(audioBlob, {\n  return_timestamps: true,\n  language: 'en'\n});\n```\n\n### Text-to-Speech\n```javascript\nconst ai = new BrowserAI();\nawait ai.loadModel('kokoro-tts');\nconst audioBuffer = await browserAI.textToSpeech('Hello, how are you today?', {\n  voice: 'af_bella',\n  speed: 1.0\n});// Play the audio using Web Audio API\nconst audioContext = new AudioContext();\nconst source = audioContext.createBufferSource();\naudioContext.decodeAudioData(audioBuffer, (buffer) =\u003e {\n  source.buffer = buffer;\n  source.connect(audioContext.destination);\n  source.start(0);\n});\n```\n\n### Audio Source Separation (Demucs)\n```javascript\nimport { DemucsEngine } from '@browserai/browserai/demucs';\n\nconst engine = new DemucsEngine();\nawait engine.loadModel({ /* htdemucs config */ });\n\n// Separate an AudioBuffer into stems\nconst result = await engine.separate(audioBuffer, {\n  shifts: 1,        // Time-shift augmentation passes (higher = better quality, slower)\n  overlap: 0.25,    // Segment overlap ratio\n});\n\n// result.sources contains: drums, bass, other, vocals (each as AudioBuffer)\nconst vocals = result.sources['vocals'];\n```\n\n### Flare Engine (GGUF Models via WASM)\n```javascript\nconst ai = new BrowserAI();\n\n// Load a GGUF model via the Flare engine\nawait ai.loadModel('llama-3.2-1b-flare');\n\n// Generate text — same API as MLC/Transformers\nconst response = await ai.generateText('Explain quantum computing briefly');\n\n// Optional: Load a LoRA adapter\nawait ai.loadAdapter({ url: 'https://example.com/adapter.safetensors' });\n```\n\n## 🔧 Supported Models\n\nMore models will be added soon. Request a model by creating an issue.\n\n### MLC Models\n- Llama-3.2-1b-Instruct\n- Llama-3.2-3b-Instruct\n- Hermes-Llama-3.2-3b\n- SmolLM2-135M-Instruct\n- SmolLM2-360M-Instruct\n- SmolLM2-1.7B-Instruct\n- Qwen-0.5B-Instruct\n- Gemma-2B-IT\n- TinyLlama-1.1B-Chat-v0.4\n- Phi-3.5-mini-instruct\n- Qwen3-0.6B\n- Qwen3-1.7B\n- Qwen3-4B\n- Qwen3-8B\n- Qwen2.5-1.5B-Instruct\n- DeepSeek-R1-Distill-Qwen-7B\n- DeepSeek-R1-Distill-Llama-8B\n- Snowflake-Arctic-Embed-M-B32\n- Snowflake-Arctic-Embed-S-B32\n- Snowflake-Arctic-Embed-M-B4\n- Snowflake-Arctic-Embed-S-B4\n\n### Transformers Models\n- Llama-3.2-1b-Instruct\n- Whisper-tiny-en (Speech Recognition)\n- Whisper-base-all (Speech Recognition)\n- Whisper-small-all (Speech Recognition)\n- Kokoro-TTS (Text-to-Speech)\n\n### Flare Models (GGUF via WASM)\n- SmolLM2-135M-Instruct (Q8_0, Q4_K_M)\n- SmolLM2-360M-Instruct (Q8_0)\n- Qwen2.5-0.5B-Instruct (Q4_K_M)\n- Llama-3.2-1B-Instruct (Q8_0, Q4_K_M)\n\n### Demucs Models (Audio Source Separation)\n- HTDemucs (4-stem: drums, bass, other, vocals)\n\n## 🗺️ Enhanced Roadmap\n\n### Phase 1: Foundation\n- 🎯 Simplified model initialization\n- 📊 Basic monitoring and metrics\n- 🔍 Simple RAG implementation\n- 🛠️ Developer tools integration\n\n### Phase 2: Advanced Features\n- 📚 Enhanced RAG capabilities\n  - Hybrid search\n  - Auto-chunking\n  - Source tracking\n- 📊 Advanced observability\n  - Performance dashboards\n  - Memory profiling\n  - Error tracking\n\n### Phase 3: Enterprise Features\n- 🔐 Security features\n- 📈 Advanced analytics\n- 🤝 Multi-model orchestration\n\n## 🤝 Contributing\n\nWe welcome contributions! Feel free to:\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- [MLC AI](https://github.com/mlc-ai/mlc-llm) for their incredible mode compilation library and support for webgpu runtime and xgrammar\n- [Hugging Face](https://huggingface.co/) and [Xenova](https://github.com/xenova) for their Transformers.js library, licensed under Apache License 2.0. The original code has been modified to work in a browser environment and converted to TypeScript.\n- [Facebook Research](https://github.com/facebookresearch/demucs) for Demucs, the state-of-the-art music source separation model.\n- [Aspect](https://github.com/aspect-build/flare) for the Flare WASM inference engine enabling GGUF model support in the browser.\n- All our contributors and supporters!\n\n---\n\n\u003cp align=\"center\"\u003eMade with ❤️ for the AI community\u003c/p\u003e\n\n## 🚀 Requirements\n\n- Modern browser with WebGPU support (Chrome 113+, Edge 113+, or equivalent)\n- For models with `shader-f16` requirement, hardware must support 16-bit floating point operations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauravpanda%2Fbrowserai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsauravpanda%2Fbrowserai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauravpanda%2Fbrowserai/lists"}