Inspiration

As someone with a strong interest in learning new languages, I always struggled to find enough time to dedicate to consistent study. My friends and I often shared a simple, fun habit: we would quiz each other with random foreign words to test our knowledge quickly.

This personal habit sparked the idea for this project. I realized that if I could combine this spontaneous quizzing idea with AI, I could create a fast, engaging, and fun learning tool.

What it does

  • "Guess The Language" tests language knowledge in the browser.
  • The game uses Google's Gemini Nano model (via the Chrome Prompt API) to generate a random word in a foreign language.
  • It provides a theme (e.g., "Animals") as a clue.
  • Users guess the correct language from a list.
  • All word generation is powered by the AI running locally on your device.

How we built it

The frontend uses React, Tailwind CSS, and Framer Motion. The AI integration is the core feature. We used the Chrome Prompt API to talk to the Gemini Nano model. This means the model runs directly on the user's device, not a cloud server. To guarantee the game works correctly, We implemented structured output: We used responseConstraint in the session.prompt call. This forces Gemini Nano to return a structured JSON object containing the theme, language, and word. This was essential for the application to reliably read the AI's output.

Challenges we ran into

Ensuring the Gemini Nano model was available and correctly set up required careful checking of Chrome Dev/Canary versions and chrome://flags was truly challenging

Accomplishments that we're proud of

  • Successfully achieving on-device AI integration with Gemini Nano for content generation
  • Successfully implementing the structured JSON output, which is key to making the AI-powered game logic dependable. We were surprised that the on-edge AI was capable of doing so, we struggled with this quite a lot in GPT-2, and even with webllm.

What's next for Guess The Language

  • Add multiplayer feature in the game so players can compete for max score
  • Introduce levels of difficulty.
  • Add features for audio pronunciation and word definitions after a correct guess.
Share this project:

Updates