Stay organized with collections
Save and categorize content based on your preferences.
(EXPERIMENTAL) Defines an inference "backend" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.
These methods should not be called directly by the user.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# ChromeAdapter interface\n\n**(EXPERIMENTAL)** Defines an inference \"backend\" that uses Chrome's on-device model, and encapsulates logic for detecting when on-device inference is possible.\n\nThese methods should not be called directly by the user.\n\n**Signature:** \n\n export interface ChromeAdapter \n\nMethods\n-------\n\n| Method | Description |\n|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| [generateContent(request)](./ai.chromeadapter.md#chromeadaptergeneratecontent) | Generates content using on-device inference. |\n| [generateContentStream(request)](./ai.chromeadapter.md#chromeadaptergeneratecontentstream) | Generates a content stream using on-device inference. |\n| [isAvailable(request)](./ai.chromeadapter.md#chromeadapterisavailable) | Checks if the on-device model is capable of handling a given request. |\n\nChromeAdapter.generateContent()\n-------------------------------\n\nGenerates content using on-device inference.\n\nThis is comparable to [GenerativeModel.generateContent()](./ai.generativemodel.md#generativemodelgeneratecontent) for generating content using in-cloud inference.\n\n**Signature:** \n\n generateContent(request: GenerateContentRequest): Promise\u003cResponse\u003e;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|-----------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| request | [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | a standard Firebase AI [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) |\n\n**Returns:**\n\nPromise\\\u003cResponse\\\u003e\n\nChromeAdapter.generateContentStream()\n-------------------------------------\n\nGenerates a content stream using on-device inference.\n\nThis is comparable to [GenerativeModel.generateContentStream()](./ai.generativemodel.md#generativemodelgeneratecontentstream) for generating a content stream using in-cloud inference.\n\n**Signature:** \n\n generateContentStream(request: GenerateContentRequest): Promise\u003cResponse\u003e;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|-----------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| request | [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | a standard Firebase AI [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) |\n\n**Returns:**\n\nPromise\\\u003cResponse\\\u003e\n\nChromeAdapter.isAvailable()\n---------------------------\n\nChecks if the on-device model is capable of handling a given request.\n\n**Signature:** \n\n isAvailable(request: GenerateContentRequest): Promise\u003cboolean\u003e;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|-----------|-------------------------------------------------------------------------------------------|------------------------------------------------|\n| request | [GenerateContentRequest](./ai.generatecontentrequest.md#generatecontentrequest_interface) | A potential request to be passed to the model. |\n\n**Returns:**\n\nPromise\\\u003cboolean\\\u003e"]]