Chrome Prompt API Test

Setup Instructions

The Prompt API requires Chrome 138+ with specific flags enabled:

  1. Open chrome://flags/#optimization-guide-on-device-model and set to Enabled BypassPerfRequirement
  2. Open chrome://flags/#prompt-api-for-gemini-nano and set to Enabled
  3. Open chrome://flags/#prompt-api-for-gemini-nano-multimodal-input and set to Enabled (for image/audio input)
  4. Click Relaunch to restart Chrome
  5. After relaunch, visit chrome://on-device-internals to check model status

Note: chrome:// links cannot be clicked directly. Copy the URL and paste it into your address bar.

Hardware Requirements

1. Check Availability

Check if the Prompt API and Gemini Nano model are available on this device.

Click button to check

Downloading model...

0%

2. Model Parameters

Get the model's default and maximum parameter values.

3. Load Model

Load the model and create a session with optional custom parameters.

No model loaded

4. Prompt (Non-Streaming)

Send a prompt and get the complete response at once.

5. Prompt (Streaming)

Send a prompt and see the response stream in real-time.

6. Structured Output (JSON Schema)

Constrain the model's response using a JSON Schema.

7. Reset Session

Reset the conversation context (preserves system prompt, clears chat history).

Load model first