---
id: aikit-capabilities
title: Capabilities & Modes
slug: /ai-kit/capabilities
sidebar_position: 30
description: How AI-Kit decides between on-device Chrome AI APIs and your backend; plus supported features and mode preferences.
tags: [ai-kit, capabilities, on-device, backend, chrome]
hide_title: true
---

## Capabilities & Modes

AI‑Kit can run each feature from one of two sources:

- **on-device** — Chrome Built-in AI APIs (Gemini Nano) in the user’s browser
- **backend** — your own AWS-hosted AI‑Kit backend (SAR template)

### Mode preference

The global preference is one of:

- `local-only` — only on-device, never backend
- `backend-fallback` — prefer on-device, fallback to backend
- `backend-only` — only backend, ignore on-device

These values are represented by `AiModePreference`.

### Supported features

AI‑Kit tracks capability per built-in AI feature:

- `prompt`
- `summarizer`
- `writer`
- `rewriter`
- `proofreader`
- `language-detector`
- `translator`

### Programmatic capability checks

Use these helpers when you need to decide before rendering a UI:

```ts
import { decideCapability, checkOnDeviceAvailability, getMinChromeVersions } from "@smart-cloud/ai-kit-core";

const min = await getMinChromeVersions(); // { prompt: "...", summarizer: "...", ... }

const onDevice = await checkOnDeviceAvailability("writer");
if (onDevice.available) {
  // Chrome API is available / downloadable / downloading
}

// For translator you must pass source/target languages to availability()
const translator = await checkOnDeviceAvailability("translator", {
  sourceLanguage: "en",
  targetLanguage: "de",
});

const decision = await decideCapability("writer");

// Optional overrides:
// - availability options (same shape as Chrome create() options)
// - modeOverride to force local/backend behaviour for this call
const forcedBackend = await decideCapability(
  "writer",
  undefined,
  "backend-only",
);

console.log(decision.source); // "on-device" | "backend" | "none"
console.log(forcedBackend.reason); // detailed string explaining the decision
```

`decideCapability(feature, availabilityOptions?, modeOverride?)` mirrors the runtime logic used by AI‑Kit internally.

`availabilityOptions` should match the Chrome API `create()` options for the requested feature (for example Translator requires `sourceLanguage` and `targetLanguage`). `modeOverride` lets you temporarily force `"local-only"`, `"backend-fallback"`, or `"backend-only"` without touching global settings.

### Backend configuration (when enabled)

When backend usage is allowed, AI‑Kit needs:

- `backendTransport`: `"fetch"` or `"gatey"`  
  (`gatey` means “use Gatey’s signed transport” when Gatey is present)
- `backendBaseUrl`: full base URL for the backend API (typical)
- `backendApiName`: API name if your transport requires it

In most setups you’ll only configure **`backendBaseUrl`**.

:::note Frontend vs Admin
AI‑Kit distinguishes `context: "admin" | "frontend"` for backend calls. Some deployments may expose separate path prefixes (for example `/admin/*` and `/frontend/*`) with different security policies.
:::
