What's the best way to prematurely terminate a model download

66 views
Skip to first unread message

Colin Mummery

unread,
Mar 5, 2026, 6:00:48 AMMar 5
to Chrome Built-in AI Early Preview Program Discussions
So I have an html/js app running successfully in Chrome. The user tells the app the Nano model needs to be installed and the code runs the line "session = await modelFactory.create({ monitor: monitorConfig });" , the model downloads correctly everytime with this but what if I want to cleanly end downloading prematurely from a user gesture?

There seem to be two ways to do this. The first is just run 'session.destroy();' but is this an acceptable way to do it? It's certainly the easiest to code.

The second way is to use an AbortController so the code becomes :
"const session = await modelFactory.create({ monitor: monitorConfig, signal: myAbortController.signal });
and then I call "myAbortController.abort();" to end the download after a user gesture.

What I found is that if I just close the browser in the middle of a download (as a user might do) then retrying later gets stuck on 0% , presumably because there was no cleanup when the browser closed. Something that seems to unblock this frozen 0% problem is if I go into 'chrome://components' (which now shows the model status stuck on 'downloading') and I press the 'Update' button' then a subsequent download doesn't get stuck on 0% (but I can't expect the average user to do this).

So what I'm trying to do here is give the user a clean way to terminate the download leaving everything in a state which allows the download to be retried later. Any thoughts on this?

Thomas Steiner

unread,
Mar 5, 2026, 6:34:38 AMMar 5
to Colin Mummery, Chrome Built-in AI Early Preview Program Discussions
Hi Colin,

Let me clarify a few things:

  • The browser automatically deals with the model download. Once started, there's no way for the user to stop it. You can read the details in my article on model management.
  • Session destruction or abortion doesn't have anything to do with the download, purely with unloading the model from memory and freeing resources. See my article on session management for background. 
  • Regarding the 0% loading status, let me re-purpose an example I sent earlier: Let's assume a 1GB model. You open a tab and the model downloads 250MB, so the tab's download progress is at 0.25. Then you close the browser, and we have 750MB left to download. But rather than starting at the absolutely correct value of 0.25 when you re-open the browser and load the tab again, the tab's download progress now again starts at 0, but reaching 1 is now only 750MB away. We do it this way to prevent malicious sites from matching users on different sites by monitoring their model download progress. 
Hope this clarifies the situation!

Cheers,
Tom

--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ai-dev-preview-discuss/eb525153-cc71-460b-bbbb-7d4e62c9f3a9n%40chromium.org.


--
Thomas Steiner, PhD—Developer Relations Engineer (blog.tomayac.comtoot.cafe/@tomayac)

Google Spain, S.L.U.
Torre Picasso, Pl. Pablo Ruiz Picasso, 1, Tetuán, 28020 Madrid, Spain

CIF: B63272603
Inscrita en el Registro Mercantil de Madrid, sección 8, Hoja M­-435397 Tomo 24227 Folio 25

----- BEGIN PGP SIGNATURE -----
Version: GnuPG v2.4.8 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck
0fjumBl3DCharaCTersAttH3b0ttom.xKcd.cOm/1181.
----- END PGP SIGNATURE -----

Colin Mummery

unread,
Mar 5, 2026, 12:00:15 PMMar 5
to Chrome Built-in AI Early Preview Program Discussions, Thomas Steiner, Chrome Built-in AI Early Preview Program Discussions
Thanks Thomas! I hadn't read that model management page before and was relying on misleading advice I was getting from Gemini 3.0. I'll take a closer look at the logic for my monitor because something there may explain why it sometimes gets stuck at 0% after my app restarts. I'll get back to you if I have more questions about this
Reply all
Reply to author
Forward
0 new messages