Intent to Prototype: Writer API

382 views
Skip to first unread message

Domenic Denicola

unread,
Aug 22, 2024, 2:25:01 AMAug 22
to blink-dev

Contact emails

dom...@chromium.orgfer...@chromium.orgkenji...@chromium.orgho...@chromium.org

Explainer

https://github.com/explainers-by-googlers/writing-assistance-apis/blob/main/README.md

Specification

None yet, but looking forward to writing one

Summary

A JavaScript API for writing new material given a writing task prompt, backed by an AI language model.


Blink component

Blink>AI>Write

Motivation

Browsers and operating systems are increasingly expected to gain access to a language model. By exposing this built-in model, we avoid every website needing to download their own multi-gigabyte language model, or send input text to third-party APIs. The writer API in particular exposes a high-level API for interfacing with a language model in order to produce new output for a variety of use cases [1], in a way that does not depend on the specific language model in question. [1]: https://github.com/explainers-by-googlers/writing-assistance-apis/blob/main/README.md#writer-api


Initial public proposal

https://github.com/WICG/proposals/issues/163

TAG review

None yet; waiting to move to WICG first

TAG review status

Pending

Risks

Interoperability and Compatibility

This feature has definite interoperability and compatibility risks, due to the likelihood that different implementations will use different language models, prompts, and fine-tunings, and even within a single implementation such as Chrome, these pieces will likely change over time. Additionally, not all browsers and operating systems will have a built-in language model to expose, and not all devices will be able to run one. We are taking a variety of steps to attempt to mitigate these risks. For example, the specification is designed to allow the API to be backed by a cloud-based language model, which could help extend it to more users. And the high-level nature of the API, which hides the details of the specific language model, prompts, etc., makes it harder for developers to depend on specific outputs: they are just getting newly-written text, and not e.g. structured data. Finally, the API surface is designed with many clear points of failure, that encourage the developer to probe for capabilities ahead of time and fall back to other techniques if a capability is not available. Nevertheless, interoperability and compatibility risk remains high for these sorts of APIs, and we'll be closely monitoring it during the prototyping period.


Gecko: No signal; waiting to move to WICG before asking

WebKit: No signal; waiting to move to WICG before asking

Web developers: No signals/weak mixed signals. We have many private expressions of interest in the use case, but initial public reaction to the specific API in https://github.com/WICG/proposals/issues/163 has been mixed.

Other signals:

Activation

This feature would definitely benefit from having polyfills, backed by any of: cloud services, lazily-loaded on-device models using WebGPU, or the web developer's own server. We anticipate seeing an ecosystem of such polyfills grow as more developers experiment with this API.


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

It is possible that giving DevTools more insight into the nondeterministic states of the model, e.g. random seeds, could help with debugging. See related discussion at https://github.com/explainers-by-googlers/prompt-api/issues/9.


Is this feature fully tested by web-platform-tests?

No

We hope to work on web platform tests for this feature, but how much we can guarantee as testable beyond the surface API is unclear, given the nondeterministic nature of the output.


DevTrial instructions

https://docs.google.com/document/d/1wIoSQx29-WBlEDO297iF9a43DXUcbjxJqctdGxcXY6I/edit?usp=sharing

Flag name on chrome://flags

writer-api-for-gemini-nano

Finch feature name

EnableAIWriterAPI

Requires code in //chrome?

True

Tracking bug

https://issues.chromium.org/issues/357967382

Estimated milestones

DevTrial on desktop129


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4712595362414592?gate=6573559762386944

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages