> ## Documentation Index
> Fetch the complete documentation index at: https://docs.larkx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> LarkX is a durable execution runtime for on-device AI agents. The public SDK is the npm package @larkxai/react-native.
> Do not import @larkxai/node, @larkxai/host, @larkxai/protocol, @larkxai/telemetry, or @larkxai/cactus in an application. Those packages are private workspace modules.
> Swift and Kotlin SDKs are planned and are not published.
> Prefer the published npm version. The GitHub default branch can contain behavior that is not in that release yet.
> Expo Go cannot load the native module. Use a development build.
> Do not describe external tool or remote effects as exactly-once.

# Model providers

> The Model interface, scriptedModel, and the Cactus adapter.

A model is any object with `id`, `model`, and `complete(request, context)`.

```typescript theme={null}
interface Model {
  readonly id: string;
  readonly model: string;
  readonly capabilities?: { readonly toolCalling?: boolean };
  complete(request: ModelRequest, context: ModelContext): Promise<ModelResponse>;
}
```

`ModelRequest` carries `messages` and `tools`. `ModelContext` carries `signal`. Honor `signal.aborted`.

`ModelResponse`:

| Field | Meaning |
| - | - |
| `message` | Assistant text, or `null` when the turn is only tool calls. |
| `finish` | `"stop"`, `"tool_calls"`, `"length"`, or `"error"`. |
| `calls` | `{ id, name, arguments }[]`. |
| `usage` | Optional token counts. |
| `timingMs` | Optional `total` and `timeToFirstToken`. |

## `scriptedModel(responses, options?)`

Returns a `Model` that yields `responses` in order. `options.id` defaults to `"scripted"`. `options.model` defaults to `"scripted-1"`. `invocations` counts completed calls. A missing response throws. Use this in tests and in the quickstart. It is not a production model.

## Cactus

`cactusModel` from `@larkxai/react-native/cactus` returns a `Model`. See [Cactus](https://docs.larkx.ai/integrations/cactus.md). No other inference provider is shipped.

There is no cloud-model adapter in the public SDK. A remote model belongs behind your own `Model` or behind a remote agent, and you have to accept that those calls leave the device.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.