Chrome Built-in AI in Action: Six APIs for Building a Smart Blog Editor

Build a smart blog editor using Chrome's six built-in AI APIs — all running locally with no backend required.
This workshop demonstrates how Chrome's built-in AI APIs — powered by Gemini Nano — can transform a travel blog editor with features like AI-generated titles, SEO descriptions, tags, alt text, and translation. All processing runs locally in the browser, requiring no cloud calls or backend infrastructure, making it ideal for privacy-sensitive and offline use cases.
Why Choose Browser-Native AI
The presenter opened with a clear premise: AI is here, and it's integrating into our workflows one way or another. The demo vehicle is a fully functional yet minimalist travel blog — complete with destination landing pages, country spotlights, tag navigation, a comments section, and a backend editor with live preview.
This editor has a classic pain point: writing headlines is fun, but writing SEO descriptions is "the most tedious task." The presenter's core philosophy runs throughout the entire session — AI isn't meant to fully control content; it's a tool to help us get started from scratch. All AI-generated content remains editable, and users can modify or supplement it at any time. This "AI-assist, not AI-replace" positioning is the design philosophy of the entire demo.
What makes this particularly noteworthy is that these APIs run directly in the browser. Chrome's built-in AI is powered by Google's Gemini Nano — a lightweight large language model optimized for on-device inference. After quantization, it runs on standard consumer hardware, with a model file of roughly 1–2 GB managed by Chrome itself. Multiple web pages share the same model weights, avoiding redundant storage usage. Taking translation as an example, the presenter emphasized that "the entire process involves no cloud — it all happens locally" — a significant advantage for privacy-sensitive scenarios and offline availability.

Summarizer API: One-Click Title and SEO Description Generation
The Summarizer API is what the presenter considers "the most practically valuable" interface. In the blog editor, it manifests as two new buttons: "Suggest Title with AI" and "Suggest Description with AI."
The implementation logic is straightforward: first, grab the blog body's innerText (plain text preserving paragraph structure), then create a summarizer instance, configure the input/output languages, and set type to headline. The key is the sharedContext parameter — the presenter uses it to tell the AI to write "click-worthy headlines" rather than "clickbait," explicitly noting "there's a huge difference between the two." Finally, call summarizeStreaming to stream the generated result chunk by chunk.
The SEO description implementation is nearly identical, requiring only a small config change: switch type from headline to teaser, update sharedContext to "write an SEO description," and reuse all remaining logic. This configuration-based reuse dramatically lowers the integration cost.
The Summarizer API has been supported since Chrome 138 and, after a solid stability period, is safe to use in production.
Prompt API with Structured Output: Predictable Tag Generation
The Prompt API paired with Structured Output is the second highlight. The demo scenario is auto-generating blog tags: the user types "Barcelona," clicks a button, and AI fills in more related tags — all editable.

The technical core is JSON Schema. JSON Schema is the standard specification for describing JSON data structures. By constraining the model's output format, it fundamentally solves the engineering pain point of inconsistent LLM output. Traditional prompt engineering relies on the model "understanding" format requirements, with a non-trivial failure rate. Structured output uses Constrained Decoding to filter out invalid outputs at the token-sampling stage, turning format guarantees from a probabilistic concern into a deterministic one. The presenter assumes the blog has a fixed tag taxonomy, so he defines an enum of all valid tags — adventure, Argentina, beach, Brazil, and so on. With JSON Schema constraints, the model's tags field is forced to be a string array, values can only come from the enum, the field is required, and no extra properties are allowed.
The core value here is predictability. The presenter repeatedly emphasized: once a JSON Schema is specified, "no matter what the API generates, the overall structure is absolutely stable" — the tags field will always exist and always be an array, so you can safely build business logic on top of it.
On the code side, store the schema in a responseConstraint variable, create a session with LanguageModel.create, call session.prompt passing in the constraint, and parse the result directly with JSON.parse. The Language Model API officially launched in Chrome 148.
Multimodal Input: Auto-Generating Alt Text and Image Captions
The Prompt API also supports multimodal input. The demo scenario: paste an image into the blog, and AI automatically generates an accessibility alt text and a creative image caption.
The approach still leverages JSON Schema, this time requiring an object with both alt and caption fields. Unlike plain text, the session options include expectedInputs with type: image, and an initialPrompt sets the system prompt declaring the model is "an expert in writing accessible alternative text and engaging image captions."
The presenter highlighted an elegant Web platform advantage: you can pass in an HTML image element directly, no Base64 encoding needed. This is thanks to the browser's native image data pipeline — Gemini Nano's vision encoder can directly read the decoded pixel data already in browser memory, sparing developers from manual serialization. "This is why working on the Web is so cool."
The real-world results were interesting: for an aerial photo of Barcelona, the AI's alt text accurately described "a cityscape centered on the Sagrada Família as a landmark," but the caption was quite poetic — "lost in the labyrinth of terracotta rooftops" — not a literal description of the image. This illustrates the functional difference between alt text (accessibility) and captions (creative expression), while reminding developers that AI output still requires human review.

Writer, Rewriter, and Translator: Covering the Full Writing Workflow
The final three APIs cover the complete content creation pipeline, though their maturity levels vary considerably.
Writer API addresses writer's block and the inconvenience of mobile input. A traveler just needs to jot down a few bullet points on their phone — "Barcelona worth it," "crowded but for good reason," "book tickets in advance" — and AI expands them into full blog paragraphs. Use sharedContext to tell it "user provides key points, please expand into a detailed blog post," then call writeStreaming for streaming generation.
Rewriter API works on existing content: select a passage, specify tone parameters like "more conversational," "longer," or "shorter," specify Markdown formatting, and AI rewrites it with a live preview.
Translator API is the simplest interface — pass in source and target languages when calling create, then call translate directly. "That's all there is to it." It's worth noting that the Translator API uses a dedicated neural machine translation model separate from Gemini Nano, with model packages downloaded on demand for different language pairs. These packages are far smaller than a general-purpose LLM and have extremely low inference latency — this architecture draws on years of Google's work on Chrome's offline translation feature and supports 100+ language pairs. It has been ready since Chrome 138 and runs entirely locally with zero cloud involvement.

The presenter also mentioned a "hidden champion" — the Language Detector. In all of the above examples, whenever you don't want to hardcode the input language, the Language Detector automatically identifies it.
Production Readiness Assessment: What's Ready, What Isn't
The most valuable part of this demo is the presenter's honest disclosure of each API's maturity level:
- Released and available: Summarizer (Chrome 138), Translator (Chrome 138), Language Model (Chrome 148)
- Still experimental: Writer and Rewriter APIs require manual enablement via
chrome://flagsand have not yet reached a shippable state - Cross-browser limitations: No support in other browsers yet; Edge has partial support for some built-in AI features
To address compatibility concerns, the Chrome team offers two pragmatic paths:
- Firebase AI Logic hybrid approach — Firebase AI Logic provides a unified client SDK that implements a "local-first, cloud-fallback" routing strategy internally: when Chrome's built-in AI is detected as available, API calls are routed directly to the local Gemini Nano; when local isn't available (unsupported browser, hardware requirements not met), it transparently falls back to the Gemini cloud API. This Edge-Cloud Hybrid pattern is standard engineering practice for reducing AI feature fragmentation risk and is suitable for production scenarios that need to cover all devices.
- Experimental polyfill — You can program directly against each API interface, lowering migration costs
Additional deployment tips: install @types/dom-chromium-ai for TypeScript type support. Since much LLM training data still reflects older API versions, actively feed official documentation and modern Web guidelines to your development assistant when coding, to avoid generating outdated code.
Conclusion
This "zero to built-in AI hero" workshop showcased an AI integration path that's fundamentally different from mainstream cloud-based LLMs: lightweight, local, privacy-friendly, and backend-free. For medium-to-low complexity but high-frequency AI-assisted use cases like blog editing and content tools, Chrome's built-in AI offers an extremely low barrier to entry.
Of course, it's not a silver bullet — some APIs are still experimental, cross-browser support is limited, and the local Gemini Nano model has fewer parameters and less reasoning capability than flagship cloud models like Gemini Pro/Ultra. But combined with the Firebase hybrid approach and polyfills, developers can already begin using it carefully in production environments. As the presenter put it, AI is a tool to help us start from scratch — not the final answer.
Key Takeaways
Related articles

Trick Questions Put to the Test: Deep Analysis of Why Gemini Outperformed Claude
Comparing Gemini 3.7 Flash vs Claude Sonnet 5 on 5 trick questions reveals deep insights into AI over-pattern-matching, lack of critical thinking, and resistance to misdirection.

DeepSeek V4 Pro Frontend Programming Test: Compared Against Grok 4.6 and Kimi K3
Hands-on comparison of DeepSeek V4 Pro, Grok 4.6, and Kimi K3 in frontend programming, testing particle effects and 3D scene development with analysis on performance and cost-effectiveness.

DeepSeek V4-Pro Deep Dive: Agent Capability Upgrades, Benchmark Analysis & API Price Hike Breakdown
DeepSeek V4-Pro launches with major Agent upgrades, 3-tier reasoning effort, and native OpenAI Responses API support. Full benchmark analysis, DS Bench insights, and August 17 time-of-use API pricing breakdown.