Technical demo · separate from the workspace

Hybrid inference demo

Analyzes an employment opportunity into structured JSON using Firebase AI Logic in the browser. The SDK routes each prompt to the on-device model or the cloud model depending on the selected mode and device capability.

Environment

Firebase config
Loaded from env
App Check
Not initialized
Cloud model
gemini-3.5-flash-lite
Browser
Checking…
Prompt API model
checking…

Step 1 · Initialize the on-device model

Chrome requires a user gesture before the on-device model can download. Click once; the first download can take several minutes. This step is optional for the cloud-only path.

Not initialized.

Step 2 · Analyze an opportunity

Inference mode

Privacy Check (required)

How to test both paths

  1. Use Chrome desktop v139+ with chrome://flags/#prompt-api-for-gemini-nano-multimodal-input set to Enabled, then restart Chrome.
  2. On-device path: click “Initialize on-device model”, wait for Ready, select PREFER_ON_DEVICE, and Analyze. Expect inferenceSource: on_device.
  3. Cloud path: select ONLY_IN_CLOUD and Analyze. Expect inferenceSource: in_cloud.
  4. Fallback check: in a fresh Chrome profile (or with the flag disabled), select PREFER_ON_DEVICE without initializing and Analyze. Expect in_cloud plus the fallback notice.