Skip to content

Files

Failed to load latest commit information.

Latest commit

 Cannot retrieve latest commit at this time.

History

History

product-review-suggestions

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Product review suggestions

Why this demo

Online stores can see a 270% increase in conversions by showing product reviews (Source). Negative reviews are key, as they build credibility: 82% of online shoppers look for them before buying (Source).

Writing a helpful product review, especially a negative one, can be tricky. In this demo, we use Gen AI (an LLM) to help users write informative reviews that will aid others' purchasing decisions.

Quickstart

  • Install: npm i
  • Run: npm start

Browser support and prerequisites

Because the MediaPipe LLM Inference API relies on WebGPU, this demo runs in all browsers that support WebGPU. As of August 2024:

  • Chrome
  • Edge
  • Firefox Nightly ⚠️ Turn on the flag dom.webgpu.workers.enabled in about:config
  • Safari Technology Preview

Implementation details

This demo uses client-side AI (in-browser).

  • This demo uses the Gemma 2B model, with the MediaPipe LLM Inference API (see npm package).
  • This demo uses a worker to free up the main thread. It also includes an implementation of message passing between the worker and the main thread, to display model readiness status updates to the user.

Sources

Basic worker code is taken from MDN.