Skip to content

Latest commit

 

History

History
67 lines (56 loc) · 2.68 KB

File metadata and controls

67 lines (56 loc) · 2.68 KB

Chrome AI Setup

Synapse relies on Chrome's built-in AI APIs (Prompt, Rewriter, Translator) which are currently available only through origin trials and feature flags. Follow these steps to prepare your environment.

1. Install the Right Browser

  • Install Chrome Canary 137+ or the Dev channel build on the machine running Synapse.
  • Verify the browser is signed into a profile that can participate in origin trials. Managed profiles may block the required flags.

2. Request an Origin Trial Token

  1. Visit the Chrome Origin Trials dashboard.
  2. Search for “Chrome Built-in AI” and register your development origin (for local work you can use http://localhost:5173).
  3. Copy the issued token.

3. Configure Synapse

  1. Duplicate env.example to .env.
  2. Paste the token into the new file as
    VITE_CHROME_AI_ORIGIN_TRIAL_TOKEN="PASTE_TOKEN_HERE"
    
  3. Restart the dev server after saving the file so Vite re-injects the meta tag.

4. Enable Required Chrome Flags

Open chrome://flags and enable the following:

  • #optimization-guide-on-device-modelEnabled BypassPerfRequirement
  • #prompt-api-for-gemini-nanoEnabled
  • #translation-apiEnabled
  • #rewriter-apiEnabled
  • Optional (experimental, Chrome 137+):
    • #writer-api
    • #proofreader-api

Restart Chrome after toggling the flags.

5. Launch Synapse

  1. Install dependencies with npm install.
  2. Run npm run dev.
  3. Open the printed URL (default http://localhost:5173) in the flagged Chrome build.

6. Allow Model Downloads

The first run triggers an on-device model download (~2 GB). Keep Chrome open until the download completes. You can monitor progress in chrome://components under Optimization Guide On Device Model.

7. Verify Capability Detection

  • Load the Synapse home page and check the capability badges. Each badge should read Ready or Downloadable.
  • Open the Demos hub and confirm the browser compatibility banner shows your API availability.

8. Troubleshooting

  • Origin trial invalid: regenerate the token and confirm the origin matches the URL you are using.
  • APIs still unavailable: confirm the flags persisted after the restart and that corporate policies are not overriding them.
  • Model download stalls: keep Chrome in the foreground and ensure the device has sufficient disk space (3 GB free recommended).
  • Local HTTPS requirement: origin trials accept HTTP on localhost, but if you host elsewhere use HTTPS to avoid token rejection.

Once these steps pass, the workspace and demos will be able to call Chrome's built-in AI without additional configuration.