Meet AiBrow, which enables on-device AI in your browser. Private, Fast and Free. It's Open Source and supports Llama, Gemini, Phi and many other models.
The AiBrow API follows the current proposals for the browser machine learning APIs, namely the
These are currently being developed & trialled in Google Chrome, but AiBrow extends this base feature set with new capabilities. This means you can use AI in the browser using a number of different implementations...
Each method has its own advantages and limitations as well as performance considerations to take into account (Feature comparison). You can use the AiBrow Web API to check on-device support and access each of these APIs as needed.
Quick Start
Install the dependencies:
npminstall@aibrow/web
You can use the languageModel API to have a conversation with the AI, using whichever backend you choose.
import AI from'@aibrow/web'// WebGPUconstwebGpu=awaitAI.AIBrowWeb.LanguageModel.create()console.log(awaitwebGpu.prompt('Write a short poem about the weather'))// Llama.cppconstext=awaitAI.AIBrow.LanguageModel.create()console.log(awaitext.prompt('Write a short poem about the weather'))// Chrome AIconstbrowser=awaitAI.Browser.LanguageModel.create()console.log(awaitbrowser.prompt('Write a short poem about the weather'))