# Welcome

Power up your web apps with local AI.

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

* [Prompt API](https://github.com/explainers-by-googlers/prompt-api?tab=readme-ov-file#stakeholder-feedback)
* [Writing assistance API](https://github.com/webmachinelearning/writing-assistance-apis)&#x20;
* [Translation API](https://github.com/webmachinelearning/translation-api)

These are currently being developed & trialled in [Google Chrome](https://developer.chrome.com/docs/ai/built-in), 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...

1. Using the in-browser APIs when available
2. Using the [AiBrow extension](https://docs.aibrow.ai/aibrow-extension/getting-started), which uses native llama.cpp
3. Using web APIs such as WebGPU and WASM

Each method has its own advantages and limitations as well as performance considerations to take into account ([Feature comparison](https://docs.aibrow.ai/aibrow-web-api/feature-comparison)). You can use the [AiBrow Web API](https://docs.aibrow.ai/aibrow-web-api/getting-started) to check on-device support and access each of these APIs as needed.

### Quick Start

Install the dependencies:

```bash
npm install @aibrow/web
```

You can use the languageModel API to have a conversation with the AI, using whichever backend you choose.

```javascript
import AI from '@aibrow/web'

// WebGPU
const webGpu = await AI.AIBrowWeb.LanguageModel.create()
console.log(await webGpu.prompt('Write a short poem about the weather'))

// Llama.cpp
const ext = await AI.AIBrow.LanguageModel.create()
console.log(await ext.prompt('Write a short poem about the weather'))

// Chrome AI
const browser = await AI.Browser.LanguageModel.create()
console.log(await browser.prompt('Write a short poem about the weather'))
```

😃 Take a look at the [examples to get started](https://docs.aibrow.ai/broken-reference)

📔 [Check out the API reference](https://docs.aibrow.ai/api-reference/aibrow) to see everything that AiBrow supports

👾 The AiBrow extension is on [GitHub](https://github.com/axonzeta/aibrow) if you want to contribute or chat

🧪 Try out some of the [AiBrow demos](https://aibrow.ai/demo.html)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aibrow.ai/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
