From 5a19a71d63a87b7f94d2c8b0d12f36ea0ad4d22e Mon Sep 17 00:00:00 2001 From: Isaac Ahouma Date: Wed, 21 Oct 2026 09:42:24 -0700 Subject: [PATCH] Remove experimental labels from samplingMode in spec and explainer Removes the // **EXPERIMENTAL** WebIDL comments above LanguageModel.samplingMode and LanguageModelCreateCoreOptions.samplingMode in index.bs, renames the top README.md section to Updates and Deprecations, updates the Sampling Parameters overview to note that the legacy raw sampling parameter features are deprecated and only functional within web extension contexts while developers can use samplingMode presets instead, and removes a stale temperature reference in an availability() example. --- README.md | 11 +++++++---- index.bs | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c350d81..3ce74b2 100644 --- a/README.md +++ b/README.md @@ -45,19 +45,22 @@ The following are potential goals we are not yet certain of: Both of these potential goals could pose challenges to interoperability, so we want to investigate more how important such functionality is to developers to find the right tradeoff. -## Experiments and Updates +## Updates and Deprecations ### Sampling Parameters Developers have expressed the value of tuning language model sampling parameters for testing and optimizing task-specific model behavior. At the same time, web standards engagements have highlighted the need for more interoperable API shapes for sampling parameters among different models. -The API was initially made available in extension contexts with the following sampling parameter options and attributes: +The API was initially made available in extension contexts with the following raw sampling parameter features: * The static method `LanguageModel.params()`, which exposes default and maximum values for sampling parameters: `defaultTemperature`, `maxTemperature`, `defaultTopK`, `maxTopK`. * The `temperature` and `topK` options, which may be provided to `LanguageModel.create()` to control the sampling behavior of individual language model sessions. * The `temperature` and `topK` attributes on `LanguageModel` session instances, which expose the current values of the sampling parameters for that session. -Access to these features is limited to extension and experimental web contexts. Ongoing experimentation and community engagement will explore different API shapes that satisfy developer requirements and address interoperability concerns. +Support for raw sampling parameters is now deprecated and only functional within web extension contexts (see [Legacy: Configuration of per-session raw parameters](#legacy-configuration-of-per-session-raw-parameters)). Instead, developers can configure output variety and creativity using interoperable [`samplingMode`](#configuration-of-sampling-modes) presets: + +* The `samplingMode` option on `LanguageModel.create()` and `LanguageModel.availability()`, which accepts a `LanguageModelSamplingMode` preset (`"most-predictable"`, `"predictable"`, `"slightly-predictable"`, `"balanced"`, `"slightly-creative"`, `"creative"`, or `"most-creative"`). +* The `samplingMode` attribute on `LanguageModel` session instances, which exposes the resolved preset for that session. ### Renamed Features @@ -1008,7 +1011,7 @@ if (availability !== "unavailable") { const session = await LanguageModel.create(options); // ... Use session ... } else { - // Either the API overall, or the expected languages and temperature setting, is not available. + // Either the API overall, or the expected input types and languages, is not available. console.error("No language model for us :("); } ``` diff --git a/index.bs b/index.bs index 739a61f..c127f71 100644 --- a/index.bs +++ b/index.bs @@ -91,7 +91,6 @@ interface LanguageModel : EventTarget { // **DEPRECATED**: This attribute will be removed; use samplingMode instead. Only available in extension contexts. readonly attribute float temperature; - // **EXPERIMENTAL**: Only available in experimental contexts. readonly attribute LanguageModelSamplingMode? samplingMode; Promise clone(optional LanguageModelCloneOptions options = {}); @@ -126,7 +125,6 @@ dictionary LanguageModelCreateCoreOptions { // **DEPRECATED**: This option will be removed; use samplingMode instead. Only available in extension contexts. unrestricted double temperature; - // **EXPERIMENTAL**: Only available in experimental contexts. LanguageModelSamplingMode samplingMode; // The expected types and languages for the session.