> ## 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.

# Cactus

> Optional on-device inference through cactus-react-native. The root SDK import does not load it.

```typescript theme={null}
import { cactusModel } from "@larkxai/react-native/cactus";

const model = cactusModel({ model: "qwen3-0.6b" });
await model.download();
await model.init();
```

Install the peers only in an app that imports this subpath:

```bash theme={null}
npm install cactus-react-native@1.13.1 react-native-nitro-modules@^0.33.9
```

`cactusModel` returns the host `Model`. Pass it to `createAgent` as `model`. Download and `init` stay outside the run. They are not steps, and they are not replayed by the runtime.

Completions on one instance are serialized. A cancellation that is still queued does not cancel the completion already inside Cactus. Create a second `cactusModel` when you need an independent queue.

The adapter rejects a Cactus response that requests a cloud handoff. LarkX does not turn that signal into a remote agent call.

This repository has not run download or inference on a phone. Host tests cover the adapter contract with a stand-in, not a device model.


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