I Pointed Chrome's Prompt API at a 1.25 Million Character Memoir, and It Got Interesting Fast Shrijith Venkatramana built Gemini Nano Book Lab, a Chrome extension that uses the browser's built-in Prompt API to answer questions about a 1.25-million-character memoir entirely on-device. The experiment exposes the underlying mechanics of Chrome's on-device language model, including how it handles context overflow and parameter adjustments when processing long-form text. By feeding Richard Wagner's *My Life* into the system, Venkatramana demonstrated that long inputs reveal concrete engineering tradeoffs that short prompts typically hide. Hello, I'm Shrijith Venkatramana. I'm building git-lrc, an AI code reviewer that runs on every commit. Star Us to help devs discover the project. Do give it a try and share your feedback for improving the product. A straightforward engineering question: what happens when you feed a long book to an on-device language model in Chrome and start adjusting the parameters? To explore this, I built a small experiment called Gemini Nano Book Lab : a Chrome extension sidepanel that uses Chrome’s built-in Prompt API to answer questions about Richard Wagner’s My Life , while also exposing some of the underlying mechanics. The response is only part of it. The experiment also captures: If you’re an engineer interested in systems that have rough edges—and therefore teach you something—this is a useful area to explore. Chrome’s Prompt API is part of the browser’s built-in AI features. Instead of sending prompts to a cloud endpoint, a web app or extension can request an on-device language model session and prompt it locally. Resources: Core capabilities: contextoverflow This makes it more than a simple text box—it becomes an environment for experimentation. Long inputs expose the interesting problems. Short prompts hide a lot; a paragraph‑long demo can make any model look magical. A long corpus forces concrete decisions: For the first version, I used Project Gutenberg’s plain text of Richard Wagner’s My Life : That gave a corpus of about 219,572 words and 1,251,663 characters in the run shown below. The demo is a Chrome extension sidepanel rather than a normal web app. This was a deliberate choice. Extensions provide a more reliable built‑in AI surface in Chrome, and they allow a compact benchmark UI where controls, streamed output, and telemetry live side by side. The extension has three tasks: The benchmark starts simple. I didn’t begin with embeddings, vector databases, or sophisticated semantic retrieval. I wanted a baseline that is easy to reason about. The first‑version controls are: This provides enough surface to see the tradeoffs without making the experiment too complex. The first question isn’t “What should I prompt?” but “Is the model available here?” Here’s the availability and session setup wrapper: js function getPromptApi : PromptApi | null { const maybePromptApi = globalThis as typeof globalThis & { LanguageModel?: PromptApi } .LanguageModel return maybePromptApi ?? null } export async function inspectPromptApi : Promise