One of the developments we are most excited about at Fastex is built-in browser AI. Chrome includes Gemini Nano, a language model that runs directly on the user's device, managed by the browser itself. This opens the door to assistants that respond instantly, with no per-request cost and without data leaving the machine. Let's look at what it is and how it is used.
What Built-in AI Is and What Gemini Nano Is
"Built-in AI" means the browser provides and manages the models for you. In Chrome, that base model is Gemini Nano. The big difference from traditional cloud AI is where the computation happens: here it happens locally, on the user's machine.
The browser takes care of downloading the model, updating it and sharing it among the different sites that use it, so you don't have to package or serve it yourself. An important consequence: once the model is downloaded, using it requires no internet connection and no data is sent to Google or to third parties.
The Family of APIs
On top of Gemini Nano, the browser exposes several specialized APIs. Each one solves a different type of task:
- Prompt API: the most flexible; you send instructions in natural language and get a response. It is the one we use for conversation and reasoning.
- Summarizer API: generates summaries in different formats and lengths.
- Translator API and Language Detector: on-device translation and language detection.
- Writer API and Rewriter: write new content or rewrite existing content.
- Proofreader API: improves the grammar and readability of a text.
For a conversational assistant that answers questions, the central piece is the Prompt API.
How to Use the Prompt API
The workflow follows a very clear and predictable pattern, which is exactly what we look for in engineering.
1. Check availability. First of all, you ask the browser whether the model is ready. The answer can be that it is available, that it can be downloaded, that it is being downloaded or that it is not available on that device.
1const estado = await LanguageModel.availability();2// 'available' | 'downloadable' | 'downloading' | 'unavailable'
2. Create a session. If the model is available (or can be downloaded), you create a session. Here we can give the model a system prompt with its personality and rules, and even track the download progress to keep the user informed.
1const session = await LanguageModel.create({2 initialPrompts: [3 { role: 'system', content: 'Eres el asistente de Fastex, cercano y claro.' }4 ],5 expectedInputs: [{ type: 'text', languages: ['es'] }],6 expectedOutputs: [{ type: 'text', languages: ['es'] }],7});
The Prompt API supports Spanish as both input and output language, which is essential for us.
3. Send the query. For short responses you use prompt(); for long ones, promptStreaming(), which returns the text bit by bit so it can be displayed in real time.
1const respuesta = await session.prompt('¿Qué servicios ofrece Fastex?');
Structured Responses: The Detail That Changes Everything
The Prompt API lets you force the model's response to follow a specific JSON schema, using the responseConstraint option. This is gold for building reliable systems: instead of interpreting free text, we get data with a guaranteed shape.
1const schema = { type: 'boolean' };2const resultado = await session.prompt(3 '¿Este texto trata sobre cerámica?\n\n' + texto,4 { responseConstraint: schema }5);6JSON.parse(resultado); // true / false
We use it to have the model decide, in a structured way, whether it can answer with the information available or whether it makes sense to refer the user to the contact form. That decision stops being guesswork and becomes controlled data.
Managing the Session and the Context Window
Each session remembers the conversation until its context window fills up. The model is lightweight, so the context is limited: you need to be careful about how much information you feed it at once. Good practices:
- Inject only the relevant piece of information for each question, not entire documents.
- Monitor context usage and, if needed, summarize the history.
- Reuse the session instead of constantly recreating it, because creating one has a cost.
Requirements to Keep in Mind
Since it is a model that lives on the device, there are requirements: a compatible desktop operating system, enough free storage space for the model, a GPU with adequate video memory (or a powerful CPU) and an unmetered connection for the initial download. That is why, in a serious implementation, you always check availability and offer an alternative when the device doesn't meet the requirements.
How We Use It at Fastex
In our web assistant, Gemini Nano is the brain that talks with the user in Spanish, in a friendly way, without sending their questions to any server. We combine it with local semantic search so that it answers only with the content of our articles, and with structured responses to decide when to help the user get in touch with us. It is useful, private and predictable AI: our way of understanding AI engineering.
Can you imagine an assistant that responds instantly, locally and at no cost per query? At Fastex we build it. Tell us about your case in the contact form.