Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexcheng1982/chromeai
Chrome AI Test Page
https://github.com/alexcheng1982/chromeai
ai chrome chrome-ai
Last synced: about 2 months ago
JSON representation
Chrome AI Test Page
- Host: GitHub
- URL: https://github.com/alexcheng1982/chromeai
- Owner: alexcheng1982
- License: mit
- Created: 2024-07-17T06:01:32.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T09:40:02.000Z (5 months ago)
- Last Synced: 2024-10-14T06:42:20.197Z (3 months ago)
- Topics: ai, chrome, chrome-ai
- Language: TypeScript
- Homepage: https://alexcheng1982.github.io/chromeai/
- Size: 734 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chrome AI Test Page
> This project was inspired by [lightning-joyce/chromeai](https://github.com/lightning-joyce/chromeai/).
**Visit the page [alexcheng1982.github.io/chromeai/](https://alexcheng1982.github.io/chromeai/)**.
View screenshot
![Screenshot](./image/screenshot.png)
## Implementation
`promptStreaming` is used for streaming output. During testing, I found out that `prompt` often gave incomplete results.
## Use Chrome AI
### Prerequisites
Latest version of Google Chrome (127+) or any compatible Chromium-based browser.
Tested Chrome versions:
- `129.0.6640.0`
### Set Up Built-in Gemini Nano in Chrome
1. **Install Chrome Canary**: Ensure you have version 129. [Download Chrome Canary](https://google.com/chrome/canary/).
2. **Enable Prompt API**: Open `chrome://flags/#prompt-api-for-gemini-nano`, set it to "Enabled".
3. **Enable Optimization Guide**: Open `chrome://flags/#optimization-guide-on-device-model`, set it to "Enabled BypassPerfRequirement". Restart the browser.
4. **Download Model**: Go to `chrome://components/`, find **Optimization Guide On Device Model**, ensure it’s fully downloaded. If the version is "0.0.0.0", click "Check for update".
5. **Verify Setup**: Open a webpage, press F12, and check `window.ai` in the console.**Test Code**:
```javascript
const model = await window.ai.createTextSession();
await model.prompt("Who are you?");
```View flags
![Chrome flags](./image/chrome-flags.png)
## Known issues
1. When message history is enabled, the model may not function properly.