How to get context window size and other parameters

23 views
Skip to first unread message

Colin Mummery

unread,
Jan 2, 2026, 12:48:06 AM (5 days ago) Jan 2
to Chrome Built-in AI Early Preview Program Discussions
I have Nano working consistently well in my HTML/JS SPA using the Prompt and Rewriter APIs. Is there a way I can query the model to get the context window size and other parameters? Gemini 3.0 seems to think there's a function called capabilities but that doesn't exist.

Chi Yo Tsai

unread,
Jan 5, 2026, 6:37:41 PM (23 hours ago) Jan 5
to Chrome Built-in AI Early Preview Program Discussions, Colin Mummery

Hi Colin,

The inputQuota and inputUsage attribute of the model object should give you the context window size.
> const m = await LanguageModel.create();
> await m.append('Hello! How are you?')
> m.inputUsage
< 11
> m.inputQuota
< 9216

 You can also access the topK and temperature parameter of the model for the sampling parameter.
Reply all
Reply to author
Forward
0 new messages