#1308: Other Spec Review: Prompt API Sampling Mode
Discussions
Log in to see TAG-private discussions.
Comment by @isaacahouma Nov 19, 2026 (See Github)
Hi @toreini and @jyasskin, thanks for picking up this review!
Quick timeline note: we are targeting Chrome M160, which branches on Monday, November 30, and next week is the US Thanksgiving holiday. Blink API Owners are holding our Intent to Ship to give TAG a chance to weigh in, so if you have any early questions or feedback on the samplingMode design, we would be happy to discuss and respond right away.
OpenedNov 9, 2026
Specification
https://webmachinelearning.github.io/prompt-api/#enumdef-languagemodelsamplingmode
Explainer
https://github.com/webmachinelearning/prompt-api/blob/main/README.md#sampling-parameters
Links
temperatureandtopKparameters on the open web (excluded per TAG feedback in https://github.com/w3ctag/design-reviews/issues/1093; deprecated in extension contexts)."deterministic"/"precise"/"imaginative") and single-axis naming (AILanguageModelCreativity), replaced after international developer readability discussions in https://github.com/webmachinelearning/prompt-api/issues/203#issuecomment-4341779584 and https://github.com/webmachinelearning/prompt-api/issues/203#issuecomment-4351334398."balanced"aligned with default session behavior (https://github.com/webmachinelearning/prompt-api/issues/203#issuecomment-5483052364)."most-predictable"enables greedy speculative decoding), and more varied phrasing on open-ended drafting tasks using creative presets. Interactive comparison demo: https://isaacahouma.github.io/prompt-api-sampling-presets/language-model-availability-sampling-mode.tentative.https.window.htmlandlanguage-model-create-sampling-mode.tentative.https.window.html)The specification
Where and by whom is the work is being done?
Feedback so far
"most-predictable").temperatureandtopKknobs, which were excluded on the open web following TAG guidance in #1093.You should also know that...
We are requesting a focused delta review of how
samplingModeimplements the TAG's "Interoperable model parameters" guidance from https://github.com/w3ctag/design-reviews/issues/1093.Specifically, the WebIDL surface adds:
Key design choices we would appreciate any TAG thoughts on:
options.samplingModedefaults the session to"balanced", andsession.clone()preservessamplingMode. Whileoptions.samplingModeis non-nullable (so invalid values ornullreject withTypeError), the read-onlysession.samplingModegetter is nullable (LanguageModelSamplingMode?) solely so sessions configured with deprecated extension-onlytemperatureortopKoptions (withoutsamplingMode) returnnull. WhensamplingModeis provided alongside deprecated raw options,samplingModetakes precedence.Timeline note: We sent our Blink Intent to Ship targeting Chrome M160 on 2026-11-09 (https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6af20fd7.7772a632.11fdae.052f.GAE%40google.com).
<!-- Content below this is maintained by @w3c-tag-bot -->Track conversations at https://tag-github-bot.w3.org/gh/w3ctag/design-reviews/1308