Inspiration

At FAST-NUCES we revise from long slide decks, usually the night before the exam, and often on patchy internet or during load-shedding. Pasting lecture slides into a cloud chatbot is slow, needs a connection, and sends your course material to a server. Most of our laptops can now run a model locally in Chrome, so we wanted a study tool that uses it first.

What it does

  • Open a lecture PDF or paste notes. The PDF is read in the browser with pdf.js and never uploaded.
  • Summarize gives a title, key points and key terms. Long lectures are split into parts, each part is summarized, and the parts are merged into one revision summary.
  • Quiz me gives 5 multiple-choice questions with explanations and a score.
  • You choose where the AI runs:
    • Auto (PREFER_ON_DEVICE): Gemini Nano first, Gemini Flash-Lite in the cloud if Nano isn't available.
    • Private (ONLY_ON_DEVICE): nothing leaves the laptop, and it works offline once the model is downloaded.
    • Cloud (ONLY_IN_CLOUD).
  • Every result shows where it ran, for example "Ran on your laptop · nothing left this device", using response.inferenceSource.

How we built it

  • Vanilla JavaScript + Vite, hosted on Firebase Hosting.
  • Firebase AI Logic (firebase/ai) with the Gemini Developer API backend:
    • getGenerativeModel() with mode, inCloudParams (model, system instruction, JSON schema) and onDeviceParams (createOptions with expected input/output languages and a system prompt, and promptOptions.responseConstraint).
    • initializeDeviceModel() on the first click to download the model, with progress shown in the UI.
    • Structured JSON output on both paths: a Schema for the cloud model and a JSON-schema responseConstraint for Gemini Nano, so summaries and quizzes render reliably whichever path answered.
    • inferenceSource to show the user which path handled each step.
  • Step-level fallback: in Auto mode the SDK picks the device when Nano is available, but if Nano then fails on a particular step (input too long, malformed output), NotesNano retries only that step in the cloud. A long lecture can end up partly on-device and partly in the cloud, and the result banner shows the split.
  • Chunking keeps each on-device prompt well under Gemini Nano's input limit, so long lectures still run locally.
  • Firebase App Check with reCAPTCHA Enterprise (Fraud Defense), plus the debug provider for local development.

Challenges we ran into

  • Disk space: Chrome needs 20 GB free before it will download the on-device model, and the first attempt sat at 0% until we found the reason on chrome://on-device-internals.
  • Choosing the model: Chrome first picked Gemini Nano 3 (CPU). We enabled the "Gemma 4 for Built-in AI" flag so it runs Gemini Nano 4.
  • reCAPTCHA Classic is closed to new apps, so App Check moved to Fraud Defense (reCAPTCHA Enterprise).
  • Cloud fallback availability: the cloud path worked in testing, but our Firebase project was later marked "Gemini API free tier not available", so cloud calls now return 403. The fallback code is in place and was tested working; when the cloud is unavailable, the app shows a clear message and Private mode keeps working fully on-device.

What we learned

  • How Chrome's built-in AI decides whether a device qualifies (VRAM, disk, performance class) and how to debug it.
  • That a hybrid app needs the same output contract on both paths. Structured output made that possible.
  • That on-device inference changes what's reasonable to send to a model: personal notes and course material can stay on the laptop.

What's next for NotesNano

  • A "Nano Router": Gemini Nano classifies each part of the notes and keeps anything personal (names, roll numbers, marks) on the device, while sending only heavy maths or code to the cloud.
  • OCR for scanned slides.
  • Integration with E-DUMP, our class material app, so every uploaded lecture gets a summary and quiz.

Built With

Share this project:

Updates

Submission history