---
title: API updates on Chrome on-device AI (Nov 2024)
url: https://calvin.my/posts/api-updates-on-chrome-on-device-ai-nov-2024
published: 2024-11-30
updated: 2026-09-16
category: AI
tags:
- Gemini Nano
- gemini
- Chrome
- webAI
summary: Chrome’s on-device AI API received November 2024 updates that rename the package from the assistant-oriented label to a language model label, reducing confusion with Google Assistant. The API also now accepts inputs exceeding 1,024 tokens. The revised example reflects the new naming while retaining capability checks, model session setup, streamed responses, and unavailable-browser handling.
---

# API updates on Chrome on-device AI (Nov 2024)

This article is an update for the previous articles below:

1. [https://calvin.my/posts/on-device-generative-ai-with-gemini-nano](../posts/on-device-generative-ai-with-gemini-nano)
2. [https://calvin.my/posts/on-device-generative-ai-with-gemini-nano-part-2](../posts/on-device-generative-ai-with-gemini-nano-part-2)
3. [https://calvin.my/posts/api-updates-on-chrome-on-device-ai](../posts/api-updates-on-chrome-on-device-ai)

* * *

## Updates in November 2024

1. Package Name "ai.assistant" is changed to "ai.languageModel". This change avoids confusion with Google Assistant.
2. The API now supports more than 1024 input tokens.

* * *

## Updated sample code

```javascript
async askAi(prompt) {
        const {available, defaultTopK } = await ai.languageModel.capabilities();

        if (available !== "no") {
            const systemPrompt = "You are a helpful assistant.";
            const session = await ai.languageModel.create({
                systemPrompt: systemPrompt,
                temperature: 0,
                topK: defaultTopK
            });

            const stream = session.promptStreaming(prompt);
            for await (const chunk of stream) {
                this.outputTarget.textContent = chunk;
            }
            session.destroy();
        } else {
            this.outputTarget.textContent = "Error! On-device AI is not available on your browser."
        }
}
```
