Skip to content

Improve LanguageModel.availability() API to Provide Detailed Unavailability Reasons #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adolfdaniel opened this issue Apr 23, 2025 · 1 comment

Comments

@adolfdaniel
Copy link

The LanguageModel.availability() API in chrome currently returns unavailable if the device performance check has not run yet. However, it does not provide additional context regarding the reason behind this status, which creates challenges for website developers trying to inform users appropriately. Explainer

Possible Causes:

  • The browser was recently installed, and the performance class has not yet been determined.
  • A capable GPU was installed, but the performance class check won’t run until the browser version changes.

Issue:
Currently, developers only have access to a console log message stating that "The device is not capable," which does not offer actionable details to explain the delay or readiness of the system. To enhance developer experience and user communication, an API enhancement is needed to bubble up the specific reason for the unavailability.

Proposed Solution:
Introduce a new method, such as LanguageModel.lastError(), that returns the actual error or status reason that led to the API’s unavailability. This would allow website developers to reliably convey the proper context to users, improving transparency and reducing confusion.

@domenic
Copy link
Collaborator

domenic commented Apr 24, 2025

It's not feasible to reveal this kind of user-specific information to websites, for privacy reasons.

It sounds like this is more of a bug in Chrome, that it returns "unavailable" when the device class is not determined, instead of waiting to return from availability() until it determines the device class. So, please file this on https://crbug.com/.

@domenic domenic closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants