← Back to release summary

Prompt API Sampling Parameters

Category
Miscellaneous
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

Adds sampling parameters to the Prompt API. These control how tokens are sampled from the model, giving developers control over the "creativeness" or "randomness" of the output. Additionally, it adds attributes to the LanguageModel instance to read the set values, as well as a static LanguageModel function to get the default and max values of these parameters. The first implementation adds `temperature` and `topK` parameters.

Standards & signals

Explainers: https://github.com/webmachinelearning/prompt-api?tab=readme-ov-file#sampling-parameters

View on chromestatus.com