A modern, privacy-focused take on the classic "Guess Who?" board game, where you challenge a powerful AI that runs entirely in your browser. This project showcases the capabilities of the experimental on-device Generative AI API.
Play the game at: https://brechtdr.github.io/ai-guess-who/
This isn't your average web game. "AI Guess Who?" brings the classic deductive reasoning game to life with a unique twist: your opponent is a Gemini Nano AI model that lives on your device.
Key Features:
- On-Device AI: All AI processing happens locally in your browser. No data is ever sent to a server, ensuring 100% privacy.
- Offline Play: Once the AI model is downloaded, the game is fully playable without an internet connection.
- Custom Games: Use your device's camera to create your own set of characters and challenge the AI with familiar faces. Your custom sets are saved in the browser for easy reuse.
- Voice Input: Ask your questions hands-free using your microphone, powered by the AI's multi-modal capabilities.
- Strategic AI Opponent: The AI doesn't just answer questions; it analyzes the board to ask strategically sound questions designed to eliminate the most characters at once.
Read more in this blog post.
Because this project uses experimental web technology, a specific browser and configuration are required to run it.
- Browser: You must use a browser that supports the on-device
LanguageModelAPI, such as Google Chrome (you may notice better performance using Chrome Canary with the latest improvements). - The hosted version uses an origin trial token to enable the necessary features, but for running it locally you will need to Enable Feature Flags: Open your Chrome browser and enable the following two flags by copying and pasting the URLs into your address bar, setting them to "Enabled", and restarting the browser.
chrome://flags/#prompt-api-for-gemini-nano(enabled)chrome://flags/#optimization-guide-on-device-model(place in bypass)chrome://flags/#enable-experimental-web-platform-features(enabled)
The first time you load the application, it will need to download the on-device AI model (a few hundred megabytes). A progress bar will be displayed. This is a one-time process.
- Clone the repository
- Install NPM packages:
npm install
- Run the development server:
The application will be available at
npm run dev
http://localhost:5173(or another port if 5173 is in use).
In the project directory, you can run:
npm run dev- Runs the app in development mode using Vite. Open your browser to the local server address to view it.
npm run format- Formats all project files using Prettier according to the defined style rules.