{"name":"BrowserAI: Run Local LLMs Directly in Your Browser with WebGPU","description":"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.","github":"https://github.com/sauravpanda/BrowserAI","url":"https://osrepos.com/repo/sauravpanda-browserai","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/sauravpanda-browserai","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/sauravpanda-browserai.md","json":"https://osrepos.com/repo/sauravpanda-browserai.json","topics":["ai","llm","webgpu","browser","typescript","local-inference","privacy","agents"],"keywords":["ai","llm","webgpu","browser","typescript","local-inference","privacy","agents"],"stars":null,"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.","content":"## Introduction\nBrowserAI 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.\n\n## Installation\nGetting started with BrowserAI is straightforward. You can install it using npm or yarn:\n\nbash\nnpm install @browserai/browserai\n\n\nOR\n\nbash\nyarn add @browserai/browserai\n\n\n## Examples\n\n### Basic Usage\n\njavascript\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) => 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### Chat with System Prompt\n\njavascript\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]);\nconsole.log(response.choices[0].message.content);\n\n\n### Structured Output Generation\n\njavascript\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});\nconsole.log(response.choices[0].message.content);\n\n\n## Why Use BrowserAI?\nBrowserAI offers compelling advantages for developers and businesses looking to integrate AI:\n*   **100% Private**: All AI processing occurs locally in the user's browser, ensuring data privacy and security.\n*   **Zero Server Costs**: Eliminate the need for expensive server infrastructure for AI inference, reducing operational costs significantly.\n*   **Offline Capable**: Once models are downloaded, applications can function without an internet connection, enhancing accessibility and reliability.\n*   **WebGPU Accelerated**: Benefit from near-native performance thanks to WebGPU acceleration, providing a fast and responsive user experience.\n*   **Developer Friendly**: A simple SDK and API make it easy to integrate various LLMs, speech recognition, and text-to-speech capabilities into web projects.\n*   **Production Ready**: Utilizes pre-optimized popular models, ready for deployment in real-world applications.\n\n## Links\n*   [Live Demo](https://chat.browserai.dev){:target=\"_blank\"}\n*   [Documentation](https://docs.browserai.dev){:target=\"_blank\"}\n*   [GitHub Repository](https://github.com/sauravpanda/BrowserAI){:target=\"_blank\"}","metrics":{"detailViews":11,"githubClicks":14},"dates":{"published":null,"modified":"2025-11-21T20:01:31.000Z"}}