+
-**React Native ExecuTorch** provides a declarative way to run AI models on-device using React Native, powered by **ExecuTorch** :rocket:. It offers out-of-the-box support for a wide range of LLMs, computer vision models, and more. Visit our [HuggingFace](https://huggingface.co/software-mansion) page to explore these models.
+**React Native ExecuTorch** is an on-device AI inference library for React Native, powered by [ExecuTorch](https://executorch.ai) — Meta's on-device inference runtime. It lets you run machine learning models directly on the user's phone with zero network calls, full offline capability, and guaranteed privacy. No data ever leaves the device.
-[**ExecuTorch**](https://executorch.ai), developed by Meta, is a novel framework allowing AI model execution on devices like mobile phones or microcontrollers.
+The library ships with a curated set of pre-exported models covering computer vision, language models, text-to-speech, transcription, and more — all available in our [Hugging Face collection](https://huggingface.co/software-mansion/collections) and ready to use out of the box. You can also bring your own `.pte` models and plug them into existing pipelines or build entirely custom ones from scratch.
-React Native ExecuTorch bridges the gap between React Native and native platform capabilities, enabling developers to efficiently run local AI models on mobile devices. This can be achieved without the need for extensive expertise in native programming or machine learning.
+To explore all on-device capabilities in an interactive showcase app, check out the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery).
[](https://www.npmjs.com/package/react-native-executorch)
[](https://www.npmjs.com/package/react-native-executorch)
[](https://github.com/software-mansion/react-native-executorch/actions/workflows/ci.yml)
-
-Table of Contents
-
-- [Supported Versions](#supported-versions)
-- [Real-world Example](#real-world-example)
-- [Quickstart - Running LFM2.5](#quickstart---running-lfm25)
- - [:one: Installation](#one-installation)
- - [:two: Setup \& Initialization](#two-setup--initialization)
- - [:three: Run the Model!](#three-run-the-model)
-- [Demo Apps](#demo-apps)
-- [Ready-made Models](#ready-made-models)
-- [Documentation](#documentation)
-- [License](#license)
-- [What's Next?](#whats-next)
-- [React Native ExecuTorch is created by Software Mansion](#react-native-executorch-is-created-by-software-mansion)
-
-
-
-## Supported Versions
-
-The minimal supported version are:
-* iOS 17.0
-* Android 13
-* React Native - see [compatibility table](https://docs.swmansion.com/react-native-executorch/docs/next/other/compatibility)
-
-> [!IMPORTANT]
-> React Native ExecuTorch supports only the [New React Native architecture](https://reactnative.dev/architecture/landing-page).
-
-## Real-world Example
+## Table of Contents
-React Native ExecuTorch is powering [Private Mind](https://privatemind.swmansion.com/), a privacy-first mobile AI app available on [App Store](https://apps.apple.com/gb/app/private-mind/id6746713439) and [Google Play](https://play.google.com/store/apps/details?id=com.swmansion.privatemind).
+- [Key Features](#key-features)
+- [Quickstart](#quickstart)
+ - [1. Installation](#1-installation)
+ - [2. Run the Model](#2-run-the-model)
+- [Interactive Gallery App](#interactive-gallery-app)
+- [Documentation](#documentation)
+- [Powered by React Native ExecuTorch](#powered-by-react-native-executorch)
+- [Created by Software Mansion](#created-by-software-mansion)
-
+## Key Features
-## Quickstart - Running LFM2.5
+- **Native Hardware Acceleration**: Optimized execution delegates across backends: **XNNPACK** (CPU), **Core ML** & **MLX** (Apple Silicon), and **Vulkan** (Android GPU).
+- **100% Offline & Private**: Zero cloud inference costs and zero network dependency after model download. No user data ever leaves the device.
+- **Two-Layer Architecture**:
+ - **Ready-to-use Task Hooks (`use`)**: Out-of-the-box support for LLMs, computer vision, speech, and embeddings with automatic caching and lifecycle management.
+ - **Lower-level Runtime & Custom Orchestration**: Build custom pipelines entirely in TypeScript using low-level tensor operations, fast native operators, schema validation, and worklet threading.
+- **Pre-Exported Model Catalog**: Access verified models directly via the `models` registry and the [Software Mansion Hugging Face Collections](https://huggingface.co/software-mansion/collections).
-**Get started with AI-powered text generation in 3 easy steps!**
+## Quickstart
-The steps below assume an Expo project. For bare React Native, follow the [Getting Started guide](https://docs.swmansion.com/react-native-executorch/docs/fundamentals/getting-started) in the documentation.
+### 1. Installation
-### :one: Installation
+Install `react-native-executorch` alongside its required peer dependencies:
```bash
-# Install the package
-yarn add react-native-executorch
-
-# Add these packages for resource fetching:
-yarn add react-native-executorch-expo-resource-fetcher
-yarn add expo-file-system expo-asset
-
-# Depending on the platform, choose either iOS or Android
-yarn
+npm install react-native-executorch react-native-worklets react-native-blob-util
+# or
+yarn add react-native-executorch react-native-worklets react-native-blob-util
+# or
+pnpm add react-native-executorch react-native-worklets react-native-blob-util
```
-> npm and pnpm work too — use `npm install` or `pnpm add` for the packages, and `npm run ` / `pnpm ` for the run step.
-
-### :two: Setup & Initialization
+> [!IMPORTANT]
+> React Native ExecuTorch requires the **New React Native Architecture**, **React Native 0.81+** or **Expo SDK 54+** (using development builds), **iOS 17.0+**, and **Android 13+**.
-Add this to your component file:
+### 2. Run the Model
```tsx
-import {
- useLLM,
- models,
- Message,
- initExecutorch,
-} from 'react-native-executorch';
-import { ExpoResourceFetcher } from 'react-native-executorch-expo-resource-fetcher';
-
-initExecutorch({
- resourceFetcher: ExpoResourceFetcher,
-});
-
-function MyComponent() {
- // Initialize the model 🚀
- const llm = useLLM({ model: models.llm.lfm2_5_1_2b_instruct() });
- // ... rest of your component
+import { Button, View } from 'react-native';
+import { models, useLLMChatSession } from 'react-native-executorch';
+
+export function App() {
+ const session = useLLMChatSession(models.llm.LFM2_5_1_2B.DEFAULT);
+
+ const handleGenerate = async () => {
+ if (!session.isReady || !session.sendMessage) return;
+
+ const turn = await session.sendMessage(
+ 'Explain on-device AI in one sentence.',
+ (token) => console.log(token)
+ );
+
+ console.log('Result messages:', turn.messages);
+ };
+
+ return (
+
+
+
+ );
}
```
-### :three: Run the Model!
-
-```tsx
-const handleGenerate = async () => {
- const chat: Message[] = [
- { role: 'system', content: 'You are a helpful assistant' },
- { role: 'user', content: 'What is the meaning of life?' }
- ];
-
- // Chat completion
- await llm.generate(chat);
- console.log('LFM2.5 says:', llm.response);
-};
-```
-
-## Demo Apps
-
-We currently host a few example [apps](https://github.com/software-mansion/react-native-executorch/tree/main/apps) demonstrating use cases of our library:
-
-- `llm` - Chat application showcasing use of LLMs
-- `speech` - Speech to Text & Text to Speech task implementations
-- `computer-vision` - Computer vision related tasks
-- `text-embeddings` - Computing text representations for semantic search
-- `bare-rn` - LLM chat example for bare React Native (without Expo)
-
-If you would like to run a demo app, first initialize the required git submodules from the repository root:
-
-```bash
-git submodule update --init packages/react-native-executorch/third-party/common
-```
-
-Then navigate to its project directory, install dependencies and run app with:
-
-```bash
-yarn && yarn
-```
-
-> [!WARNING]
-> Running LLMs requires a significant amount of RAM. If you are encountering unexpected app crashes, try to increase the amount of RAM allocated to the emulator.
-
-## Ready-made Models
-
-Our library has a number of ready-to-use AI models; a complete list is available in the documentation. If you're interested in running your own AI model, you need to first export it to the `.pte` format. Instructions on how to do this are available in the [Python API](https://docs.pytorch.org/executorch/stable/using-executorch-export.html) and [optimum-executorch README](https://github.com/huggingface/optimum-executorch?tab=readme-ov-file#option-2-export-and-load-separately).
-
## Documentation
-Check out how our library can help you build your React Native AI features by visiting our docs:
-https://docs.swmansion.com/react-native-executorch
+Full documentation, guides, architecture deep dives, and API references are available at:
+**[docs.swmansion.com/react-native-executorch](https://docs.swmansion.com/react-native-executorch/)**
-## License
+- [Getting Started Guide](https://docs.swmansion.com/react-native-executorch/docs/fundamentals/getting-started)
+- [Downloading & Caching Models](https://docs.swmansion.com/react-native-executorch/docs/fundamentals/downloading-models)
+- [Task Extensions & Pipelines](https://docs.swmansion.com/react-native-executorch/docs/category/extensions)
+- [Core Primitives & Custom Pipelines](https://docs.swmansion.com/react-native-executorch/docs/category/core--advanced)
+- [Exporting Custom `.pte` Models](https://docs.swmansion.com/react-native-executorch/docs/core-and-advanced/exporting-custom-models)
-This library is licensed under [The MIT License](./LICENSE).
+## Powered by React Native ExecuTorch
-## What's Next?
+React Native ExecuTorch powers [Private Mind](https://privatemind.swmansion.com/), a privacy-first mobile AI application available on [App Store](https://apps.apple.com/gb/app/private-mind/id6746713439) and [Google Play](https://play.google.com/store/apps/details?id=com.swmansion.privatemind).
-To learn about our upcoming plans and developments, please visit our [milestones](https://github.com/software-mansion/react-native-executorch/milestones).
+
-## React Native ExecuTorch is created by Software Mansion
+## Created by Software Mansion
-Since 2012, [Software Mansion](https://swmansion.com) is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – [Hire us](https://swmansion.com/contact?utm_source=react-native-executorch&utm_medium=readme).
+Since 2012, [Software Mansion](https://swmansion.com) has been building mobile and web apps, contributing to open-source software, and dealing with all kinds of React Native challenges. We are Core React Native Contributors. We can help you build your next AI product – [Hire us](https://swmansion.com/contact?utm_source=react-native-executorch&utm_medium=readme).
[](https://swmansion.com)
+
diff --git a/docs/docs/01-fundamentals/01-getting-started.md b/docs/docs/01-fundamentals/01-getting-started.md
index 0f814c5d7c..bfc9a94e42 100644
--- a/docs/docs/01-fundamentals/01-getting-started.md
+++ b/docs/docs/01-fundamentals/01-getting-started.md
@@ -6,198 +6,102 @@ keywords:
react native,
react native ai,
react native llm,
- react native qwen,
- react native llama,
- react native executorch,
- executorch,
on-device ai,
- pytorch,
- mobile ai,
+ executorch,
+ pytorch mobile,
+ mobile ml,
+ vision,
+ speech,
]
-description: 'Get started with React Native ExecuTorch - a framework for running AI models on-device in your React Native applications.'
+description: 'Get started with React Native ExecuTorch — high-performance, privacy-first on-device AI inference for React Native.'
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
-## What is ExecuTorch?
-
-[ExecuTorch](https://executorch.ai) is a novel AI framework developed by Meta, designed to streamline deploying PyTorch models on a variety of devices, including mobile phones and microcontrollers. This framework enables exporting models into standalone binaries, allowing them to run locally without requiring API calls. ExecuTorch achieves state-of-the-art performance through optimizations and delegates such as Core ML and XNNPACK. It provides a seamless export process with robust debugging options, making it easier to resolve issues if they arise.
+# Getting Started
-## React Native ExecuTorch
+React Native ExecuTorch is an on-device AI inference library for React Native,
+powered by [ExecuTorch](https://executorch.ai) — Meta's on-device inference
+runtime and a project under the PyTorch Foundation. It lets you run machine
+learning models directly on the user's phone with zero network calls, full offline
+capability, and guaranteed privacy. No data ever leaves the device.
-React Native ExecuTorch is our way of bringing ExecuTorch into the React Native world. Our API is built to be simple, declarative, and efficient. Additionally, we provide a set of pre-exported models for common use cases, so you don't have to worry about handling exports yourself. With just a few lines of JavaScript, you can run AI models (even LLMs 👀) right on your device—keeping user data private and saving on cloud costs.
+The library ships with a curated set of pre-exported models covering
+computer vision, language models, text-to-speech, transcription, and more — all available in our
+[HuggingFace collection](https://huggingface.co/software-mansion/collections)
+and ready to use out of the box. You can also bring your own models and
+plug them into existing pipelines or build entirely custom ones from scratch.
-## Compatibility
+## What is ExecuTorch?
-React Native Executorch supports only the [New React Native architecture](https://reactnative.dev/architecture/landing-page).
+[ExecuTorch](https://executorch.ai) is a PyTorch Core project — Meta's on-device
+inference runtime for deploying PyTorch models on edge devices. It takes standard
+PyTorch models and compiles them into an optimized `.pte` format that runs
+natively on mobile phones, AR/VR headsets, embedded systems, and custom
+accelerators.
-If your app still runs on the old architecture, please consider upgrading to the New Architecture.
+The runtime supports hardware-accelerated backends for every major platform:
+XNNPACK for CPU acceleration across all platforms, Core ML and MLX on Apple
+devices, Vulkan for Android GPU, and more. It's a core part of the PyTorch ecosystem,
+with full support for the standard PyTorch model export workflow.
-For supported React Native and Expo versions, see the [Compatibility table](https://docs.swmansion.com/react-native-executorch/docs/other/compatibility).
+ExecuTorch handles the hard parts: memory planning, operator dispatch, and
+hardware delegate selection — so you don't have to. To learn more about the
+underlying runtime, check out the
+[ExecuTorch documentation](https://docs.pytorch.org/executorch/stable/index.html).
## Installation
-Installation takes two steps: install the core package, then install a resource fetcher adapter that matches your project type. If you want to implement your own model fetching logic instead, see [this document](https://docs.swmansion.com/react-native-executorch/docs/resource-fetcher/custom-adapter).
-
-### 1. Install the core package
-
-
-
-
- ```bash
- npm install react-native-executorch
- ```
-
-
-
-
- ```bash
- pnpm add react-native-executorch
- ```
-
-
-
-
- ```bash
- yarn add react-native-executorch
- ```
-
-
-
-
-At the end of installation a `postinstall` step downloads the native binaries your app needs (see [Selecting native libraries](#selecting-native-libraries) below). With no extra configuration it downloads everything, so you can start immediately.
-
-### 2. Install a resource fetcher
-
-Pick the adapter that matches your project. We recommend the Expo adapter when your app uses Expo; use the bare adapter for projects without Expo.
-
-#### Expo projects
+Install [`react-native-executorch`](https://www.npmjs.com/package/react-native-executorch)
+alongside its peer dependencies:
- ```bash
- npm install react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
- ```
-
-
-
-
- ```bash
- pnpm add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
- ```
+```bash
+npm install react-native-executorch react-native-worklets react-native-blob-util
+```
- ```bash
- yarn add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
- ```
-
-
-
-
-#### Bare React Native projects
-
-
-
-
- ```bash
- npm install react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
- ```
+```bash
+yarn add react-native-executorch react-native-worklets react-native-blob-util
+```
- ```bash
- pnpm add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
- ```
-
-
-
-
- ```bash
- yarn add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
- ```
+```bash
+pnpm add react-native-executorch react-native-worklets react-native-blob-util
+```
-:::warning
-Before using any other API, you must call `initExecutorch` with a resource fetcher adapter at the entry point of your app:
+:::info Requirements
+React Native ExecuTorch requires:
-```js
-import { initExecutorch } from 'react-native-executorch';
-import { ExpoResourceFetcher } from 'react-native-executorch-expo-resource-fetcher';
-// or BareResourceFetcher for bare react-native projects
+- **New Architecture** enabled
+- **React Native 0.81+** or **Expo SDK 54+** with [Development Builds](https://docs.expo.dev/develop/development-builds/introduction/) (**Expo Go is not supported** due to custom C++ native libraries)
+- **iOS 17.0+** / **Android 13+**
-initExecutorch({ resourceFetcher: ExpoResourceFetcher });
-```
-
-Calling any library API without initializing first will throw a `ResourceFetcherAdapterNotInitialized` error.
+For supported React Native versions, see the [Compatibility
+table](../05-other/01-compatibility.mdx).
:::
-Our library offers support for both bare React Native and Expo projects. Please follow the instructions from [Loading models section](https://docs.swmansion.com/react-native-executorch/docs/fundamentals/loading-models) to make sure you setup your project correctly. We encourage you to use Expo project if possible. If you are planning to migrate from bare React Native to Expo project, the link (https://docs.expo.dev/bare/installing-expo-modules/) offers a guidance on setting up Expo Modules in a bare React Native environment.
+### Selecting native libraries
-If you plan on using your models via require() instead of fetching them from a url, you also need to add following lines to your `metro.config.js`:
+The native binaries — the ExecuTorch hardware backends (XNNPACK, Core ML, MLX,
+Vulkan), and third-party binaries — are downloaded on demand at install time. By
+default, **everything is downloaded and enabled**, so no configuration is
+required to get started.
-```json
-// metro.config.js
-...
- defaultConfig.resolver.assetExts.push('pte')
- defaultConfig.resolver.assetExts.push('bin')
-...
-```
-
-This allows us to use binaries, such as exported models or tokenizers for LLMs.
-
-:::warning
-When using Expo, please note that you need to use a custom development build of your app, not the standard Expo Go app. This is because we rely on native modules, which Expo Go doesn’t support.
-:::
-
-:::info
-Because we are using ExecuTorch under the hood, you won't be able to build iOS app for release with simulator selected as the target device. Make sure to test release builds on real devices.
-:::
-
-Running the app with the library:
-
-
-
-
- ```bash
- npm run -- -d
- ```
-
-
-
-
- ```bash
- pnpm -d
- ```
-
-
-
-
- ```bash
- yarn -d
- ```
-
-
-
-
-## Selecting native libraries
-
-The native binaries React Native ExecuTorch relies on — the ExecuTorch runtime, the hardware backends (XNNPACK, Core ML, MLX, Vulkan), and OpenCV — are **downloaded on demand at install time** rather than bundled into the npm package. A `postinstall` script reads an optional `react-native-executorch` block from your app's `package.json`, fetches only the binaries your app needs, and the native build then links only those.
-
-If you omit the block, **every backend and library is downloaded and enabled** — no configuration is required to get started. Trimming the set keeps your app smaller and your builds faster.
-
-### Opting into a subset
-
-Declare what you use with any combination of `features`, `backends`, and `libs`:
+If you want a smaller app or faster installs, declare what you use in a
+`react-native-executorch` block in your `package.json`, e.g.:
```json
-// package.json
{
"react-native-executorch": {
"features": ["classification", "styleTransfer"]
@@ -205,93 +109,70 @@ Declare what you use with any combination of `features`, `backends`, and `libs`:
}
```
-- **`features`** — high-level model tasks. Each one expands to the backends and libraries it needs (see the table below). This is the recommended way to configure.
-- **`backends`** — request hardware backends directly: `xnnpack`, `coreml` (iOS), `mlx` (iOS), `vulkan` (Android).
-- **`libs`** — request extra native libraries directly: `opencv`, `phonemis`.
-
-The three lists are merged, so you can pair a `features` set with an extra `backends` / `libs` entry. After editing the block, re-run your package manager's install to re-provision (`yarn install`).
-
-### Feature → backend / lib mapping
-
-Each feature provisions the union of the backends its models are published for, so that the `DEFAULT` variant of every model in that family can resolve to the fastest export the device supports (see below).
-
-| Feature | Backends | Extra libs |
-| --- | --- | --- |
-| `llm` | xnnpack, mlx | — |
-| `multimodalLLM` | xnnpack, mlx, vulkan | opencv |
-| `privacyFilter` | xnnpack, mlx | — |
-| `speechToText` | xnnpack, coreml, mlx | — |
-| `textToSpeech` | xnnpack, mlx | phonemis |
-| `vad` | xnnpack | — |
-| `textEmbeddings` | xnnpack, mlx | — |
-| `imageEmbeddings` | xnnpack, coreml, mlx | opencv |
-| `classification` | xnnpack, coreml | opencv |
-| `objectDetection` | xnnpack, coreml | opencv |
-| `keypointDetection` | xnnpack, coreml, mlx | opencv |
-| `semanticSegmentation` | xnnpack, coreml | opencv |
-| `instanceSegmentation` | xnnpack, coreml | opencv |
-| `ocr` | xnnpack, coreml, vulkan | opencv |
-| `verticalOCR` | xnnpack | opencv |
-| `styleTransfer` | xnnpack, coreml | opencv |
-| `textToImage` | xnnpack, coreml | opencv |
-| `segmentAnything` | xnnpack, coreml | opencv |
-| `tokenizer` | — | — |
-
-### How the backends you pick change which model runs
-
-Models published for more than one backend expose their exports as named variants next to a `DEFAULT` alias:
-
-```ts
-models.classification.EFFICIENTNET_V2_S.DEFAULT; // resolved for this device
-models.classification.EFFICIENTNET_V2_S.COREML_FP16; // always this export
-models.classification.EFFICIENTNET_V2_S.XNNPACK_INT8;
-```
-
-`DEFAULT` is not a fixed file. It is resolved when the library loads, to the fastest export the device can actually run. A model is only exported to an accelerated backend once it has been shown to run better there, so a published accelerated variant is preferred and XNNPACK is the fallback:
-
-- **iOS device** — Core ML where one exists, otherwise MLX, otherwise XNNPACK.
-- **Android** — Vulkan where one exists, otherwise XNNPACK.
-- **iOS simulator** — XNNPACK. The simulator has no Neural Engine, cannot run Core ML models at all, and MLX ships a device slice only.
-- **All of them, narrowed by your config** — only backends your app downloaded are considered. Trimming `coreml` out of an iOS build moves those `DEFAULT`s to the next best export rather than failing to load.
-
-A handful of models publish both a Core ML and an MLX export. There the two are close enough that the winner is a per-model benchmark result, so the registry pins it explicitly rather than letting the order above decide. Naming any variant directly always overrides the resolution.
-
-### Platform notes
-
-- **Core ML** is iOS-only. **MLX** is iOS-only and ships the **device slice only** — the iOS simulator cannot drive MLX-on-Metal, so test MLX-backed models on a physical device.
-- **Vulkan** is Android-only.
-- **OpenCV** is provided on iOS through the `opencv-rne` CocoaPod and on Android as static libraries; any vision feature pulls it in automatically.
-- On CI, set `RNET_SKIP_DOWNLOAD=1` to skip the network download. The `rne-build-config.json` file is still written so the native build can resolve its feature flags.
-
-For how these artifacts are produced, shipped, and stitched into a build, see [Native libraries & backend splitting](./02-native-libraries.md).
-
-## Building from source
-
-To build the library from source instead, clone the repository and initialize submodules:
-
-```bash
-git clone -b release/0.9 https://github.com/software-mansion/react-native-executorch.git
-cd react-native-executorch
-
-git submodule update --init --recursive packages/react-native-executorch/third-party/common
-
-yarn
-```
-
-## Supporting new models in React Native ExecuTorch
-
-Adding new functionality to the library follows a consistent three-step integration pipeline:
-
-1. **Model Serialization:** Export PyTorch model for a specific task (e.g. object detection) into the `*.pte` format, which is optimized for the ExecuTorch runtime.
-
-2. **Native Implementation:** Develop a C++ execution layer that interfaces with the ExecuTorch runtime to handle inference. This layer also manages model-dependent logic, such as data pre-processing and post-processing.
-
-3. **TS Bindings:** Finally, implement a TypeScript API that bridges the JavaScript environment to the native C++ logic, providing a clean, typed interface for the end user.
-
-## Good reads
-
-If you want to dive deeper into ExecuTorch or our previous work with the framework, we highly encourage you to check out the following resources:
-
-- [ExecuTorch docs](https://pytorch.org/executorch/stable/index.html)
-- [React Native RAG](https://blog.swmansion.com/introducing-react-native-rag-fbb62efa4991)
-- [Offline Text Recognition on Mobile: How We Brought EasyOCR to React Native ExecuTorch](https://blog.swmansion.com/bringing-easyocr-to-react-native-executorch-2401c09c2d0c)
+The available options are:
+
+- **`features`** — high-level task names. Each one expands to the backends and
+ native libs it needs.
+- **`backends`** — hardware backends directly, e.g. `xnnpack`, `coreml`,
+ `vulkan`.
+- **`libs`** — extra native libraries, see
+ [options](../03-core-and-advanced/08-native-libraries.md#options).
+
+The three lists are merged, so you can pair a `features` set with extra
+`backends` / `libs` entries. Re-run your package manager's install after
+editing. See [Native Libraries](../03-core-and-advanced/08-native-libraries.md)
+for details.
+
+## Choose Your Path
+
+Most mobile ML libraries force you into one of two extremes: opaque native
+black boxes that implement a fixed set of pipelines with no room for
+customization, or raw low-level bindings that leave you to wire up everything
+from preprocessing to memory management yourself.
+
+What if you need a bit of both? Ready-to-use pipelines for common tasks, but
+also the freedom to drop down and build something custom when the out-of-the-box
+solution doesn't quite fit.
+That's exactly how React Native ExecuTorch is designed. The library is built
+around a clean **two-layer architecture** where the higher-level layer is
+implemented entirely on top of the lower-level one — not as separate C++ code
+hidden behind abstractions. This means:
+
+- **Pipelines are transparent.** Every task pipeline (computer vision,
+ LLM chat, etc.) is written in a few hundred lines of TypeScript — often
+ less. You can read the full input/output contracts, preprocessing, and
+ postprocessing logic in one place — no native code required.
+
+- **Custom models just work.** Plug your own `.pte` into any existing pipeline —
+ computer vision, LLM, whatever. The schema DSL declares exactly what each
+ pipeline expects (tensor shapes, data types, preprocessing), so there's no
+ guessing. Everything is in one place, readable in TypeScript.
+
+- **You can always drop down.** When built-in pipelines don't fit your use
+ case, the lower-level API gives you direct access to ExecuTorch model
+ execution, native tensor operations, high-performance math/vision operators,
+ and worklet threading. You build custom orchestration pipelines entirely in
+ TypeScript — no C++ required — with complete control over preprocessing,
+ inference, postprocessing, and memory.
+
+### High-Level Task Pipelines
+
+Have a specific problem to solve — computer vision, LLM chat, speech
+transcription? Each task has a ready-made pipeline you can drop into your app.
+Hooks handle downloading, caching, and memory disposal automatically. Imperative
+APIs give you manual control. Both work with pre-exported models from our
+[HuggingFace collection](https://huggingface.co/software-mansion/collections) or
+your own `.pte` files — as long as they match the pipeline's schema.
+
+[Explore High-Level Pipelines →](../category/extensions)
+
+### Lower-Level Runtime & Custom Pipelines
+
+Working with a custom model or chaining multiple models together into a custom
+workflow? The lower-level API gives you direct access to ExecuTorch model
+execution, native tensor operations, native operators for vision, math, NLP, and
+audio, plus worklet-based multi-threading. You write the entire pipeline in
+TypeScript using the exact same building blocks and primitives we use to build
+the library's built-in extensions — no native C++ required.
+
+[Explore Lower-Level API →](../category/core--advanced)
diff --git a/docs/docs/01-fundamentals/02-downloading-models.md b/docs/docs/01-fundamentals/02-downloading-models.md
new file mode 100644
index 0000000000..66b2ada3ca
--- /dev/null
+++ b/docs/docs/01-fundamentals/02-downloading-models.md
@@ -0,0 +1,158 @@
+---
+title: Downloading Models
+slug: /fundamentals/downloading-models
+description: 'How model files reach the device — the pre-exported model registry, automatic download and caching in hooks, and the imperative download API with progress and cancellation.'
+keywords:
+ [
+ react native executorch,
+ download model,
+ model cache,
+ useResourceDownload,
+ download,
+ on-device ai,
+ pte,
+ ]
+---
+
+# Downloading Models
+
+A model config is one or more files — the `.pte` program, and often a tokenizer,
+phonemizer, or label map alongside it — that have to be present on the device
+before inference can run. React Native ExecuTorch downloads those files for you
+and caches them persistently, so in most apps you never touch the filesystem
+directly: you point a pipeline at a model config and the library fetches whatever isn't
+already cached.
+
+## Where models come from
+
+A model source is either remote or local:
+
+- **Pre-exported models** live in our
+ [HuggingFace collection](https://huggingface.co/software-mansion/collections) and
+ are addressed through the
+ [`models`](../06-api-reference/variables/models.md) registry. Each entry bundles
+ every file a pipeline needs behind one object. This registry is the single source
+ of truth for the tuned, ready-to-run models.
+- **Your own models** are plain URLs or local paths — a file bundled with the app,
+ a `file://` path, or a URL on your own host (see
+ [Exporting Custom Models](../03-core-and-advanced/07-exporting-custom-models.md)).
+
+Local paths are always passed through untouched; only `http(s)` URLs are ever
+downloaded.
+
+## Automatic downloading with hooks
+
+The [`use`](../category/extensions) hooks and the
+[`useResourceDownload`](../06-api-reference/functions/useResourceDownload.md) hook
+download and cache a model's files automatically. Pass a config; the hook fetches
+anything not already cached, reports progress, and hands back the same config with
+every URL replaced by its local path.
+
+```typescript
+import { useResourceDownload, models } from 'react-native-executorch';
+
+function Example() {
+ const { resource, downloadProgress, downloadError } = useResourceDownload(
+ models.classification.EFFICIENTNET_V2_S.XNNPACK_FP32
+ );
+
+ // resource is undefined until the download resolves, then mirrors the config
+ // with local file paths, ready to hand to a pipeline.
+}
+```
+
+Both hooks accept
+[`ResourceOptions`](../06-api-reference/type-aliases/ResourceOptions.md):
+
+- [**`preventLoad`**](../06-api-reference/type-aliases/ResourceOptions.md#preventload) —
+ skip the download entirely (and reset state), for deferring a fetch until the
+ user opts in.
+- [**`forceDownload`**](../06-api-reference/type-aliases/ResourceOptions.md#forcedownload) —
+ re-fetch even when cached, to replace a corrupted file or pick up a model that
+ changed behind a stable URL.
+
+## Imperative downloading
+
+When you're not in a component — a background task, a custom pipeline, a
+preloading step — use the imperative
+[`download`](../06-api-reference/functions/download.md) function. It takes a URL,
+or any nested object/array of them (typically a whole model config), downloads
+every remote leaf, and resolves with the same value with URLs replaced by local
+paths — ready to pass straight to a `create` factory:
+
+```typescript
+import { download, models } from 'react-native-executorch';
+
+const model = await download(models.classification.EFFICIENTNET_V2_S.XNNPACK_FP32, {
+ onProgress: (p) => console.log(`${Math.round(p * 100)}%`),
+});
+
+// `model` now holds local paths; hand it to a pipeline factory
+```
+
+[`DownloadOptions`](../06-api-reference/interfaces/DownloadOptions.md) covers the
+common needs:
+
+- [**`onProgress(p)`**](../06-api-reference/interfaces/DownloadOptions.md#onprogress) —
+ overall progress in `[0, 1]`, weighted by each file's byte size so a large model
+ isn't reported the same as a small tokenizer.
+- [**`signal`**](../06-api-reference/interfaces/DownloadOptions.md#signal) — an
+ `AbortSignal` to cancel. The bytes fetched so far are kept so a later download
+ of the same source resumes instead of restarting (except on Android without
+ the optional background downloader, where the system `DownloadManager` discards
+ a cancelled transfer).
+- [**`forceDownload`**](../06-api-reference/interfaces/DownloadOptions.md#forcedownload) —
+ re-download even when cached.
+
+## Caching behavior
+
+Downloads go to a persistent cache keyed by URL, and this is what keeps repeat
+launches fast:
+
+- A file that is already cached resolves immediately — no network round trip.
+- Concurrent downloads of the same URL are deduplicated into one transfer.
+- Without extra dependencies, fetching falls back to what each platform supports
+ natively: the system `DownloadManager` on Android (which continues in the
+ background), and a streaming request on iOS (which pauses when the app is
+ suspended and resumes when reopened).
+- To keep transfers running in the background across both iOS and Android and survive
+ the app being killed, install the optional peer dependency
+ [`@kesha-antonov/react-native-background-downloader`](https://github.com/kesha-antonov/react-native-background-downloader)
+ (`>=4.4.0`). The library detects and uses it automatically with zero extra configuration.
+
+Use `forceDownload` to bypass the cache and replace a file. Otherwise, downloading
+the same model again is effectively free.
+
+## Anonymous Telemetry & Download Counter
+
+When downloading pre-exported models from our Hugging Face repositories, the fetcher
+pings Hugging Face's standard model download counter (via a lightweight `HEAD` request
+to `config.json`). However, because Hugging Face's built-in metrics can be delayed or
+inconsistent for direct file downloads, the library also sends a lightweight, anonymous
+download event to Software Mansion. This exists solely to help us understand which
+models community members rely on and prioritize maintenance and optimizations accordingly.
+No user data, device IDs, IP addresses, or personally identifiable information are ever
+stored or tracked.
+
+Telemetry is enabled by default. To opt out, call
+[`setTelemetryEnabled(false)`](../06-api-reference/functions/setTelemetryEnabled.md)
+once at application startup:
+
+```typescript
+import { setTelemetryEnabled } from 'react-native-executorch';
+
+// Opt out of anonymous download analytics
+setTelemetryEnabled(false);
+```
+
+## Where to go next
+
+- [Getting Started](./01-getting-started.md) — install the library and run your first model.
+- [Exporting Custom Models](../03-core-and-advanced/07-exporting-custom-models.md) — bring your own `.pte` and match a pipeline.
+- [Models & Tensors](../03-core-and-advanced/02-models-and-tensors.md) — load a downloaded `.pte` directly with the lower-level API.
+
+### API reference
+
+- [`download()`](../06-api-reference/functions/download.md) · [`DownloadOptions`](../06-api-reference/interfaces/DownloadOptions.md)
+- [`useResourceDownload()`](../06-api-reference/functions/useResourceDownload.md) · [`ResourceOptions`](../06-api-reference/type-aliases/ResourceOptions.md)
+- [`setTelemetryEnabled()`](../06-api-reference/functions/setTelemetryEnabled.md) · [`models`](../06-api-reference/variables/models.md)
diff --git a/docs/docs/01-fundamentals/02-native-libraries.md b/docs/docs/01-fundamentals/02-native-libraries.md
deleted file mode 100644
index eaf1bb7ab1..0000000000
--- a/docs/docs/01-fundamentals/02-native-libraries.md
+++ /dev/null
@@ -1,183 +0,0 @@
----
-title: Native Libraries & Backend Splitting
-slug: /fundamentals/native-libraries
-description: 'How React Native ExecuTorch produces, ships, and links its native binaries on demand, with each ExecuTorch backend split into its own downloadable artifact.'
-keywords:
- [
- react native executorch,
- executorch,
- native libraries,
- backend splitting,
- xnnpack,
- coreml,
- mlx,
- vulkan,
- on-device ai,
- ]
----
-
-This page explains how the native dependencies (the ExecuTorch runtime, the hardware backends, OpenCV) are produced, shipped, and stitched into an app build. For the app-author summary — how to opt into a subset — see the [Selecting native libraries](./01-getting-started.md#selecting-native-libraries) section of Getting Started. This page is aimed at maintainers and anyone curious about how the split works under the hood.
-
-## Why split the backends?
-
-Every backend (XNNPACK, Core ML, MLX, Vulkan) and OpenCV adds size and build time. Instead of bundling one monolithic native library with everything baked in, each backend ships as its **own downloadable artifact**, and an app pulls only the ones it declares. The result is smaller apps and faster builds, with the full set still available by default.
-
-## High-level flow
-
-```
- ┌──────────────────────┐ ┌────────────────────────┐ ┌───────────────────────┐
- │ ExecuTorch fork │ ───▶ │ GitHub Release v │ ───▶ │ postinstall script │
- │ rne-split-build │ │ .tar.gz │ │ download-libs.js │
- │ │ │ .tar.gz.256 │ │ │
- └──────────────────────┘ └────────────────────────┘ └───────────┬───────────┘
- │
- ▼
- ┌───────────────────────┐
- │ third-party/android │
- │ third-party/ios │
- │ third-party/include │
- │ rne-build-config.json│
- └───────────┬───────────┘
- │
- ┌─────────────────────────────────┴───────────────────────────┐
- ▼ ▼
- ┌───────────────────────┐ ┌──────────────────────────┐
- │ android/ │ │ react-native-executorch │
- │ build.gradle.kts │ │ .podspec │
- │ + CMakeLists.txt │ │ RNE_ENABLE_* │
- │ -DRNE_ENABLE_* │ │ force_load xcframeworks │
- └───────────────────────┘ └──────────────────────────┘
-```
-
-## Install-time: `scripts/download-libs.js`
-
-Runs at `postinstall`. Responsibilities:
-
-1. Read `react-native-executorch.{backends, libs, features}` from the app's `package.json` (via `INIT_CWD`). Each array is optional; `features` is expanded through `FEATURE_MAP` into (backends, libs) and merged with the explicit arrays. With no config, everything defaults to enabled. The legacy `extras` field is rejected with a migration error.
-2. Write `rne-build-config.json` at the package root with boolean flags (`enableXnnpack`, `enableCoreml`, `enableMlx`, `enableVulkan`, `enableOpencv`, `enablePhonemis`). This file is the single source of truth consumed by both the Gradle build and the podspec.
-3. Detect targets (`ios` on macOS; always `android-arm64-v8a` and, unless `RNET_NO_X86_64` is set, `android-x86_64`).
-4. For each target × enabled backend/lib, fetch the matching `.tar.gz` from the GitHub Release tagged `v`, verify its `.sha256`, and extract it into `third-party/`. Platform-independent headers ride in a single always-downloaded `headers.tar.gz`.
-5. Cache validated tarballs under `~/.cache/react-native-executorch//` so later installs skip the network.
-
-Environment overrides: `RNET_SKIP_DOWNLOAD`, `RNET_HEADERS_ONLY` (fetch only `headers.tar.gz`, no native libs — e.g. for clang-tidy / IDE tooling), `RNET_LIBS_CACHE_DIR`, `RNET_TARGET`, `RNET_NO_X86_64`, `RNET_BASE_URL` (point it at a local `python3 -m http.server` serving `dist-artifacts/` for local iteration), and `GITHUB_TOKEN` (needed for draft releases).
-
-The artifacts per target:
-
-| Artifact name | Target | Contents |
-| ------------------------ | ------- | -------------------------------------------------------------- |
-| `headers` | any | ExecuTorch + c10/torch + tokenizer + OpenCV headers (platform-independent) |
-| `core-android-arm64-v8a` | Android | `libexecutorch.so` (no backends) + the ABI-independent `executorch.jar` |
-| `core-android-x86_64` | Android | x86_64 `libexecutorch.so` for the emulator |
-| `xnnpack-android-*` | Android | `libxnnpack_executorch_backend.so` (separately loaded) |
-| `vulkan-android-*` | Android | `libvulkan_executorch_backend.so` (separately loaded) |
-| `opencv-android-*` | Android | Static OpenCV + KleidiCV HAL |
-| `core-ios` | iOS | `ExecutorchLib.xcframework` + merged ExecuTorch `.a` slices |
-| `xnnpack-ios` | iOS | `XnnpackBackend.xcframework` |
-| `coreml-ios` | iOS | `CoreMLBackend.xcframework` |
-| `mlx-ios` | iOS | `MLXBackend.xcframework` (device slice only) + `mlx.metallib` |
-
-iOS OpenCV is **not** a tarball — it is consumed through the `opencv-rne` CocoaPod. `phonemis` has **no** tarball either — it is a git submodule at `third-party/common/phonemis` compiled from source when enabled.
-
-### Header provenance
-
-`headers.tar.gz` is assembled by `scripts/vendor-headers.sh`, which is needed because the executorch header surface spans **four** sources — a copy of the CMake install tree alone is incomplete (it omits the source-only headers such as `extension/llm/{runner,custom_ops,apple}`, which the rewrite's LLM/multimodal tasks compile against directly):
-
-1. **ExecuTorch C++ source headers** (`runtime`, `extension`, `kernels`, … from the executorch checkout) — the full public surface incl. the LLM runner helpers and the bundled tokenizer third-party (`abseil-cpp`/`re2`/`json`/…).
-2. **Build-generated / installed headers** (`cmake-out*/include`) — flatbuffer `*_generated.h` and codegen'd `kernels/*/Functions.h`.
-3. **c10 / torch** from the assembled `executorch.xcframework` public headers.
-4. **opencv2** from the OpenCV prebuilt (same source as the `opencv-rne` pod), since OpenCV is not built from executorch.
-
-Run it before `package-release-artifacts.sh`:
-
-```bash
-./scripts/vendor-headers.sh
-```
-
-Headers are **downloaded, not committed**.
-
-## Build-time: Android
-
-`android/build.gradle.kts` reads `rne-build-config.json` once (via `JsonSlurper`, falling back to all-on if the file is missing) and forwards the booleans to CMake:
-
-```kotlin
-"-DRNE_ENABLE_OPENCV=${rneFlag("enableOpencv")}",
-"-DRNE_ENABLE_PHONEMIS=${rneFlag("enablePhonemis")}",
-"-DRNE_ENABLE_XNNPACK=${rneFlag("enableXnnpack")}",
-"-DRNE_ENABLE_VULKAN=${rneFlag("enableVulkan")}"
-```
-
-It also honours the app's `reactNativeArchitectures` Gradle property, so a device build that requests only `arm64-v8a` provisions and links only that ABI.
-
-`android/CMakeLists.txt` responds by:
-
-- Adding `-DRNE_ENABLE_OPENCV` / `-DRNE_ENABLE_PHONEMIS` compile definitions so C++ code can `#ifdef` around optional dependencies.
-- Compiling the OpenCV-dependent source group and linking the static `libopencv_*.a` + KleidiCV HAL (arm64 only) when `RNE_ENABLE_OPENCV=ON`.
-- Always importing and linking the prebuilt `libexecutorch.so` from `third-party/android/libs/executorch//`.
-- When `RNE_ENABLE_XNNPACK=ON` / `RNE_ENABLE_VULKAN=ON`, importing the matching `libxnnpack_executorch_backend.so` / `libvulkan_executorch_backend.so` and linking against it. Linking (rather than `dlopen`) lets Gradle bundle the `.so` into the APK and makes the dynamic linker load it whenever the main library loads — each backend's load-time constructor then registers itself with the runtime in `libexecutorch.so`.
-- Statically linking the OpenMP runtime (`-fopenmp -static-openmp`) to resolve the optimized-kernel symbols `libexecutorch.so` references.
-
-## Build-time: iOS
-
-`react-native-executorch.podspec` reads the same `rne-build-config.json` and:
-
-- Excludes the OpenCV C++ source group from compilation when `enableOpencv` is false.
-- Appends `-DRNE_ENABLE_*` to `OTHER_CPLUSPLUSFLAGS`.
-- Assembles `OTHER_LDFLAGS` with a `-force_load` entry for each enabled backend xcframework. MLX is force-loaded on the **device slice only** (`sdk=iphoneos*`).
-- Vendors `ExecutorchLib.xcframework` only — the backend xcframeworks live on the linker command line, never in the CocoaPods vendoring list (see below for why).
-- Adds the `opencv-rne` pod dependency, the `CoreML` / `Metal` system frameworks, and the `mlx.metallib` bundle resource conditionally, based on which backends are enabled.
-
-## Why backends must be force-loaded
-
-ExecuTorch registers kernels statically via `__attribute__((constructor))` functions inside each backend's `.a` / `.so`. Two consequences:
-
-1. **Force-load is required.** Linkers drop unreferenced object files. The registrar symbols have no external callers (they run as global constructors at load time), so a plain link keeps the backend library on disk but strips the registration symbols — and the app then fails with `Missing operator: ...` at inference. Every backend library must be force-loaded (`-force_load` on iOS, `--whole-archive` on Android).
-2. **Exactly one copy of each CPU-kernel registration must exist.** Multiple backend libraries that each whole-archive-link the CPU ops cause duplicate-registration aborts when both are force-loaded into the same process.
-
-On **iOS** each backend ships as its own static xcframework and the podspec force-loads only the opted-in ones; `ExecutorchLib.xcframework` itself does not whole-archive the CPU ops, so there is no duplication. On **Android** the fork builds each backend as a standalone shared library (`EXECUTORCH_BUILD_XNNPACK_BACKEND_SHARED` / `EXECUTORCH_BUILD_VULKAN_BACKEND_SHARED`) that links only its own archive plus `executorch_core` — no kernel-registration archives — so loading it on top of `libexecutorch.so` duplicates nothing.
-
-## Building the artifacts
-
-The binaries come from the ExecuTorch fork [`software-mansion-labs/executorchrne-split-build`](https://github.com/software-mansion-labs/executorch/tree/rne-split-build), which is already on ExecuTorch **1.3.1** (the same version as `main`). Bumping the `react-native-executorch` package version means re-rolling the Release artifacts from the corresponding fork commit.
-
-> **MLX-iOS note.** Building the iOS MLX backend requires the MLX-iOS work that lives in the `@nk/mlx-ios` line. That branch merges into `rne-split-build` conflict-free; after the merge a single `build_apple_frameworks.sh --Release` pass produces the full set including a real `libbackend_mlx_ios.a` and `mlx.metallib`. Only the **device** slice is built and shipped — the iOS simulator cannot drive MLX-on-Metal.
-
-### Android
-
-From the fork (with `rne-split-build` checked out), per ABI:
-
-```bash
-export ANDROID_NDK=$HOME/Library/Android/sdk/ndk/27.1.12297006
-EXECUTORCH_BUILD_VULKAN=ON \
-EXECUTORCH_BUILD_VULKAN_BACKEND_SHARED=ON \
-EXECUTORCH_BUILD_XNNPACK_BACKEND_SHARED=ON \
-ANDROID_ABI=arm64-v8a ./scripts/build_android_library.sh # repeat with x86_64
-```
-
-This emits `libexecutorch.so`, `libxnnpack_executorch_backend.so`, and `libvulkan_executorch_backend.so`. Strip each with the NDK `llvm-strip` before packaging.
-
-### iOS
-
-```bash
-rm -rf cmake-out
-./scripts/build_apple_frameworks.sh --Release
-```
-
-This produces the merged per-slice `.a` archives. RNE's `third-party/ios/ExecutorchLib/build.sh` then repackages them into `ExecutorchLib.xcframework` plus the per-backend xcframeworks (`XnnpackBackend`, `CoreMLBackend`, `MLXBackend`). CocoaPods requires the library file name to be identical across an xcframework's slices, which is why `build.sh` renames each slice before calling `xcodebuild -create-xcframework`.
-
-### Packaging and uploading
-
-Stage the built outputs into `third-party/`, then run:
-
-```bash
-./scripts/package-release-artifacts.sh
-```
-
-This writes every `.tar.gz` + `.sha256` into `dist-artifacts/`. Upload all of them as assets on the `v` GitHub Release. To test the download flow before publishing, serve the directory locally and point the script at it:
-
-```bash
-cd packages/react-native-executorch/dist-artifacts
-python3 -m http.server 8080 &
-RNET_BASE_URL=http://localhost:8080 yarn install
-```
-
-The same checksum verification runs, so a stale cache is still rejected.
diff --git a/docs/docs/01-fundamentals/03-migrating-from-v0-9.md b/docs/docs/01-fundamentals/03-migrating-from-v0-9.md
new file mode 100644
index 0000000000..caa45f06d9
--- /dev/null
+++ b/docs/docs/01-fundamentals/03-migrating-from-v0-9.md
@@ -0,0 +1,8 @@
+---
+title: Migrating from v0.9.x
+description: Step-by-step migration guide from legacy v0.9.x to the new v0.10.0 architecture.
+---
+
+# Migrating from v0.9.x
+
+_Coming soon._
diff --git a/docs/docs/01-fundamentals/_category_.json b/docs/docs/01-fundamentals/_category_.json
index e3fddcbebd..1c973af3ad 100644
--- a/docs/docs/01-fundamentals/_category_.json
+++ b/docs/docs/01-fundamentals/_category_.json
@@ -1,6 +1,4 @@
{
"label": "Fundamentals",
- "link": {
- "type": "generated-index"
- }
+ "position": 1
}
diff --git a/docs/docs/02-extensions/_category_.json b/docs/docs/02-extensions/_category_.json
new file mode 100644
index 0000000000..33d71173d8
--- /dev/null
+++ b/docs/docs/02-extensions/_category_.json
@@ -0,0 +1,8 @@
+{
+ "label": "Extensions",
+ "position": 2,
+ "link": {
+ "type": "generated-index",
+ "description": "Ready-to-use pipelines for common on-device AI tasks."
+ }
+}
diff --git a/docs/docs/02-extensions/computer-vision/02-image-classification.md b/docs/docs/02-extensions/computer-vision/02-image-classification.md
new file mode 100644
index 0000000000..307334976b
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/02-image-classification.md
@@ -0,0 +1,217 @@
+---
+title: Image Classification
+slug: /extensions/image-classification
+description: 'Classify images on-device into categories using pre-trained computer vision models like EfficientNetV2.'
+keywords:
+ [
+ react native,
+ image classification,
+ image recognition,
+ mobile ml,
+ on-device ai,
+ efficientnet,
+ imagenet,
+ ]
+---
+
+# Image Classification
+
+Image classification analyzes an input image and predicts the most likely visual
+categories it belongs to, along with confidence scores for each prediction.
+Unlike object detection (which locates multiple items with bounding boxes),
+classification evaluates the image as a whole.
+
+It is ideal for visual search, photo organization, quality inspection, and
+accessibility tagging. Because inference runs entirely on-device, images never
+leave the user's phone.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useClassifier`](../../06-api-reference/functions/useClassifier.md) hook handles model downloading, initialization, and lifecycle management:
+
+```tsx
+import { models, useClassifier } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const classifier = useClassifier(models.classification.EFFICIENTNET_V2_S.DEFAULT);
+
+ // Hook state:
+ // classifier.isReady — true once model is downloaded and loaded in memory
+ // classifier.downloadProgress — 0 to 100 download progress
+ // classifier.error — Error instance if download or load failed
+
+ const handleClassify = async (imageBuffer: ImageBuffer) => {
+ if (!classifier.isReady || !classifier.classify) return;
+
+ // Run inference on background thread
+ const predictions = await classifier.classify(imageBuffer, { topk: 3 });
+ console.log('Top prediction:', predictions[0]);
+ };
+
+ // Trigger handleClassify from an image picker, button press, or camera frame
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/image-classification.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen with photo picker, result overlays, and latency tracking.
+:::
+
+## Output Format
+
+[`classify()`](../../06-api-reference/type-aliases/Classifier.md#classify) returns an array of [`Classification`](../../06-api-reference/type-aliases/Classification.md) objects sorted from highest to lowest confidence:
+
+```typescript
+type Classification = {
+ /** The predicted class label string */
+ readonly label: L;
+ /** Normalized confidence score between 0.0 and 1.0 */
+ readonly confidence: number;
+};
+```
+
+Example result:
+
+```json
+[
+ { "label": "golden_retriever", "confidence": 0.912 },
+ { "label": "cocker_spaniel", "confidence": 0.043 },
+ { "label": "labrador_retriever", "confidence": 0.018 }
+]
+```
+
+## Configuration & Options
+
+Pass a [`ClassifyOptions`](../../06-api-reference/type-aliases/ClassifyOptions.md) object to [`classify()`](../../06-api-reference/type-aliases/Classifier.md#classify):
+
+| Option | Type | Default | Description |
+| :-------------------------------------------------------------------- | :------- | :---------- | :-------------------------------------------------------------------------------------------------------- |
+| [`topk`](../../06-api-reference/type-aliases/ClassifyOptions.md#topk) | `number` | `undefined` | Maximum number of top-scoring predictions to return. When omitted, returns all classes in the vocabulary. |
+
+## Imperative API
+
+For background jobs, headless services, or manual lifecycle management outside React components, instantiate the pipeline directly with [`createClassifier`](../../06-api-reference/functions/createClassifier.md):
+
+```typescript
+import { createClassifier, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.classification.EFFICIENTNET_V2_S.DEFAULT);
+const classifier = await createClassifier(model);
+
+try {
+ const results = await classifier.classify(imageBuffer, { topk: 5 });
+ console.log('Top prediction:', results[0]);
+} finally {
+ // Always release native resources when finished
+ classifier.dispose();
+}
+```
+
+## Synchronous Execution
+
+For high-throughput loops like camera frame processors, [`createClassifier`](../../06-api-reference/functions/createClassifier.md)
+exposes a synchronous [`classifyWorklet`](../../06-api-reference/type-aliases/Classifier.md#classifyworklet) function. This executes directly inside
+a worklet runtime without Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a VisionCamera frame processor on the UI worklet thread
+const results = classifier.classifyWorklet(frameBuffer, { topk: 1 });
+```
+
+See [Worklets &
+Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details
+on dispatching tasks and sharing models across threads.
+
+## Available Models
+
+The library provides ready-to-use models from the [Software Mansion HuggingFace Classification Collection](https://huggingface.co/collections/software-mansion/classification), pre-configured with ImageNet-1k vocabulary and normalization parameters in [`models.classification`](../../06-api-reference/variables/models.md#classification):
+
+| Model Family | Variants | Size Range | Supported Backends | Dataset / Vocabulary | Notes |
+| :------------------- | :-------------------------------------------------------------------------------- | :---------------- | :----------------------------- | :------------------------------------------------------------------------------------------- | :----------------------------------------------------------------- |
+| **EfficientNetV2-S** | [See](../../06-api-reference/variables/models.md#classificationefficientnet_v2_s) | 21.9 MB – 81.7 MB | XNNPACK (CPU), Core ML (Apple) | [`IMAGENET1K_LABELS`](../../06-api-reference/variables/IMAGENET1K_LABELS.md) (1,000 classes) | Fast, lightweight general image recognition and tagging on mobile. |
+
+:::tip Using Custom Models
+To use your own fine-tuned classification `.pte` model, pass a
+[`ClassifierModel`](../../06-api-reference/type-aliases/ClassifierModel.md)
+configuration object to [`useClassifier`](../../06-api-reference/functions/useClassifier.md) or [`createClassifier`](../../06-api-reference/functions/createClassifier.md):
+
+```typescript
+const customClassifier = await createClassifier({
+ modelPath: 'https://example.com/my-model.pte',
+ modelOpts: {
+ resizeMode: 'stretch',
+ interpolation: 'linear',
+ normalizeOpts: { alpha: 1 / 255.0, beta: 0.0 },
+ labels: ['cat', 'dog', 'bird'],
+ },
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output
+shapes match its requirements. To prepare and export your own `.pte` model to
+match this pipeline, see [Exporting Custom
+Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useClassifier()`](../../06-api-reference/functions/useClassifier.md) — React hook for model downloading, inference state, and automatic memory cleanup.
+- [`createClassifier()`](../../06-api-reference/functions/createClassifier.md) — Imperative factory for background jobs, services, and worklet execution.
+
+### Types & Options
+
+- [`Classifier`](../../06-api-reference/type-aliases/Classifier.md) — Classifier task runner interface with `classify` and [`classifyWorklet`](../../06-api-reference/type-aliases/Classifier.md#classifyworklet).
+- [`Classification`](../../06-api-reference/type-aliases/Classification.md) — Result prediction object with [`label`](../../06-api-reference/type-aliases/Classification.md#label) and [`confidence`](../../06-api-reference/type-aliases/Classification.md#confidence).
+- [`ClassifyOptions`](../../06-api-reference/type-aliases/ClassifyOptions.md) — Configuration options for the `classify` call (`topk`).
+- [`ClassifierModel`](../../06-api-reference/type-aliases/ClassifierModel.md) — Model configuration spec for custom and preset models.
+- [`ClassifierOptions`](../../06-api-reference/type-aliases/ClassifierOptions.md) — Preprocessing and label vocabulary configuration.
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Input image buffer structure (`data`, `width`, `height`, `format`).
+
+### Model Presets
+
+- [`models.classification`](../../06-api-reference/variables/models.md#classification) — Pre-configured classification models registry.
diff --git a/docs/docs/02-extensions/computer-vision/03-object-detection.md b/docs/docs/02-extensions/computer-vision/03-object-detection.md
new file mode 100644
index 0000000000..e874478e72
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/03-object-detection.md
@@ -0,0 +1,230 @@
+---
+title: Object Detection
+slug: /extensions/object-detection
+description: 'Locate and classify multiple objects in images with bounding boxes using real-time models like SSDLite, YOLO26, and RF-DETR.'
+keywords:
+ [
+ react native,
+ object detection,
+ bounding box,
+ ssdlite,
+ yolo,
+ yolo26,
+ rfdetr,
+ coco,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Object Detection
+
+Object detection locates and classifies multiple objects within an image. For every detected item, the model predicts its category label, confidence score, and exact bounding box coordinates scaled to the original image dimensions.
+
+Unlike image classification (which predicts a single label for the entire scene), object detection tells you both **what** objects are present and **where** they are located. It is used for real-time camera tracking, retail item recognition, document scanning, robotics, and augmented reality.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useObjectDetector`](../../06-api-reference/functions/useObjectDetector.md) hook manages model downloading, initialization, and lifecycle:
+
+```tsx
+import { models, useObjectDetector } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const detector = useObjectDetector(models.objectDetection.SSDLITE320_MOBILENET_V3_LARGE.DEFAULT);
+
+ // Hook state:
+ // detector.isReady — true once model is downloaded and loaded in memory
+ // detector.downloadProgress — 0 to 100 download progress
+ // detector.error — Error instance if download or load failed
+
+ const handleDetect = async (imageBuffer: ImageBuffer) => {
+ if (!detector.isReady || !detector.detectObjects) return;
+
+ // Run inference on background thread
+ const detections = await detector.detectObjects(imageBuffer, {
+ confidenceThreshold: 0.5,
+ iouThreshold: 0.55,
+ });
+ console.log('Detected objects:', detections);
+ };
+
+ // Trigger handleDetect from an image picker, button press, or camera frame
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/object-detection.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen with photo picker, bounding box overlays, and latency tracking.
+:::
+
+## Output Format
+
+[`detectObjects()`](../../06-api-reference/type-aliases/ObjectDetector.md#detectobjects) returns an array of [`ObjectDetection`](../../06-api-reference/type-aliases/ObjectDetection.md) objects:
+
+```typescript
+type ObjectDetection = {
+ /** Scaled bounding box coordinates matching the input image dimensions */
+ readonly box: BoundingBox;
+ /** Predicted object class label */
+ readonly label: L;
+ /** Confidence score of the detection (between 0.0 and 1.0) */
+ readonly confidence: number;
+};
+```
+
+For `'xyxy'` format (default), [`box`](../../06-api-reference/type-aliases/ObjectDetection.md#box) contains pixel coordinates:
+
+```json
+[
+ {
+ "box": { "format": "xyxy", "xmin": 34.5, "ymin": 112.0, "xmax": 240.2, "ymax": 380.7 },
+ "label": "dog",
+ "confidence": 0.89
+ },
+ {
+ "box": { "format": "xyxy", "xmin": 310.0, "ymin": 85.3, "xmax": 520.1, "ymax": 410.0 },
+ "label": "person",
+ "confidence": 0.94
+ }
+]
+```
+
+## Configuration & Options
+
+Pass a [`DetectObjectsOptions`](../../06-api-reference/type-aliases/DetectObjectsOptions.md) object to [`detectObjects()`](../../06-api-reference/type-aliases/ObjectDetector.md#detectobjects) to override model defaults:
+
+| Option | Type | Default | Description |
+| :------------------------------------------------------------------------------------------------------- | :------- | :-------------------------- | :----------------------------------------------------------------------------------------------------------------------- |
+| [`confidenceThreshold`](../../06-api-reference/type-aliases/DetectObjectsOptions.md#confidencethreshold) | `number` | Model default (e.g. `0.5`) | Minimum confidence score for a box to be retained (0.0 to 1.0). |
+| [`iouThreshold`](../../06-api-reference/type-aliases/DetectObjectsOptions.md#iouthreshold) | `number` | Model default (e.g. `0.55`) | Intersection over Union (IoU) threshold for Non-Maximum Suppression (NMS). Lower values suppress more overlapping boxes. |
+
+## Imperative API
+
+For background tasks or headless usage outside React components, create the detector using [`createObjectDetector`](../../06-api-reference/functions/createObjectDetector.md):
+
+```typescript
+import { createObjectDetector, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.objectDetection.SSDLITE320_MOBILENET_V3_LARGE.DEFAULT);
+const detector = await createObjectDetector(model);
+
+try {
+ const detections = await detector.detectObjects(imageBuffer, {
+ confidenceThreshold: 0.4,
+ });
+ console.log('Detections:', detections);
+} finally {
+ // Always release native resources when finished
+ detector.dispose();
+}
+```
+
+## Synchronous Execution
+
+For high-throughput loops like camera frame processors, [`createObjectDetector`](../../06-api-reference/functions/createObjectDetector.md) exposes a synchronous [`detectObjectsWorklet`](../../06-api-reference/type-aliases/ObjectDetector.md#detectobjectsworklet) function. This runs directly on the worklet thread with zero Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a VisionCamera frame processor on the UI worklet thread
+const detections = detector.detectObjectsWorklet(frameBuffer, {
+ confidenceThreshold: 0.5,
+});
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides ready-to-use detectors from the [Software Mansion HuggingFace Object Detection Collection](https://huggingface.co/collections/software-mansion/object-detection), trained on the 80-category COCO dataset and available in [`models.objectDetection`](../../06-api-reference/variables/models.md#objectdetection):
+
+| Model Family | Variants | Size Range | Supported Backends | Dataset / Vocabulary | Notes |
+| :------------------------- | :--------------------------------------------------------------------------------------------- | :----------------- | :----------------------------- | :---------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------ |
+| **SSDLite320 MobileNetV3** | [See](../../06-api-reference/variables/models.md#objectdetectionssdlite320_mobilenet_v3_large) | 8.1 MB – 13.3 MB | XNNPACK (CPU), Core ML (Apple) | [`COCO_CLASSES`](../../06-api-reference/variables/COCO_CLASSES.md) (80 classes) | Ultra-lightweight detector with highest frame rates on low-end devices. |
+| **RF-DETR Nano** | [See](../../06-api-reference/variables/models.md#objectdetectionrfdetr_nano) | 52.2 MB – 106.4 MB | XNNPACK (CPU), Core ML (Apple) | [`COCO_CLASSES`](../../06-api-reference/variables/COCO_CLASSES.md) (80 classes) | DINOv2-based detection transformer with superior small-object accuracy. |
+| **YOLO26** | [See](../../06-api-reference/variables/models.md#objectdetectionyolo26) | 5.4 MB – 212.9 MB | XNNPACK (CPU), Core ML (Apple) | [`COCO_CLASSES_YOLO`](../../06-api-reference/variables/COCO_CLASSES_YOLO.md) (80 classes) | Scalable real-time detection family across 384x384, 512x512, and 640x640 resolutions. |
+
+:::tip Using Custom Models
+To use your own fine-tuned object detection `.pte` model, pass an [`ObjectDetectorModel`](../../06-api-reference/type-aliases/ObjectDetectorModel.md) configuration object to [`useObjectDetector`](../../06-api-reference/functions/useObjectDetector.md) or [`createObjectDetector`](../../06-api-reference/functions/createObjectDetector.md):
+
+```typescript
+const customDetector = await createObjectDetector({
+ modelPath: 'https://example.com/my-detector.pte',
+ modelOpts: {
+ labels: ['hardhat', 'vest', 'boots'],
+ boxFormat: 'xyxy',
+ resizeMode: 'stretch',
+ interpolation: 'linear',
+ normalizeOpts: { alpha: 1 / 255.0, beta: 0.0 },
+ defaultConfidenceThreshold: 0.4,
+ defaultIouThreshold: 0.5,
+ },
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output shapes match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useObjectDetector()`](../../06-api-reference/functions/useObjectDetector.md) — React hook for object detector downloading, state, and lifecycle.
+- [`createObjectDetector()`](../../06-api-reference/functions/createObjectDetector.md) — Imperative factory for object detector task pipelines.
+
+### Types & Options
+
+- [`ObjectDetector`](../../06-api-reference/type-aliases/ObjectDetector.md) — Object detector instance interface (`detectObjects`, [`detectObjectsWorklet`](../../06-api-reference/type-aliases/ObjectDetector.md#detectobjectsworklet)).
+- [`ObjectDetection`](../../06-api-reference/type-aliases/ObjectDetection.md) — Single detection result with `box`, `label`, and `confidence`.
+- [`DetectObjectsOptions`](../../06-api-reference/type-aliases/DetectObjectsOptions.md) — Inference options (`confidenceThreshold`, `iouThreshold`).
+- [`ObjectDetectorModel`](../../06-api-reference/type-aliases/ObjectDetectorModel.md) — Object detector configuration spec.
+- [`ObjectDetectorOptions`](../../06-api-reference/type-aliases/ObjectDetectorOptions.md) — Options defining labels, box format, and normalization.
+- [`BoundingBox`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/BoundingBox.md) — Generic bounding box structure.
+- [`BoxFormat`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/BoxFormat.md) — Coordinate formats (`'xyxy'`, `'xywh'`, `'cxcywh'`).
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Input image buffer structure.
+
+### Model Presets
+
+- [`models.objectDetection`](../../06-api-reference/variables/models.md#objectdetection) — Pre-configured object detection models registry.
diff --git a/docs/docs/02-extensions/computer-vision/04-pose-and-keypoints.md b/docs/docs/02-extensions/computer-vision/04-pose-and-keypoints.md
new file mode 100644
index 0000000000..f57478d169
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/04-pose-and-keypoints.md
@@ -0,0 +1,237 @@
+---
+title: Pose & Keypoints
+slug: /extensions/pose-and-keypoints
+description: 'Detect skeletal body keypoints and facial landmarks in real time with bounding boxes using models like YOLO26 Pose and BlazeFace.'
+keywords:
+ [
+ react native,
+ pose estimation,
+ keypoint detection,
+ facial landmarks,
+ body tracking,
+ blazeface,
+ yolo26 pose,
+ coco landmarks,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Pose & Keypoints
+
+Pose estimation and keypoint detection locate specific anatomical landmarks on detected subjects — such as human skeletal joints (eyes, shoulders, elbows, wrists, hips, knees, ankles) or facial landmarks (eyes, nose tip, mouth, ears). Each prediction outputs a subject bounding box, detection confidence, and landmark coordinates scaled to the input image with individual landmark confidence scores.
+
+Unlike basic object detection (which only returns box boundaries), keypoint detection tracks body posture, movement, and facial alignment. Common use cases include fitness/workout tracking, gesture controls, motion analysis, face alignment, and AR filters.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useKeypointDetector`](../../06-api-reference/functions/useKeypointDetector.md) hook manages model downloading, initialization, and lifecycle:
+
+```tsx
+import { models, useKeypointDetector } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const detector = useKeypointDetector(models.keypointDetection.YOLO26_POSE.DEFAULT);
+
+ // Hook state:
+ // detector.isReady — true once model is downloaded and loaded in memory
+ // detector.downloadProgress — 0 to 100 download progress
+ // detector.error — Error instance if download or load failed
+
+ const handleDetect = async (imageBuffer: ImageBuffer) => {
+ if (!detector.isReady || !detector.detectKeypoints) return;
+
+ // Run inference on background thread
+ const detections = await detector.detectKeypoints(imageBuffer, {
+ confidenceThreshold: 0.25,
+ iouThreshold: 0.7,
+ });
+ console.log('Detected poses:', detections);
+ };
+
+ // Trigger handleDetect from an image picker, button press, or camera frame
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/keypoint-detection.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen with photo picker, skeleton keypoint overlays, and latency tracking.
+:::
+
+## Output Format
+
+[`detectKeypoints()`](../../06-api-reference/type-aliases/KeypointDetector.md#detectkeypoints) returns an array of [`KeypointDetection`](../../06-api-reference/type-aliases/KeypointDetection.md) objects:
+
+```typescript
+type KeypointDetection = {
+ /** Scaled bounding box coordinates matching the input image resolution */
+ readonly box: BoundingBox;
+ /** Overall detection confidence score (between 0.0 and 1.0) */
+ readonly confidence: number;
+ /** Map of landmark names to their pixel coordinates and confidence scores */
+ readonly landmarks: Record;
+};
+```
+
+For human pose models ([`YOLO26_POSE`](../../06-api-reference/variables/models.md#keypointdetectionyolo26_pose)), [`landmarks`](../../06-api-reference/type-aliases/KeypointDetection.md#landmarks) includes 17 [`COCO_LANDMARKS`](../../06-api-reference/variables/COCO_LANDMARKS.md) body points:
+
+```json
+[
+ {
+ "box": { "format": "xyxy", "xmin": 45.2, "ymin": 12.0, "xmax": 310.5, "ymax": 580.0 },
+ "confidence": 0.93,
+ "landmarks": {
+ "nose": { "x": 178.4, "y": 85.2, "confidence": 0.97 },
+ "leftEye": { "x": 190.1, "y": 75.4, "confidence": 0.95 },
+ "rightEye": { "x": 165.8, "y": 76.0, "confidence": 0.94 },
+ "leftShoulder": { "x": 230.5, "y": 150.0, "confidence": 0.91 },
+ "rightShoulder": { "x": 125.0, "y": 152.3, "confidence": 0.89 },
+ "leftElbow": { "x": 260.0, "y": 230.1, "confidence": 0.88 },
+ "leftWrist": { "x": 280.2, "y": 305.4, "confidence": 0.84 }
+ }
+ }
+]
+```
+
+For face models ([`BLAZEFACE`](../../06-api-reference/variables/models.md#keypointdetectionblazeface)), [`landmarks`](../../06-api-reference/type-aliases/KeypointDetection.md#landmarks) includes 6 facial points from [`BLAZEFACE_LANDMARKS`](../../06-api-reference/variables/BLAZEFACE_LANDMARKS.md): `leftEye`, `rightEye`, `noseTip`, `mouthCenter`, `leftEar`, `rightEar`.
+
+## Configuration & Options
+
+Pass a [`DetectKeypointsOptions`](../../06-api-reference/type-aliases/DetectKeypointsOptions.md) object to [`detectKeypoints()`](../../06-api-reference/type-aliases/KeypointDetector.md#detectkeypoints) to override model defaults:
+
+| Option | Type | Default | Description |
+| :--------------------------------------------------------------------------------------------------------- | :------- | :-------------------------- | :-------------------------------------------------------------- |
+| [`confidenceThreshold`](../../06-api-reference/type-aliases/DetectKeypointsOptions.md#confidencethreshold) | `number` | Model default (e.g. `0.25`) | Minimum confidence score for a detected subject to be retained. |
+| [`iouThreshold`](../../06-api-reference/type-aliases/DetectKeypointsOptions.md#iouthreshold) | `number` | Model default (e.g. `0.7`) | Non-Maximum Suppression (NMS) IoU overlap threshold. |
+
+## Imperative API
+
+For background tasks, headless services, or manual lifecycle management outside React components, create the detector using [`createKeypointDetector`](../../06-api-reference/functions/createKeypointDetector.md):
+
+```typescript
+import { createKeypointDetector, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.keypointDetection.YOLO26_POSE.DEFAULT);
+const detector = await createKeypointDetector(model);
+
+try {
+ const poses = await detector.detectKeypoints(imageBuffer, {
+ confidenceThreshold: 0.3,
+ });
+ console.log('Detected poses:', poses);
+} finally {
+ // Always release native resources when finished
+ detector.dispose();
+}
+```
+
+## Synchronous Execution
+
+For real-time camera tracking and live fitness apps, [`createKeypointDetector`](../../06-api-reference/functions/createKeypointDetector.md) exposes a synchronous [`detectKeypointsWorklet`](../../06-api-reference/type-aliases/KeypointDetector.md#detectkeypointsworklet) function. This runs directly on the worklet thread with zero Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a VisionCamera frame processor on the UI worklet thread
+const poses = detector.detectKeypointsWorklet(frameBuffer, {
+ confidenceThreshold: 0.3,
+});
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides ready-to-use pose and landmark detectors from the [Software Mansion HuggingFace Pose Estimation Collection](https://huggingface.co/collections/software-mansion/keypoint-detection), available in [`models.keypointDetection`](../../06-api-reference/variables/models.md#keypointdetection):
+
+| Model Family | Variants | Keypoints Detected | Size Range | Supported Backends | Notes |
+| :---------------------- | :--------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------- | :------------------ | :------------------------------------------ | :-------------------------------------------------------------------------------------------- |
+| **MediaPipe BlazeFace** | [See](../../06-api-reference/variables/models.md#keypointdetectionblazeface) | [`BLAZEFACE_LANDMARKS`](../../06-api-reference/variables/BLAZEFACE_LANDMARKS.md) (6 facial landmarks + box) | 0.6 MB | XNNPACK (CPU) | Ultra-lightweight face bounding box & eye/ear/nose/mouth keypoint tracking (sub-millisecond). |
+| **YOLO26 Pose** | [See](../../06-api-reference/variables/models.md#keypointdetectionyolo26_pose) | [`COCO_LANDMARKS`](../../06-api-reference/variables/COCO_LANDMARKS.md) (17 body keypoints) | 11.4 MB | XNNPACK (CPU), Core ML (Apple) | Real-time multi-person full-body skeletal tracking across multiple input resolutions. |
+| **RF-DETR Keypoint** | [See](../../06-api-reference/variables/models.md#keypointdetectionrfdetr_keypoint) | [`COCO_LANDMARKS`](../../06-api-reference/variables/COCO_LANDMARKS.md) (17 body keypoints) | 138.6 MB – 140.9 MB | XNNPACK (CPU), Core ML (Apple), MLX (Apple) | High-accuracy body keypoint detection transformer for complex, occluded poses. |
+
+:::tip Using Custom Models
+To use your own fine-tuned pose or landmark detection `.pte` model, pass a [`KeypointDetectorModel`](../../06-api-reference/type-aliases/KeypointDetectorModel.md) configuration object to [`useKeypointDetector`](../../06-api-reference/functions/useKeypointDetector.md) or [`createKeypointDetector`](../../06-api-reference/functions/createKeypointDetector.md):
+
+```typescript
+const customDetector = await createKeypointDetector({
+ modelPath: 'https://example.com/my-pose-model.pte',
+ modelOpts: {
+ landmarks: ['head', 'leftHand', 'rightHand'],
+ boxFormat: 'xyxy',
+ resizeMode: 'letterbox',
+ interpolation: 'linear',
+ normalizeOpts: { alpha: 1 / 255.0, beta: 0.0 },
+ defaultConfidenceThreshold: 0.3,
+ defaultIouThreshold: 0.6,
+ },
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output shapes match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useKeypointDetector()`](../../06-api-reference/functions/useKeypointDetector.md) — React hook for keypoint detector downloading, state, and lifecycle.
+- [`createKeypointDetector()`](../../06-api-reference/functions/createKeypointDetector.md) — Imperative factory for keypoint and pose detection pipelines.
+
+### Types & Options
+
+- [`KeypointDetector`](../../06-api-reference/type-aliases/KeypointDetector.md) — Keypoint detector runner interface (`detectKeypoints`, [`detectKeypointsWorklet`](../../06-api-reference/type-aliases/KeypointDetector.md#detectkeypointsworklet)).
+- [`KeypointDetection`](../../06-api-reference/type-aliases/KeypointDetection.md) — Detection result structure containing `box`, `confidence`, and `landmarks`.
+- [`DetectKeypointsOptions`](../../06-api-reference/type-aliases/DetectKeypointsOptions.md) — Detection options (`confidenceThreshold`, `iouThreshold`).
+- [`KeypointDetectorModel`](../../06-api-reference/type-aliases/KeypointDetectorModel.md) — Model configuration spec for pose and landmark models.
+- [`KeypointDetectorOptions`](../../06-api-reference/type-aliases/KeypointDetectorOptions.md) — Options defining landmark names, box format, and normalization.
+- [`Landmarks`](../../06-api-reference/type-aliases/Landmarks.md) — Record of landmark names mapped to `{ x, y, confidence }`.
+- [`BoundingBox`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/BoundingBox.md) — Bounding box structure.
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Input image buffer structure.
+
+### Model Presets & Constants
+
+- [`models.keypointDetection`](../../06-api-reference/variables/models.md#keypointdetection) — Pre-configured keypoint and pose models registry.
+- [`COCO_LANDMARKS`](../../06-api-reference/variables/COCO_LANDMARKS.md) — List of 17 standard COCO skeletal body keypoints.
+- [`BLAZEFACE_LANDMARKS`](../../06-api-reference/variables/BLAZEFACE_LANDMARKS.md) — List of 6 standard BlazeFace facial landmarks.
diff --git a/docs/docs/02-extensions/computer-vision/05-optical-character-recognition.md b/docs/docs/02-extensions/computer-vision/05-optical-character-recognition.md
new file mode 100644
index 0000000000..17c22bb6aa
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/05-optical-character-recognition.md
@@ -0,0 +1,224 @@
+---
+title: Optical Character Recognition (OCR)
+slug: /extensions/optical-character-recognition
+description: 'Detect and recognize text lines in images using on-device mixed-precision PaddleOCR (PP-OCRv6).'
+keywords:
+ [
+ react native,
+ ocr,
+ optical character recognition,
+ text recognition,
+ text detection,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Optical Character Recognition (OCR)
+
+Optical Character Recognition (OCR) detects and extracts text from images. The pipeline identifies text regions with oriented quadrilateral boundaries ([`Quad`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/Quad.md)) and transcribes their characters in reading order (top-to-bottom, left-to-right columns).
+
+It is used for document digitizing, receipt scanning, license plate reading, sign translation, and invoice processing. Because inference runs entirely on-device with zero network latency, sensitive documents never leave the phone.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useOpticalCharacterRecognizer`](../../06-api-reference/functions/useOpticalCharacterRecognizer.md) hook manages model downloading, character set loading, and lifecycle:
+
+```tsx
+import { models, useOpticalCharacterRecognizer } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const ocr = useOpticalCharacterRecognizer(models.ocr.PADDLE.PPOCRV6_SMALL.DEFAULT);
+
+ // Hook state:
+ // ocr.isReady — true once model and charset are downloaded and loaded
+ // ocr.downloadProgress — 0 to 100 download progress
+ // ocr.error — Error instance if download or load failed
+
+ const handleRecognize = async (imageBuffer: ImageBuffer) => {
+ if (!ocr.isReady || !ocr.recognizeCharacters) return;
+
+ // Run inference on background thread
+ const textLines = await ocr.recognizeCharacters(imageBuffer, {
+ confidenceThreshold: 0.5,
+ });
+ console.log('Recognized lines:', textLines);
+ };
+
+ // Trigger handleRecognize from an image picker, button press, or camera frame
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/ocr.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen with photo picker, oriented text bounding boxes, and latency tracking.
+:::
+
+## Output Format
+
+[`recognizeCharacters()`](../../06-api-reference/type-aliases/PaddleOcr.md#recognizecharacters) returns an array of [`OcrDetection`](../../06-api-reference/type-aliases/OcrDetection.md) objects in natural reading order:
+
+```typescript
+type OcrDetection = {
+ /** Transcribed text string */
+ readonly text: string;
+ /** Mean per-character probability score (between 0.0 and 1.0) */
+ readonly confidence: number;
+ /**
+ * Oriented quadrilateral corners in pixel coordinates:
+ * top-left, top-right, bottom-right, bottom-left
+ */
+ readonly quad: Quad;
+};
+```
+
+Example result:
+
+```json
+[
+ {
+ "text": "RECEIPT TOTAL: $42.50",
+ "confidence": 0.96,
+ "quad": [
+ { "x": 45.0, "y": 120.5 },
+ { "x": 380.2, "y": 122.0 },
+ { "x": 380.0, "y": 155.4 },
+ { "x": 44.8, "y": 154.0 }
+ ]
+ }
+]
+```
+
+## Configuration & Options
+
+Pass a [`RecognizeCharactersOptions`](../../06-api-reference/type-aliases/RecognizeCharactersOptions.md) object to [`recognizeCharacters()`](../../06-api-reference/type-aliases/PaddleOcr.md#recognizecharacters):
+
+| Option | Type | Default | Description |
+| :------------------------------------------------------------------------------------------------------------- | :------- | :------ | :-------------------------------------------------------------- |
+| [`confidenceThreshold`](../../06-api-reference/type-aliases/RecognizeCharactersOptions.md#confidencethreshold) | `number` | `0.5` | Minimum mean confidence score for a text region to be returned. |
+
+## Imperative API
+
+For background processing, document scanners, or manual lifecycle management outside React components, create the pipeline using [`createPaddleOcr`](../../06-api-reference/functions/createPaddleOcr.md):
+
+```typescript
+import { createPaddleOcr, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.ocr.PADDLE.PPOCRV6_SMALL.DEFAULT);
+const ocr = await createPaddleOcr(model);
+
+try {
+ const lines = await ocr.recognizeCharacters(imageBuffer, {
+ confidenceThreshold: 0.5,
+ });
+ console.log('Recognized text:', lines.map((l) => l.text).join('\n'));
+} finally {
+ // Always release native resources when finished
+ ocr.dispose();
+}
+```
+
+## Synchronous Execution
+
+For high-throughput loops or live camera text detection, [`createPaddleOcr`](../../06-api-reference/functions/createPaddleOcr.md) exposes a synchronous [`recognizeCharactersWorklet`](../../06-api-reference/type-aliases/PaddleOcr.md#recognizecharactersworklet) function. This runs directly on the worklet thread with zero Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a worklet runtime
+const lines = ocr.recognizeCharactersWorklet(frameBuffer, {
+ confidenceThreshold: 0.5,
+});
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides mixed-precision fused PP-OCRv6 models from the [Software Mansion HuggingFace OCR Collection](https://huggingface.co/collections/software-mansion/ocr), available in [`models.ocr`](../../06-api-reference/variables/models.md#ocr):
+
+| Model Family | Variants | Size Range | Supported Backends | Notes |
+| :----------------- | :----------------------------------------------------------------------- | :--------------- | :----------------------------------------------- | :--------------------------------------------------------------------------- |
+| **PP-OCRv6 Small** | [See](../../06-api-reference/variables/models.md#ocrpaddleppocrv6_small) | 7.9 MB – 25.0 MB | XNNPACK (CPU), Core ML (Apple), Vulkan (Android) | Full end-to-end on-device text detection & recognition in a single pipeline. |
+
+:::note Legacy CRAFT Models & Future EasyOCR Package
+The HuggingFace OCR collection may also list legacy **CRAFT** text detector models. Direct CRAFT support has been deprecated in core `react-native-executorch` in favor of the significantly faster and lighter fused **PP-OCRv6** pipeline. Advanced EasyOCR-style recognition features will be introduced in a dedicated companion package.
+:::
+
+:::tip Using Custom Models
+To use your own custom-trained PaddleOCR `.pte` model and character set, pass a [`PaddleOcrModel`](../../06-api-reference/type-aliases/PaddleOcrModel.md) configuration object to [`useOpticalCharacterRecognizer`](../../06-api-reference/functions/useOpticalCharacterRecognizer.md) or [`createPaddleOcr`](../../06-api-reference/functions/createPaddleOcr.md):
+
+```typescript
+const customOcr = await createPaddleOcr({
+ modelPath: 'https://example.com/my-ocr.pte',
+ charsetPath: 'https://example.com/charset.json',
+ modelOpts: {
+ defaultConfidenceThreshold: 0.5,
+ },
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output shapes match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useOpticalCharacterRecognizer()`](../../06-api-reference/functions/useOpticalCharacterRecognizer.md) — React hook for OCR model downloading, state, and lifecycle.
+- [`createPaddleOcr()`](../../06-api-reference/functions/createPaddleOcr.md) — Imperative factory for PP-OCRv6 pipelines.
+
+### Types & Options
+
+- [`PaddleOcr`](../../06-api-reference/type-aliases/PaddleOcr.md) — OCR runner interface ([`recognizeCharacters`](../../06-api-reference/type-aliases/PaddleOcr.md#recognizecharacters), [`recognizeCharactersWorklet`](../../06-api-reference/type-aliases/PaddleOcr.md#recognizecharactersworklet), `dispose`).
+- [`OcrDetection`](../../06-api-reference/type-aliases/OcrDetection.md) — Single recognized text line with [`text`](../../06-api-reference/type-aliases/OcrDetection.md#text), [`confidence`](../../06-api-reference/type-aliases/OcrDetection.md#confidence), and [`quad`](../../06-api-reference/type-aliases/OcrDetection.md#quad).
+- [`RecognizeCharactersOptions`](../../06-api-reference/type-aliases/RecognizeCharactersOptions.md) — Inference options (`confidenceThreshold`).
+- [`PaddleOcrModel`](../../06-api-reference/type-aliases/PaddleOcrModel.md) — Model configuration spec with `modelPath` and `charsetPath`.
+- [`PaddleOcrModelOptions`](../../06-api-reference/type-aliases/PaddleOcrModelOptions.md) — Model options (`defaultConfidenceThreshold`).
+- [`Quad`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/Quad.md) — Oriented 4-corner polygon tuple `[Point, Point, Point, Point]` in pixel coordinates (`top-left`, `top-right`, `bottom-right`, `bottom-left`).
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Input image buffer structure.
+
+### Model Presets
+
+- [`models.ocr`](../../06-api-reference/variables/models.md#ocr) — Pre-configured OCR models registry.
diff --git a/docs/docs/02-extensions/computer-vision/06-semantic-segmentation.md b/docs/docs/02-extensions/computer-vision/06-semantic-segmentation.md
new file mode 100644
index 0000000000..29334b5aeb
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/06-semantic-segmentation.md
@@ -0,0 +1,212 @@
+---
+title: Semantic Segmentation
+slug: /extensions/semantic-segmentation
+description: 'Perform pixel-level image segmentation into categories like person, background, and Pascal VOC objects using models like DeepLabV3 and Selfie Segmentation.'
+keywords:
+ [
+ react native,
+ semantic segmentation,
+ image segmentation,
+ pixel classification,
+ deeplab,
+ selfie segmentation,
+ lraspp,
+ pascal voc,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Semantic Segmentation
+
+Semantic segmentation classifies every individual pixel of an input image into a designated category label (e.g. background, person, vehicle, dog). The pipeline produces a pixel-aligned segmentation mask matching the input dimensions.
+
+Unlike object detection (which outputs rectangular bounding boxes), semantic segmentation delivers precise pixel boundaries. It powers photo portrait effects, background blur/replacement, scene parsing, medical imaging, and autonomous navigation.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useSemanticSegmenter`](../../06-api-reference/functions/useSemanticSegmenter.md) hook manages model downloading, initialization, and lifecycle:
+
+```tsx
+import { models, useSemanticSegmenter } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const segmenter = useSemanticSegmenter(models.semanticSegmentation.DEEPLAB_V3_RESNET50.DEFAULT);
+
+ // Hook state:
+ // segmenter.isReady — true once model is downloaded and loaded in memory
+ // segmenter.downloadProgress — 0 to 100 download progress
+ // segmenter.error — Error instance if download or load failed
+
+ const handleSegment = async (imageBuffer: ImageBuffer) => {
+ if (!segmenter.isReady || !segmenter.segment) return;
+
+ // Run inference on background thread
+ const result = await segmenter.segment(imageBuffer);
+ console.log('Output mask buffer:', result.buffer);
+ };
+
+ // Trigger handleSegment from an image picker, button press, or camera frame
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/semantic-segmentation.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen with photo picker, custom colormap blending, and latency tracking.
+:::
+
+## Output Format
+
+[`segment()`](../../06-api-reference/type-aliases/SemanticSegmenter.md#segment) returns a [`SemanticSegmentationResult`](../../06-api-reference/type-aliases/SemanticSegmentationResult.md) object:
+
+```typescript
+type SemanticSegmentationResult = {
+ /** Output RGBA image buffer containing the colored segmentation mask */
+ readonly buffer: ImageBuffer;
+ /** Applied color map mapping each class label to its [R, G, B, A] tuple */
+ readonly colormap?: ColorMap;
+};
+```
+
+### Color Mapping Behavior
+
+- **Multi-class models** (e.g. [`DEEPLAB_V3`](../../06-api-reference/variables/models.md#semanticsegmentationdeeplab_v3_resnet50), [`LRASPP`](../../06-api-reference/variables/models.md#semanticsegmentationlraspp_mobilenet_v3_large)): Performs an [`argmax`](../../06-api-reference/react-native-executorch/namespaces/math/functions/argmax.md) over the class logits per pixel, then maps each class index to its corresponding `[R, G, B, A]` color tuple. The returned [`colormap`](../../06-api-reference/type-aliases/SemanticSegmentationResult.md#colormap) contains the full active label-to-color mapping.
+- **Single-class / binary models** (e.g. [`SELFIE_SEGMENTATION`](../../06-api-reference/variables/models.md#semanticsegmentationselfie_segmentation)): Applies a [`sigmoid`](../../06-api-reference/react-native-executorch/namespaces/math/functions/sigmoid.md) activation to the single output channel, scales probabilities to pixel intensity values (0–255), and returns an RGBA mask. No color map is applied, and [`colormap`](../../06-api-reference/type-aliases/SemanticSegmentationResult.md#colormap) is `undefined`.
+
+## Configuration & Color Maps
+
+Pass an optional partial [`ColorMap`](../../06-api-reference/type-aliases/ColorMap.md) object to [`segment()`](../../06-api-reference/type-aliases/SemanticSegmenter.md#segment) to customize how categories are colored:
+
+```typescript
+// Custom RGBA colors: [R, G, B, A] (values 0 - 255)
+const result = await segmenter.segment(imageBuffer, {
+ person: [255, 0, 0, 180], // Translucent red for person
+ background: [0, 0, 0, 0], // Fully transparent for background
+});
+```
+
+When omitted, multi-class models automatically generate high-contrast distinct colors with the first class (typically background) defaulting to transparent `[0, 0, 0, 0]`. If a partial map is provided, any labels omitted from it will default to being rendered as fully transparent.
+
+## Imperative API
+
+For background processing, headless pipelines, or manual lifecycle management outside React components, create the segmenter using [`createSemanticSegmenter`](../../06-api-reference/functions/createSemanticSegmenter.md):
+
+```typescript
+import { createSemanticSegmenter, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.semanticSegmentation.DEEPLAB_V3_RESNET50.DEFAULT);
+const segmenter = await createSemanticSegmenter(model);
+
+try {
+ const result = await segmenter.segment(imageBuffer);
+ console.log('Generated mask dimensions:', result.buffer.width, result.buffer.height);
+} finally {
+ // Always release native resources when finished
+ segmenter.dispose();
+}
+```
+
+## Synchronous Execution
+
+For high-throughput loops like live camera background removal or portrait mode effects, [`createSemanticSegmenter`](../../06-api-reference/functions/createSemanticSegmenter.md) exposes a synchronous [`segmentWorklet`](../../06-api-reference/type-aliases/SemanticSegmenter.md#segmentworklet) function. This runs directly on the worklet thread with zero Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a VisionCamera frame processor on the UI worklet thread
+const result = segmenter.segmentWorklet(frameBuffer);
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides ready-to-use segmentation models from the [Software Mansion HuggingFace Semantic Segmentation Collection](https://huggingface.co/collections/software-mansion/semantic-segmentation), accessible via [`models.semanticSegmentation`](../../06-api-reference/variables/models.md#semanticsegmentation):
+
+| Model Family | Variants | Classes / Labels | Size Range | Supported Backends | Notes |
+| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------- | :----------------- | :----------------------------- | :----------------------------------------------------------------------- |
+| **Selfie Segmentation** | [`Portrait`](../../06-api-reference/variables/models.md#semanticsegmentationselfie_segmentation), [`Landscape`](../../06-api-reference/variables/models.md#semanticsegmentationselfie_segmentation_landscape) | Person / Background | 0.5 MB – 0.6 MB | XNNPACK (CPU), Core ML (Apple) | Real-time front-camera portrait background replacement and blur effects. |
+| **LRASPP MobileNetV3** | [See](../../06-api-reference/variables/models.md#semanticsegmentationlraspp_mobilenet_v3_large) | [`PASCAL_VOC_LABELS`](../../06-api-reference/variables/PASCAL_VOC_LABELS.md) (21 classes) | 3.4 MB – 12.3 MB | XNNPACK (CPU), Core ML (Apple) | Lightweight multi-class scene segmentation with low CPU overhead. |
+| **DeepLabV3** | [`ResNet50`](../../06-api-reference/variables/models.md#semanticsegmentationdeeplab_v3_resnet50), [`ResNet101`](../../06-api-reference/variables/models.md#semanticsegmentationdeeplab_v3_resnet101), [`MobileNetV3`](../../06-api-reference/variables/models.md#semanticsegmentationdeeplab_v3_mobilenet_v3_large) | [`PASCAL_VOC_LABELS`](../../06-api-reference/variables/PASCAL_VOC_LABELS.md) (21 classes) | 40.4 MB – 223.6 MB | XNNPACK (CPU), Core ML (Apple) | High-fidelity dense pixel classification for complex scenes. |
+| **FCN** | [`ResNet50`](../../06-api-reference/variables/models.md#semanticsegmentationfcn_resnet50), [`ResNet101`](../../06-api-reference/variables/models.md#semanticsegmentationfcn_resnet101) | [`PASCAL_VOC_LABELS`](../../06-api-reference/variables/PASCAL_VOC_LABELS.md) (21 classes) | 34.0 MB – 198.1 MB | XNNPACK (CPU), Core ML (Apple) | Fully Convolutional Networks baseline for dense multi-class parsing. |
+
+:::tip Using Custom Models
+To use your own fine-tuned semantic segmentation `.pte` model, pass a [`SemanticSegmenterModel`](../../06-api-reference/type-aliases/SemanticSegmenterModel.md) configuration object to [`useSemanticSegmenter`](../../06-api-reference/functions/useSemanticSegmenter.md) or [`createSemanticSegmenter`](../../06-api-reference/functions/createSemanticSegmenter.md):
+
+```typescript
+const customSegmenter = await createSemanticSegmenter({
+ modelPath: 'https://example.com/my-segmentation.pte',
+ modelOpts: {
+ labels: ['background', 'road', 'sidewalk', 'building'],
+ resizeMode: 'stretch',
+ interpolation: 'linear',
+ outInterpolation: 'lanczos',
+ normalizeOpts: { alpha: 1 / 255.0, beta: 0.0 },
+ },
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output shapes match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useSemanticSegmenter()`](../../06-api-reference/functions/useSemanticSegmenter.md) — React hook for semantic segmenter downloading, state, and lifecycle.
+- [`createSemanticSegmenter()`](../../06-api-reference/functions/createSemanticSegmenter.md) — Imperative factory for semantic segmentation pipelines.
+
+### Types & Options
+
+- [`SemanticSegmenter`](../../06-api-reference/type-aliases/SemanticSegmenter.md) — Semantic segmenter runner interface (`segment`, [`segmentWorklet`](../../06-api-reference/type-aliases/SemanticSegmenter.md#segmentworklet)).
+- [`SemanticSegmentationResult`](../../06-api-reference/type-aliases/SemanticSegmentationResult.md) — Output structure containing `buffer` and `colormap`.
+- [`ColorMap`](../../06-api-reference/type-aliases/ColorMap.md) — Map of label names to `[R, G, B, A]` tuples.
+- [`SemanticSegmenterModel`](../../06-api-reference/type-aliases/SemanticSegmenterModel.md) — Model configuration spec for semantic segmenter pipelines.
+- [`SemanticSegmenterOptions`](../../06-api-reference/type-aliases/SemanticSegmenterOptions.md) — Options defining labels, interpolation, and normalization.
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Input and output image buffer structure.
+
+### Model Presets & Constants
+
+- [`models.semanticSegmentation`](../../06-api-reference/variables/models.md#semanticsegmentation) — Pre-configured semantic segmentation models registry.
+- [`PASCAL_VOC_LABELS`](../../06-api-reference/variables/PASCAL_VOC_LABELS.md) — List of 21 standard Pascal VOC class labels.
diff --git a/docs/docs/02-extensions/computer-vision/07-instance-segmentation.md b/docs/docs/02-extensions/computer-vision/07-instance-segmentation.md
new file mode 100644
index 0000000000..ade14aa04b
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/07-instance-segmentation.md
@@ -0,0 +1,230 @@
+---
+title: Instance Segmentation
+slug: /extensions/instance-segmentation
+description: 'Detect, classify, and extract pixel-accurate binary masks for individual object instances using models like FastSAM, YOLO26 Seg, and RF-DETR.'
+keywords:
+ [
+ react native,
+ instance segmentation,
+ mask extraction,
+ bounding box,
+ fastsam,
+ yolo26 seg,
+ rfdetr seg,
+ coco,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Instance Segmentation
+
+Instance segmentation combines object detection and semantic segmentation. For every detected individual object in an image, the pipeline predicts its bounding box, category label, detection confidence, and a pixel-accurate binary mask cropped to the instance bounds.
+
+Unlike semantic segmentation (which groups all pixels of the same category into a single collective mask), instance segmentation distinguishes between separate instances of the same class (e.g. `person #1`, `person #2`). It powers interactive photo cutouts, object isolation, background effects, AR occlusions, and automated video editing.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useInstanceSegmenter`](../../06-api-reference/functions/useInstanceSegmenter.md) hook manages model downloading, initialization, and lifecycle:
+
+```tsx
+import { models, useInstanceSegmenter } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const segmenter = useInstanceSegmenter(models.instanceSegmentation.FASTSAM.S.DEFAULT);
+
+ // Hook state:
+ // segmenter.isReady — true once model is downloaded and loaded in memory
+ // segmenter.downloadProgress — 0 to 100 download progress
+ // segmenter.error — Error instance if download or load failed
+
+ const handleSegment = async (imageBuffer: ImageBuffer) => {
+ if (!segmenter.isReady || !segmenter.segmentInstances) return;
+
+ // Run inference on background thread
+ const instances = await segmenter.segmentInstances(imageBuffer, {
+ confidenceThreshold: 0.5,
+ iouThreshold: 0.9,
+ maskThreshold: 0.5,
+ });
+ console.log('Detected instances:', instances);
+ };
+
+ // Trigger handleSegment from an image picker, button press, or camera frame
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/instance-segmentation.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen with photo picker, colored instance polygon overlays, and latency tracking.
+:::
+
+## Output Format
+
+[`segmentInstances()`](../../06-api-reference/type-aliases/InstanceSegmenter.md#segmentinstances) returns an array of [`InstanceSegmentationResult`](../../06-api-reference/type-aliases/InstanceSegmentationResult.md) objects:
+
+```typescript
+type InstanceSegmentationResult = {
+ /** Scaled bounding box coordinates matching the input image resolution */
+ readonly box: BoundingBox;
+ /** Binary mask buffer cropped to the instance bounding box */
+ readonly mask: ImageBuffer;
+ /** Predicted instance class label */
+ readonly label: L;
+ /** Confidence score of the detection (between 0.0 and 1.0) */
+ readonly confidence: number;
+};
+```
+
+Example result:
+
+```json
+[
+ {
+ "box": { "format": "xyxy", "xmin": 50.0, "ymin": 120.0, "xmax": 280.0, "ymax": 450.0 },
+ "label": "person",
+ "confidence": 0.92,
+ "mask": { "width": 230, "height": 330, "format": "rgba", "data": "..." }
+ }
+]
+```
+
+## Configuration & Options
+
+Pass a [`SegmentInstancesOptions`](../../06-api-reference/type-aliases/SegmentInstancesOptions.md) object to [`segmentInstances()`](../../06-api-reference/type-aliases/InstanceSegmenter.md#segmentinstances) to override model defaults:
+
+| Option | Type | Default | Description |
+| :---------------------------------------------------------------------------------------------------------- | :------- | :------------------------- | :------------------------------------------------------- |
+| [`confidenceThreshold`](../../06-api-reference/type-aliases/SegmentInstancesOptions.md#confidencethreshold) | `number` | Model default (e.g. `0.5`) | Minimum confidence score for an instance to be retained. |
+| [`iouThreshold`](../../06-api-reference/type-aliases/SegmentInstancesOptions.md#iouthreshold) | `number` | Model default (e.g. `0.9`) | Non-Maximum Suppression (NMS) IoU overlap threshold. |
+| [`maskThreshold`](../../06-api-reference/type-aliases/SegmentInstancesOptions.md#maskthreshold) | `number` | Model default (e.g. `0.5`) | Probability threshold for binary mask creation. |
+
+## Imperative API
+
+For background processing, headless pipelines, or manual lifecycle management outside React components, create the segmenter pipeline using [`createInstanceSegmenter`](../../06-api-reference/functions/createInstanceSegmenter.md):
+
+```typescript
+import { createInstanceSegmenter, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.instanceSegmentation.FASTSAM.S.DEFAULT);
+const segmenter = await createInstanceSegmenter(model);
+
+try {
+ const instances = await segmenter.segmentInstances(imageBuffer, {
+ confidenceThreshold: 0.4,
+ });
+ console.log('Found instances:', instances.length);
+} finally {
+ // Always release native resources when finished
+ segmenter.dispose();
+}
+```
+
+## Synchronous Execution
+
+For real-time camera tracking or live object cutouts, [`createInstanceSegmenter`](../../06-api-reference/functions/createInstanceSegmenter.md) exposes a synchronous [`segmentInstancesWorklet`](../../06-api-reference/type-aliases/InstanceSegmenter.md#segmentinstancesworklet) function. This runs directly on the worklet thread with zero Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a VisionCamera frame processor on the UI worklet thread
+const instances = segmenter.segmentInstancesWorklet(frameBuffer, {
+ confidenceThreshold: 0.5,
+});
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides ready-to-use instance segmentation models from the [Software Mansion HuggingFace Instance Segmentation Collection](https://huggingface.co/collections/software-mansion/instance-segmentation), accessible via [`models.instanceSegmentation`](../../06-api-reference/variables/models.md#instancesegmentation):
+
+| Model Family | Variants | Dataset / Vocabulary | Size Range | Supported Backends | Notes |
+| :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------- | :----------------- | :----------------------------- | :---------------------------------------------------------------------------- |
+| **FastSAM** | [`Small`](../../06-api-reference/variables/models.md#instancesegmentationfastsams), [`XLarge`](../../06-api-reference/variables/models.md#instancesegmentationfastsamx) | Open-world promptable masks | 23.1 MB – 275.7 MB | XNNPACK (CPU), Core ML (Apple) | Segment Anything Model optimized for zero-shot object mask extraction. |
+| **RF-DETR Nano Seg** | [See](../../06-api-reference/variables/models.md#instancesegmentationrfdetr_nano) | [`COCO_CLASSES`](../../06-api-reference/variables/COCO_CLASSES.md) (80 classes) | 59.5 MB – 118.3 MB | XNNPACK (CPU), Core ML (Apple) | DINOv2-based detection & instance segmentation transformer. |
+| **YOLO26 Seg** | [See](../../06-api-reference/variables/models.md#instancesegmentationyolo26) | [`COCO_CLASSES_YOLO`](../../06-api-reference/variables/COCO_CLASSES_YOLO.md) (80 classes) | 10.6 MB – 240.0 MB | XNNPACK (CPU), Core ML (Apple) | Real-time simultaneous object detection and polygon instance mask extraction. |
+
+:::tip Using Custom Models
+To use your own fine-tuned instance segmentation `.pte` model, pass an [`InstanceSegmenterModel`](../../06-api-reference/type-aliases/InstanceSegmenterModel.md) configuration object to [`useInstanceSegmenter`](../../06-api-reference/functions/useInstanceSegmenter.md) or [`createInstanceSegmenter`](../../06-api-reference/functions/createInstanceSegmenter.md):
+
+```typescript
+const customSegmenter = await createInstanceSegmenter({
+ modelPath: 'https://example.com/my-instance-seg.pte',
+ modelOpts: {
+ labels: ['bottle', 'cup', 'can'],
+ boxFormat: 'xyxy',
+ resizeMode: 'stretch',
+ interpolation: 'linear',
+ normalizeOpts: { alpha: 1 / 255.0, beta: 0.0 },
+ defaultConfidenceThreshold: 0.5,
+ defaultIouThreshold: 0.8,
+ defaultMaskThreshold: 0.5,
+ },
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output shapes match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useInstanceSegmenter()`](../../06-api-reference/functions/useInstanceSegmenter.md) — React hook for instance segmenter downloading, state, and lifecycle.
+- [`createInstanceSegmenter()`](../../06-api-reference/functions/createInstanceSegmenter.md) — Imperative factory for instance segmentation pipelines.
+
+### Types & Options
+
+- [`InstanceSegmenter`](../../06-api-reference/type-aliases/InstanceSegmenter.md) — Instance segmenter runner interface (`segmentInstances`, [`segmentInstancesWorklet`](../../06-api-reference/type-aliases/InstanceSegmenter.md#segmentinstancesworklet)).
+- [`InstanceSegmentationResult`](../../06-api-reference/type-aliases/InstanceSegmentationResult.md) — Result structure with `box`, `mask`, `label`, and `confidence`.
+- [`SegmentInstancesOptions`](../../06-api-reference/type-aliases/SegmentInstancesOptions.md) — Inference options (`confidenceThreshold`, `iouThreshold`, `maskThreshold`).
+- [`InstanceSegmenterModel`](../../06-api-reference/type-aliases/InstanceSegmenterModel.md) — Model configuration spec for instance segmenter pipelines.
+- [`InstanceSegmenterOptions`](../../06-api-reference/type-aliases/InstanceSegmenterOptions.md) — Options defining labels, box format, and thresholds.
+- [`BoundingBox`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/BoundingBox.md) — Bounding box structure.
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Input and mask image buffer structure.
+
+### Model Presets
+
+- [`models.instanceSegmentation`](../../06-api-reference/variables/models.md#instancesegmentation) — Pre-configured instance segmentation models registry.
diff --git a/docs/docs/02-extensions/computer-vision/08-style-transfer.md b/docs/docs/02-extensions/computer-vision/08-style-transfer.md
new file mode 100644
index 0000000000..ec2678ab6c
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/08-style-transfer.md
@@ -0,0 +1,193 @@
+---
+title: Neural Style Transfer
+slug: /extensions/style-transfer
+description: 'Apply artistic styles like Candy, Mosaic, Rain Princess, and Udnie to photos and camera frames on-device in real time.'
+keywords:
+ [
+ react native,
+ style transfer,
+ artistic filters,
+ photo stylization,
+ neural style transfer,
+ candy,
+ mosaic,
+ rain princess,
+ udnie,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Neural Style Transfer
+
+Neural style transfer renders an input image in the artistic style of another image (such as famous paintings or pattern textures) while preserving the semantic content and structure of the original photo.
+
+Because the models run locally in real time on mobile hardware accelerators, you can apply artistic filters to live camera frames or photos without uploading user media to external servers.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useStyleTransfer`](../../06-api-reference/functions/useStyleTransfer.md) hook manages model downloading, initialization, and lifecycle:
+
+```tsx
+import { models, useStyleTransfer } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const styleTransfer = useStyleTransfer(models.styleTransfer.CANDY.DEFAULT);
+
+ // Hook state:
+ // styleTransfer.isReady — true once model is downloaded and loaded in memory
+ // styleTransfer.downloadProgress — 0 to 100 download progress
+ // styleTransfer.error — Error instance if download or load failed
+
+ const handleTransfer = async (imageBuffer: ImageBuffer) => {
+ if (!styleTransfer.isReady || !styleTransfer.transferStyle) return;
+
+ // Run inference on background thread
+ const styledBuffer = await styleTransfer.transferStyle(imageBuffer);
+ console.log('Styled image dimensions:', styledBuffer.width, styledBuffer.height);
+ };
+
+ // Trigger handleTransfer from an image picker, button press, or camera frame
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/style-transfer.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen with photo picker, side-by-side style comparisons, and latency tracking.
+:::
+
+## Output Format
+
+[`transferStyle()`](../../06-api-reference/type-aliases/StyleTransfer.md#transferstyle) returns an [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) object containing the styled RGBA image rendered at the input dimensions:
+
+```typescript
+type ImageBuffer = {
+ readonly width: number;
+ readonly height: number;
+ readonly format: 'rgba';
+ readonly data: Uint8Array;
+};
+```
+
+The resulting buffer contains raw uncompressed RGBA pixel bytes that can be rendered directly via React Native Skia or passed into subsequent processing steps.
+
+## Imperative API
+
+For background photo processing, headless workflows, or manual lifecycle management outside React components, create the pipeline using [`createStyleTransfer`](../../06-api-reference/functions/createStyleTransfer.md):
+
+```typescript
+import { createStyleTransfer, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.styleTransfer.CANDY.DEFAULT);
+const styleTransfer = await createStyleTransfer(model);
+
+try {
+ const styledBuffer = await styleTransfer.transferStyle(imageBuffer);
+ console.log('Styled output byte length:', styledBuffer.data.byteLength);
+} finally {
+ // Always release native resources when finished
+ styleTransfer.dispose();
+}
+```
+
+## Synchronous Execution
+
+For high-throughput loops like live viewfinder styling or video recording, [`createStyleTransfer`](../../06-api-reference/functions/createStyleTransfer.md) exposes a synchronous [`transferStyleWorklet`](../../06-api-reference/type-aliases/StyleTransfer.md#transferstyleworklet) function. This runs directly on the worklet thread with zero Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a VisionCamera frame processor on the UI worklet thread
+const styledBuffer = styleTransfer.transferStyleWorklet(frameBuffer);
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides ready-to-use style transfer models from the [Software Mansion HuggingFace Style Transfer Collection](https://huggingface.co/collections/software-mansion/style-transfer), available in [`models.styleTransfer`](../../06-api-reference/variables/models.md#styletransfer):
+
+| Model Family | Variants | Size Range | Supported Backends | Notes |
+| :---------------- | :--------------------------------------------------------------------------- | :-------------- | :----------------------------- | :---------------------------------------------------- |
+| **Candy** | [See](../../06-api-reference/variables/models.md#styletransfercandy) | 1.8 MB – 6.5 MB | XNNPACK (CPU), Core ML (Apple) | Vibrant, colorful candy aesthetic with bold outlines. |
+| **Mosaic** | [See](../../06-api-reference/variables/models.md#styletransfermosaic) | 1.8 MB – 6.5 MB | XNNPACK (CPU), Core ML (Apple) | Classical geometric tile mosaic texture. |
+| **Rain Princess** | [See](../../06-api-reference/variables/models.md#styletransferrain_princess) | 1.8 MB – 6.5 MB | XNNPACK (CPU), Core ML (Apple) | Painterly expressionist oil painting style. |
+| **Udnie** | [See](../../06-api-reference/variables/models.md#styletransferudnie) | 1.8 MB – 6.5 MB | XNNPACK (CPU), Core ML (Apple) | Francis Picabia abstract modernist art style. |
+
+:::tip Using Custom Models
+To use your own trained feed-forward style transfer `.pte` model, pass a [`StyleTransferModel`](../../06-api-reference/type-aliases/StyleTransferModel.md) configuration object to [`useStyleTransfer`](../../06-api-reference/functions/useStyleTransfer.md) or [`createStyleTransfer`](../../06-api-reference/functions/createStyleTransfer.md):
+
+```typescript
+const customStyleTransfer = await createStyleTransfer({
+ modelPath: 'https://example.com/my-style.pte',
+ modelOpts: {
+ resizeMode: 'stretch',
+ interpolation: 'linear',
+ outInterpolation: 'lanczos',
+ normalizeOpts: { alpha: 1 / 255.0, beta: 0.0 },
+ outNormalizeOpts: { alpha: 255.0, beta: 0.0 },
+ },
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output shapes match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useStyleTransfer()`](../../06-api-reference/functions/useStyleTransfer.md) — React hook for style transfer model downloading, state, and lifecycle.
+- [`createStyleTransfer()`](../../06-api-reference/functions/createStyleTransfer.md) — Imperative factory for style transfer pipelines.
+
+### Types & Options
+
+- [`StyleTransfer`](../../06-api-reference/type-aliases/StyleTransfer.md) — Style transfer runner interface (`transferStyle`, [`transferStyleWorklet`](../../06-api-reference/type-aliases/StyleTransfer.md#transferstyleworklet)).
+- [`StyleTransferModel`](../../06-api-reference/type-aliases/StyleTransferModel.md) — Model configuration spec for style transfer models.
+- [`StyleTransferOptions`](../../06-api-reference/type-aliases/StyleTransferOptions.md) — Options defining normalization, interpolation, and resize modes.
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Input and output image buffer structure.
+
+### Model Presets
+
+- [`models.styleTransfer`](../../06-api-reference/variables/models.md#styletransfer) — Pre-configured artistic style transfer models registry.
diff --git a/docs/docs/02-extensions/computer-vision/09-image-embeddings.md b/docs/docs/02-extensions/computer-vision/09-image-embeddings.md
new file mode 100644
index 0000000000..a5f55855ff
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/09-image-embeddings.md
@@ -0,0 +1,199 @@
+---
+title: Image Embeddings
+slug: /extensions/image-embeddings
+description: 'Generate high-dimensional visual feature vectors from images using multimodal models like OpenAI CLIP for zero-shot classification and search.'
+keywords:
+ [
+ react native,
+ image embeddings,
+ feature extraction,
+ clip,
+ vision transformer,
+ multimodal,
+ vector search,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Image Embeddings
+
+Image embedding models extract high-dimensional semantic feature vectors (embeddings) from raw images. When paired with multimodal models like OpenAI CLIP (Contrastive Language-Image Pretraining) and [Text Embeddings](../../02-extensions/natural-language/03-text-embeddings.md), image and text embeddings share the same joint vector space.
+
+This enables on-device cross-modal photo search (finding pictures with natural language queries), zero-shot image classification, visual similarity clustering, and vector search against local SQLite vector stores — all computed entirely on-device without network latency or cloud costs.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useImageEmbedder`](../../06-api-reference/functions/useImageEmbedder.md) hook manages model downloading, initialization, and lifecycle:
+
+```tsx
+import { models, useImageEmbedder } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const imageEmbedder = useImageEmbedder(models.imageEmbeddings.CLIP_VIT_BASE_PATCH32.DEFAULT);
+
+ // Hook state:
+ // imageEmbedder.isReady — true once model is downloaded and loaded in memory
+ // imageEmbedder.downloadProgress — 0 to 100 download progress
+ // imageEmbedder.error — Error instance if download or load failed
+
+ const handleEmbed = async (imageBuffer: ImageBuffer) => {
+ if (!imageEmbedder.isReady || !imageEmbedder.embed) return;
+
+ // Run inference on background thread
+ const vector = await imageEmbedder.embed(imageBuffer);
+ console.log('Embedding dimension:', vector.length); // 512
+ };
+
+ // Trigger handleEmbed from an image picker, button press, or camera frame
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/image-embeddings.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen combining image and text embeddings for real-time zero-shot photo ranking.
+:::
+
+## Output Format
+
+[`embed()`](../../06-api-reference/type-aliases/ImageEmbedder.md#embed) returns a 1D [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) containing the normalized feature vector:
+
+```typescript
+// Float32Array of length D (e.g. 512 for CLIP ViT-B/32)
+const vector: Float32Array = await imageEmbedder.embed(imageBuffer);
+```
+
+### Cross-Modal Similarity Matching
+
+To compute the cosine similarity between an image embedding and a text query embedding produced by [`useTextEmbedder`](../../06-api-reference/functions/useTextEmbedder.md), compute their dot product:
+
+```typescript
+function cosineSimilarity(a: Float32Array, b: Float32Array): number {
+ let sum = 0;
+ for (let i = 0; i < a.length; i++) {
+ sum += a[i] * b[i];
+ }
+ return sum;
+}
+
+// Compare image vector with query text vector
+const score = cosineSimilarity(imageVector, textVector);
+console.log('Match similarity score:', score);
+```
+
+## Imperative API
+
+For background indexing, SQLite vector ingestion, or manual lifecycle management outside React components, create the embedder using [`createImageEmbedder`](../../06-api-reference/functions/createImageEmbedder.md):
+
+```typescript
+import { createImageEmbedder, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.imageEmbeddings.CLIP_VIT_BASE_PATCH32.DEFAULT);
+const embedder = await createImageEmbedder(model);
+
+try {
+ const vector = await embedder.embed(imageBuffer);
+ console.log('Generated vector:', vector.slice(0, 5));
+} finally {
+ // Always release native resources when finished
+ embedder.dispose();
+}
+```
+
+## Synchronous Execution
+
+For high-throughput loops or real-time camera feature extraction, [`createImageEmbedder`](../../06-api-reference/functions/createImageEmbedder.md) exposes a synchronous [`embedWorklet`](../../06-api-reference/type-aliases/ImageEmbedder.md#embedworklet) function. This runs directly on the worklet thread with zero Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a worklet runtime on the UI thread
+const vector = embedder.embedWorklet(frameBuffer);
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides ready-to-use vision encoders from the [Software Mansion HuggingFace Image Embeddings Collection](https://huggingface.co/collections/software-mansion/image-embeddings), available in [`models.imageEmbeddings`](../../06-api-reference/variables/models.md#imageembeddings):
+
+| Model Family | Variants | Output Dim | Size Range | Supported Backends | Notes |
+| :----------------------- | :------------------------------------------------------------------------------------- | :--------- | :----------------- | :------------------------------------------------------------ | :-------------------------------------------------------------------------------- |
+| **CLIP ViT-B/32 Vision** | [See](../../06-api-reference/variables/models.md#imageembeddingsclip_vit_base_patch32) | 512 | 93.7 MB – 335.3 MB | XNNPACK (CPU), Core ML (Apple), MLX (Apple), Vulkan (Android) | Joint image-text semantic search, image clustering, and zero-shot categorization. |
+
+:::tip Using Custom Models
+To use your own fine-tuned vision encoder `.pte` model, pass an [`ImageEmbedderModel`](../../06-api-reference/type-aliases/ImageEmbedderModel.md) configuration object to [`useImageEmbedder`](../../06-api-reference/functions/useImageEmbedder.md) or [`createImageEmbedder`](../../06-api-reference/functions/createImageEmbedder.md):
+
+```typescript
+const customEmbedder = await createImageEmbedder({
+ modelPath: 'https://example.com/my-vision-encoder.pte',
+ modelOpts: {
+ resizeMode: 'stretch',
+ interpolation: 'linear',
+ normalizeOpts: { alpha: 1 / 255.0, beta: 0.0 },
+ },
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output shapes match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useImageEmbedder()`](../../06-api-reference/functions/useImageEmbedder.md) — React hook for vision embedding model downloading, state, and lifecycle.
+- [`createImageEmbedder()`](../../06-api-reference/functions/createImageEmbedder.md) — Imperative factory for vision embedding pipelines.
+- [`useTextEmbedder()`](../../06-api-reference/functions/useTextEmbedder.md) — React hook for text embedding models to pair with vision encoders.
+
+### Types & Options
+
+- [`ImageEmbedder`](../../06-api-reference/type-aliases/ImageEmbedder.md) — Image embedder runner interface (`embed`, `embedWorklet`).
+- [`ImageEmbedderModel`](../../06-api-reference/type-aliases/ImageEmbedderModel.md) — Model configuration spec for vision embedders.
+- [`ImagePreprocessorOptions`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImagePreprocessorOptions.md) — Options defining normalization, interpolation, and resize modes.
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Input image buffer structure.
+
+### Model Presets
+
+- [`models.imageEmbeddings`](../../06-api-reference/variables/models.md#imageembeddings) — Pre-configured vision encoder models registry.
diff --git a/docs/docs/02-extensions/computer-vision/10-text-to-image.md b/docs/docs/02-extensions/computer-vision/10-text-to-image.md
new file mode 100644
index 0000000000..facb092102
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/10-text-to-image.md
@@ -0,0 +1,191 @@
+---
+title: Text to Image
+slug: /extensions/text-to-image
+description: 'Generate high-quality 512x512 images directly on-device from natural language prompts using SDXS (Stable Diffusion eXtreme Speed).'
+keywords:
+ [
+ react native,
+ text to image,
+ image generation,
+ stable diffusion,
+ sdxs,
+ dreamshaper,
+ diffusion model,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Text to Image
+
+Text-to-image diffusion models generate photorealistic and artistic images directly from natural language descriptive prompts.
+
+The library ships with SDXS-512 (Stable Diffusion eXtreme Speed) based on DreamShaper. Through architectural distillation, SDXS collapses multi-step denoising into a fast, single-step latent diffusion pipeline capable of generating 512x512 images completely on-device without cloud GPUs.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useTextToImage`](../../06-api-reference/functions/useTextToImage.md) hook manages model downloading, CLIP tokenizer loading, and lifecycle:
+
+```tsx
+import { models, useTextToImage } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function MyComponent() {
+ const generator = useTextToImage(models.textToImage.SDXS_512_DREAMSHAPER.DEFAULT);
+
+ // Hook state:
+ // generator.isReady — true once model and tokenizer are downloaded and loaded
+ // generator.downloadProgress — 0 to 100 download progress
+ // generator.error — Error instance if download or load failed
+
+ const handleGenerate = async (prompt: string) => {
+ if (!generator.isReady || !generator.generate) return;
+
+ // Run inference on background thread (optional seed for deterministic output)
+ const imageBuffer: ImageBuffer = await generator.generate(prompt, 42);
+ console.log('Generated image:', imageBuffer.width, imageBuffer.height);
+ };
+
+ // Trigger handleGenerate on submit from a prompt input or button press
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/text-to-image.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen with prompt suggestions, generation progress, and Skia canvas rendering.
+:::
+
+## Output Format
+
+[`generate()`](../../06-api-reference/type-aliases/SdxsTextToImage.md#generate) returns an [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) object with uncompressed 512x512 RGBA pixel bytes:
+
+```typescript
+type ImageBuffer = {
+ readonly width: 512;
+ readonly height: 512;
+ readonly format: 'rgba';
+ readonly data: Uint8Array;
+};
+```
+
+You can render the output directly to screen using [React Native Skia](https://shopify.github.io/react-native-skia/), convert it into canvas textures, or pipe it into subsequent visual processing pipelines.
+
+## Determinism & Seeds
+
+[`generate(prompt, seed)`](../../06-api-reference/type-aliases/SdxsTextToImage.md#generate) accepts an optional integer [`seed`](../../06-api-reference/type-aliases/SdxsTextToImage.md#seed) parameter:
+
+- **With a seed** (e.g. `generate("sunset over ocean", 123)`): Reproduces the exact same image output deterministically.
+- **Without a seed** (e.g. `generate("sunset over ocean")`): Uses a time-based random seed to produce a fresh variation on each execution.
+
+## Imperative API
+
+For background generation jobs, headless services, or manual lifecycle management outside React components, create the generator using [`createSdxsTextToImage`](../../06-api-reference/functions/createSdxsTextToImage.md):
+
+```typescript
+import { createSdxsTextToImage, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the pipeline
+const model = await download(models.textToImage.SDXS_512_DREAMSHAPER.DEFAULT);
+const generator = await createSdxsTextToImage(model);
+
+try {
+ const imageBuffer = await generator.generate(
+ 'A serene mountain lake at sunrise, photorealistic, 8k',
+ 100
+ );
+ console.log('Generated image bytes:', imageBuffer.data.byteLength);
+} finally {
+ // Always release native resources when finished
+ generator.dispose();
+}
+```
+
+## Synchronous Execution
+
+For synchronous worklet execution contexts, [`createSdxsTextToImage`](../../06-api-reference/functions/createSdxsTextToImage.md) exposes a [`generateWorklet`](../../06-api-reference/type-aliases/SdxsTextToImage.md#generateworklet) function that executes directly inside a worklet runtime without Promise scheduling overhead:
+
+```typescript
+// Called synchronously inside a worklet runtime
+const imageBuffer = generator.generateWorklet(prompt, seed);
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides ready-to-use text-to-image models from the [Software Mansion HuggingFace Text to Image Collection](https://huggingface.co/collections/software-mansion/text-to-image), available in [`models.textToImage`](../../06-api-reference/variables/models.md#texttoimage):
+
+| Model Family | Variants | Resolution | Size Range | Supported Backends | Notes |
+| :----------------------- | :-------------------------------------------------------------------------------- | :--------- | :----------------- | :----------------------------- | :------------------------------------------------------------------------------- |
+| **SDXS 512 DreamShaper** | [See](../../06-api-reference/variables/models.md#texttoimagesdxs_512_dreamshaper) | 512x512 | 839.9 MB – 1.64 GB | XNNPACK (CPU), Core ML (Apple) | Single-step distilled latent diffusion for ultra-fast on-device image synthesis. |
+
+:::tip Using Custom Models
+To use your own fine-tuned SDXS `.pte` model and CLIP tokenizer, pass a [`SdxsTextToImageModel`](../../06-api-reference/type-aliases/SdxsTextToImageModel.md) configuration object to [`useTextToImage`](../../06-api-reference/functions/useTextToImage.md) or [`createSdxsTextToImage`](../../06-api-reference/functions/createSdxsTextToImage.md):
+
+```typescript
+const customGenerator = await createSdxsTextToImage({
+ modelPath: 'https://example.com/my-sdxs.pte',
+ tokenizerPath: 'https://example.com/tokenizer.json',
+});
+```
+
+The pipeline automatically verifies that the model's exported methods (`encode`, `denoise`, `decode`) match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useTextToImage()`](../../06-api-reference/functions/useTextToImage.md) — React hook for text-to-image model downloading, state, and lifecycle.
+- [`createSdxsTextToImage()`](../../06-api-reference/functions/createSdxsTextToImage.md) — Imperative factory for SDXS text-to-image pipelines.
+
+### Types & Options
+
+- [`SdxsTextToImage`](../../06-api-reference/type-aliases/SdxsTextToImage.md) — Text-to-image generator runner interface ([`generate`](../../06-api-reference/type-aliases/SdxsTextToImage.md#generate), [`generateWorklet`](../../06-api-reference/type-aliases/SdxsTextToImage.md#generateworklet)).
+- [`SdxsTextToImageModel`](../../06-api-reference/type-aliases/SdxsTextToImageModel.md) — Model configuration spec with `modelPath` and `tokenizerPath`.
+- [`ImageBuffer`](../../06-api-reference/react-native-executorch/namespaces/cv/type-aliases/ImageBuffer.md) — Generated RGBA output image buffer structure.
+
+### Model Presets
+
+- [`models.textToImage`](../../06-api-reference/variables/models.md#texttoimage) — Pre-configured text-to-image generation models registry.
diff --git a/docs/docs/02-extensions/computer-vision/11-camera-integration.md b/docs/docs/02-extensions/computer-vision/11-camera-integration.md
new file mode 100644
index 0000000000..0cecc5e9b5
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/11-camera-integration.md
@@ -0,0 +1,7 @@
+---
+title: 11-camera-integration
+---
+
+# 11-camera-integration
+
+_Coming soon._
diff --git a/docs/docs/02-extensions/computer-vision/_category_.json b/docs/docs/02-extensions/computer-vision/_category_.json
new file mode 100644
index 0000000000..6efeaddfde
--- /dev/null
+++ b/docs/docs/02-extensions/computer-vision/_category_.json
@@ -0,0 +1,7 @@
+{
+ "label": "Computer Vision",
+ "position": 1,
+ "link": {
+ "type": "generated-index"
+ }
+}
diff --git a/docs/docs/02-extensions/natural-language/02-llm-chat-and-generation.md b/docs/docs/02-extensions/natural-language/02-llm-chat-and-generation.md
new file mode 100644
index 0000000000..c32e2f53ca
--- /dev/null
+++ b/docs/docs/02-extensions/natural-language/02-llm-chat-and-generation.md
@@ -0,0 +1,361 @@
+---
+title: LLM Chat & Text Generation
+slug: /extensions/llm-chat-and-generation
+description: 'Run generative Large Language Models on-device with token streaming, multi-turn KV cache memory, tool calling, Jinja2 chat templates, multimodal vision inputs, and raw runner control.'
+keywords:
+ [
+ react native,
+ llm,
+ chat,
+ text generation,
+ large language model,
+ lfm,
+ llama,
+ smollm,
+ bielik,
+ streaming,
+ tool calling,
+ kv cache,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# LLM Chat & Text Generation
+
+The LLM extension lets you run generative Large Language Models (LLMs) and Vision-Language Models (VLMs) directly on user devices with real-time token streaming, complete privacy, and full offline support. Depending on what you are building, you can choose between two levels of control:
+
+- **Chat Sessions ([`useLLMChatSession`](#quick-start) / [`createLLMChatSession`](#imperative-session-api))**: The recommended API for conversational apps and AI assistants. It manages multi-turn conversation history, applies [Jinja2 chat templates](#chat-templates--incremental-kv-cache-diffing), supports [multimodal image inputs](#multimodal-inputs), and handles [automated tool calling](#automated-tool-calling).
+- **Low-Level Runner ([`LLMRunner`](#low-level-runner))**: A direct execution engine that operates on worklet threads. It processes raw text strings or media tensors without chat formatting, giving you manual control over KV cache prefilling, synchronous generation loops, and context rewinding.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useLLMChatSession`](../../06-api-reference/functions/useLLMChatSession.md) hook handles remote model downloading, caching, tokenizer setup, and conversational state in a single React hook:
+
+```tsx
+import { useState } from 'react';
+import { models, useLLMChatSession } from 'react-native-executorch';
+
+function MyChatComponent() {
+ const [streamingText, setStreamingText] = useState('');
+
+ const session = useLLMChatSession(models.llm.LFM2_5_1_2B.DEFAULT, {
+ initialMessages: [{ role: 'system', content: 'You are a helpful on-device assistant.' }],
+ generationConfig: {
+ temperature: 0.2,
+ maxNewTokens: 512,
+ },
+ });
+
+ // Hook state:
+ // session.isReady — true once model weights and tokenizer are loaded in memory
+ // session.downloadProgress — 0 to 100 download progress
+ // session.error — Error instance if download or load failed
+
+ const handleSend = async (userPrompt: string) => {
+ if (!session.isReady || !session.sendMessage) return;
+
+ setStreamingText('');
+
+ // Stream tokens as they are decoded
+ const turn = await session.sendMessage(userPrompt, (token) => {
+ setStreamingText((prev) => prev + token);
+ });
+
+ console.log('New messages added this turn:', turn.messages);
+ console.log('Turn generation statistics:', turn.stats);
+ };
+
+ // Trigger handleSend on submit from a prompt input or chat screen
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/llm-chat.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable chat UI with token streaming, token/sec benchmarking, and message history.
+:::
+
+## Understanding the Output & Turn Result
+
+When you call [`sendMessage()`](../../06-api-reference/type-aliases/LLMChatSession.md#sendmessage), the promise resolves to an [`LLMChatTurnResult`](../../06-api-reference/type-aliases/LLMChatTurnResult.md) describing what happened during that turn:
+
+```typescript
+type LLMChatTurnResult = {
+ /**
+ * The new messages added to conversation history during this turn.
+ * Includes the user prompt, any assistant tool calls, tool responses,
+ * and the final assistant message.
+ */
+ readonly messages: readonly ChatMessage[];
+
+ /**
+ * Performance statistics for each generation step in this turn.
+ * If the model executed tools, this array contains one entry per generation step.
+ */
+ readonly stats: readonly LLMGenerationStats[];
+
+ /**
+ * The termination reason:
+ * - 'stop': The model generated an End-Of-Sequence (EOS) token or hit maxNewTokens.
+ * - 'maxToolTurns': The turn was terminated because tool execution reached maxToolTurns.
+ */
+ readonly finishReason: 'stop' | 'maxToolTurns';
+};
+```
+
+[`stats`](../../06-api-reference/type-aliases/LLMChatTurnResult.md#stats) is an array of [`LLMGenerationStats`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMGenerationStats.md) because tool calling can trigger multiple consecutive generation steps in a single turn (e.g. `stats[0]` for the model generating the tool call, and `stats[1]` for generating the final answer after tool execution). Each entry provides [`numPromptTokens`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMGenerationStats.md#numprompttokens), [`numGeneratedTokens`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMGenerationStats.md#numgeneratedtokens), [`prefillDurationMs`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMGenerationStats.md#prefilldurationms), and start/end timestamps ([`inferenceStartMs`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMGenerationStats.md#inferencestartms) / [`inferenceEndMs`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMGenerationStats.md#inferenceendms)) to compute tokens per second (`tok/s`).
+
+## Chat Templates & Incremental KV Cache Diffing
+
+Under the hood, [`createChatPreprocessor`](../../06-api-reference/react-native-executorch/namespaces/llm/functions/createChatPreprocessor.md) renders [`ChatMessage[]`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/ChatMessage.md) arrays using the model's official Jinja2 template from `tokenizer_config.json` (formatting special tokens, roles, and generation headers).
+
+To keep multi-turn chat responsive without re-encoding past history on every message, the preprocessor uses incremental prompt diffing:
+
+1. It verifies that the rendered prefix of previously committed turns is an exact substring match of the newly updated conversation.
+2. It slices out only the newly appended tokens and passes them to [`runner.prefill()`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md#prefill).
+3. The existing Key-Value (KV) cache in native memory is preserved, so generation starts immediately without recalculating prior turns.
+
+:::note Custom Model Compatibility
+If you use a custom model whose Jinja template dynamically rewires earlier turns when new messages arrive (breaking monotonicity), pass [`resetOnTurn: true`](../../06-api-reference/type-aliases/LLMChatSessionOptions.md#resetonturn) in your session options to force full re-encoding each turn.
+:::
+
+## Multimodal Inputs
+
+Vision-Language Models (such as Liquid AI's [`LFM2_5_VL_450M`](../../06-api-reference/variables/models.md#llmlfm2_5_vl_450m) and [`LFM2_5_VL_1_6B`](../../06-api-reference/variables/models.md#llmlfm2_5_vl_1_6b)) process interleaved text and visual payloads:
+
+```typescript
+import { models, useLLMChatSession } from 'react-native-executorch';
+import type { ImageBuffer } from 'react-native-executorch/cv';
+
+function VisionChat() {
+ const session = useLLMChatSession(models.llm.LFM2_5_VL_450M.DEFAULT);
+
+ const handleAnalyzePhoto = async (image: ImageBuffer) => {
+ if (!session.isReady || !session.sendMessage) return;
+
+ // Send array of interleaved media and text
+ const turn = await session.sendMessage(
+ [
+ { kind: 'image', image },
+ 'What type of flower is this, and what care instructions should I follow?',
+ ],
+ (token) => {
+ process.stdout.write(token);
+ }
+ );
+
+ console.log('Result:', turn.messages);
+ };
+}
+```
+
+The session automatically embeds the model's sentinel vision tokens, resizes and normalizes the image buffer to the vision encoder's target shape, and feeds the resulting image tensors into the multimodal execution runner alongside text tokens.
+
+## Automated Tool Calling
+
+The LLM chat session supports automated, multi-turn tool calling (function calling). When tool definitions and a parser are supplied, the session automatically invokes tool callbacks, feeds their results back into the conversation, and returns the final assistant answer.
+
+### 1. Define Tools with `execute`
+
+Declare tools matching standard JSON Schema specifications along with an asynchronous `execute` handler:
+
+```typescript
+import { type ToolDefinition } from 'react-native-executorch/llm';
+
+export const weatherTool: ToolDefinition<{ location: string; unit?: 'celsius' | 'fahrenheit' }> = {
+ type: 'function',
+ function: {
+ name: 'get_current_weather',
+ description: 'Get the current weather conditions for a given city.',
+ parameters: {
+ type: 'object',
+ properties: {
+ location: { type: 'string', description: 'City name' },
+ unit: { type: 'string', enum: ['celsius', 'fahrenheit'] },
+ },
+ required: ['location'],
+ },
+ },
+ execute: async ({ location, unit = 'celsius' }) => {
+ // Query local device sensors or web API
+ return JSON.stringify({ location, temperature: 22, unit, condition: 'Sunny' });
+ },
+};
+```
+
+### 2. Supply a Tool Parser (`parseToolCalls`)
+
+Because different open-source model families emit tool calls in varying syntax (e.g. XML `` tags, JSON markdown blocks, or special tokens), supply a parser function conforming to [`ToolParser`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/ToolParser.md):
+
+```typescript
+import type { ToolParser, ToolParserResult } from 'react-native-executorch/llm';
+
+// Example parser for XML tag syntax:
+// {"name": "get_current_weather", "arguments": {"location": "San Francisco"}}
+export const xmlToolParser: ToolParser = (text: string): ToolParserResult | undefined => {
+ const match = text.match(/([\s\S]*?)<\/tool_call>/);
+ if (!match) return undefined;
+
+ try {
+ const json = JSON.parse(match[1].trim());
+ return {
+ toolCalls: [
+ {
+ function: {
+ name: json.name,
+ arguments: json.arguments,
+ },
+ },
+ ],
+ // Residual text outside the tool call tags
+ textContent: text.replace(match[0], '').trim(),
+ };
+ } catch {
+ return undefined;
+ }
+};
+```
+
+### 3. Attach to Session
+
+```typescript
+const session = useLLMChatSession(models.llm.LFM2_5_1_2B.DEFAULT, {
+ toolOpts: {
+ tools: [weatherTool],
+ parseToolCalls: xmlToolParser,
+ maxToolTurns: 5, // Maximum consecutive tool execution turns before halting
+ },
+});
+```
+
+## Imperative Session API
+
+For headless background services or non-React architectures, create a full chat session imperatively using [`createLLMChatSession`](../../06-api-reference/functions/createLLMChatSession.md):
+
+```typescript
+import { createLLMChatSession, download, models } from 'react-native-executorch';
+
+// Download and cache LLM weights and tokenizer files
+const model = await download(models.llm.LFM2_5_1_2B.DEFAULT);
+const session = await createLLMChatSession(model, {
+ initialMessages: [{ role: 'system', content: 'You are an offline assistant.' }],
+ generationConfig: { temperature: 0.3, maxNewTokens: 256 },
+});
+
+try {
+ const result = await session.sendMessage("Summarize today's logs.");
+ console.log('Answer:', result.messages[result.messages.length - 1].content);
+} finally {
+ session.dispose();
+}
+```
+
+## Low-Level Runner
+
+While [`useLLMChatSession`](../../06-api-reference/functions/useLLMChatSession.md) and [`createLLMChatSession`](../../06-api-reference/functions/createLLMChatSession.md) handle chat formatting, message histories, and automated tool calling loops, you can drop down directly to the native [`LLMRunner`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md) via [`llm.createLLMRunner()`](../../06-api-reference/react-native-executorch/namespaces/llm/functions/createLLMRunner.md).
+
+[`LLMRunner`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md) operates synchronously on a worklet runtime thread and provides low-level control:
+
+- **Raw Prompt Ingestion**: Pass raw prompt strings or preprocessed image tensors directly to the runner without role formatting or Jinja chat template rendering.
+- **Manual Prefill**: Execute [`runner.prefill(prompt)`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md#prefill) to populate the Key-Value (KV) cache with large background contexts, system prompts, or document chunks before starting interactive generation.
+- **Direct Synchronous Generation**: Call [`runner.generate(prompt, config, onToken)`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md#generate) to generate text continuations with zero Promise scheduling overhead, executing the `onToken` callback directly on each generated token.
+- **KV Cache Inspection & Slicing**: Query [`runner.getKVCacheState()`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md#getkvcachestate) to check occupied tokens ([`pos`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMKVCacheState.md#pos)), max context length ([`maxSeqLen`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMKVCacheState.md#maxseqlen)), and context capacity ratio ([`usageRatio`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMKVCacheState.md#usageratio)).
+- **KV Cache Rewind & Branching**: Call [`runner.reset(targetPos)`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md#reset) to rewind the KV cache back to an exact token position. This enables speculative branching, sampling multiple divergent continuations from a shared prompt prefix without re-encoding, or manual conversation tree management.
+- **Cancellation**: Call [`runner.stop()`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md#stop) from any thread to abort active autoregressive generation immediately.
+
+## Available Models
+
+The library provides ready-to-use models from the [Software Mansion HuggingFace LLM Collection](https://huggingface.co/collections/software-mansion/llm-multimodal), pre-packaged with their tokenizers and Jinja chat templates in [`models.llm`](../../06-api-reference/variables/models.md#llm):
+
+| Model Family | Variants | Size Range | Supported Backends | Notes |
+| :----------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------- | :------------------------------------------- | :-------------------------------------------------------------------------- |
+| **Liquid LFM 2.5** | [`350M`](../../06-api-reference/variables/models.md#llmlfm2_5_350m), [`1.2B`](../../06-api-reference/variables/models.md#llmlfm2_5_1_2b), [`VL 450M`](../../06-api-reference/variables/models.md#llmlfm2_5_vl_450m), [`VL 1.6B`](../../06-api-reference/variables/models.md#llmlfm2_5_vl_1_6b) | 265 MB – 2.43 GB | XNNPACK (CPU), MLX (Apple), Vulkan (Android) | Fast hybrid RNN/Transformer for low-latency chat & visual reasoning. |
+| **Meta Llama 3.2** | [`1B`](../../06-api-reference/variables/models.md#llmllama3_2_1b), [`3B`](../../06-api-reference/variables/models.md#llmllama3_2_3b) | 1.06 GB – 5.99 GB | XNNPACK (CPU) | High-quality reasoning, summarization, and instruction following. |
+| **Google Gemma 4** | [`E2B`](../../06-api-reference/variables/models.md#llmgemma4_e2b) | 2.45 GB – 2.70 GB | XNNPACK (CPU), MLX (Apple), Vulkan (Android) | High-fidelity instruction following from Google DeepMind research. |
+| **Alibaba Qwen 3** | [`0.6B`](../../06-api-reference/variables/models.md#llmqwen3_0_6b), [`1.7B`](../../06-api-reference/variables/models.md#llmqwen3_1_7b), [`4B`](../../06-api-reference/variables/models.md#llmqwen3_4b) | 482 MB – 7.49 GB | XNNPACK (CPU) | Next-gen compact multilingual models supporting 29+ languages. |
+| **Alibaba Qwen 2.5** | [`0.5B`](../../06-api-reference/variables/models.md#llmqwen2_5_0_5b), [`1.5B`](../../06-api-reference/variables/models.md#llmqwen2_5_1_5b), [`3B`](../../06-api-reference/variables/models.md#llmqwen2_5_3b) | 417 MB – 5.75 GB | XNNPACK (CPU) | Proven multilingual instruction models across code, math, and chat. |
+| **Hammer 2.1** | [`0.5B`](../../06-api-reference/variables/models.md#llmhammer2_1_0_5b), [`1.5B`](../../06-api-reference/variables/models.md#llmhammer2_1_1_5b), [`3B`](../../06-api-reference/variables/models.md#llmhammer2_1_3b) | 398 MB – 5.75 GB | XNNPACK (CPU) | Fine-tuned function calling for automated tool execution & structured JSON. |
+| **Microsoft Phi-4 Mini** | [`3.8B`](../../06-api-reference/variables/models.md#llmphi4_mini) | 2.62 GB – 7.15 GB | XNNPACK (CPU) | High-density reasoning model for STEM problem solving & coding. |
+| **SpeakLeash Bielik v3** | [`1.5B`](../../06-api-reference/variables/models.md#llmbielik_v3_1_5b) | 923 MB – 2.97 GB | XNNPACK (CPU) | Bilingual Polish & English instruction model. |
+
+:::tip Using Custom Models
+To use your own fine-tuned LLM `.pte` model, pass an [`LLMModel`](../../06-api-reference/type-aliases/LLMModel.md) configuration object to [`useLLMChatSession`](../../06-api-reference/functions/useLLMChatSession.md) or [`createLLMChatSession`](../../06-api-reference/functions/createLLMChatSession.md):
+
+```typescript
+const customSession = await createLLMChatSession({
+ modelPath: 'https://example.com/my-llm.pte',
+ tokenizerPath: 'https://example.com/tokenizer.json',
+ tokenizerConfigPath: 'https://example.com/tokenizer_config.json',
+});
+```
+
+The pipeline automatically verifies that the model's exported methods and KV cache tensors match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useLLMChatSession()`](../../06-api-reference/functions/useLLMChatSession.md) — React hook for managing LLM model downloading, KV cache, and conversational sessions.
+- [`createLLMChatSession()`](../../06-api-reference/functions/createLLMChatSession.md) — Imperative factory for multi-turn LLM chat sessions.
+- [`llm.createLLMRunner()`](../../06-api-reference/react-native-executorch/namespaces/llm/functions/createLLMRunner.md) — Low-level factory for direct prompt execution and KV cache manipulation.
+- [`llm.createChatPreprocessor()`](../../06-api-reference/react-native-executorch/namespaces/llm/functions/createChatPreprocessor.md) — Jinja2 template renderer, media processor, and prompt diffing engine.
+
+### Types & Options
+
+- [`LLMChatSession`](../../06-api-reference/type-aliases/LLMChatSession.md) — Active chat session interface (`sendMessage`, `stop`, `getHistory`, `getKVCacheState`, `dispose`).
+- [`LLMRunner`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMRunner.md) — Low-level runner interface (`prefill`, `generate`, `reset`, `getKVCacheState`).
+- [`ChatPreprocessor`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/ChatPreprocessor.md) — Chat formatting and diffing preprocessor interface.
+- [`ToolDefinition`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/ToolDefinition.md) — Tool declaration with JSON Schema parameters and `execute` callback.
+- [`ToolParser`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/ToolParser.md) — Parser function type for extracting tool calls from model output.
+- [`LLMChatTurnResult`](../../06-api-reference/type-aliases/LLMChatTurnResult.md) — Result of a chat turn with updated messages, finish reason, and performance statistics.
+- [`LLMKVCacheState`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMKVCacheState.md) — KV cache metrics (`pos`, `maxSeqLen`, `usageRatio`).
+- [`LLMChatSessionOptions`](../../06-api-reference/type-aliases/LLMChatSessionOptions.md) — Session configuration options (`generationConfig`, `initialMessages`, `toolOpts`).
+- [`LLMModel`](../../06-api-reference/type-aliases/LLMModel.md) — Model configuration spec with model, tokenizer, and tokenizer config paths.
+- [`LLMGenerationConfig`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/LLMGenerationConfig.md) — Sampling and decoding parameters (`temperature`, `topP`, `maxNewTokens`).
+- [`ChatMessage`](../../06-api-reference/react-native-executorch/namespaces/llm/type-aliases/ChatMessage.md) — Standard chat message structure (`role`, `content`).
+
+### Model Presets
+
+- [`models.llm`](../../06-api-reference/variables/models.md#llm) — Pre-configured LLM models registry.
diff --git a/docs/docs/02-extensions/natural-language/03-text-embeddings.md b/docs/docs/02-extensions/natural-language/03-text-embeddings.md
new file mode 100644
index 0000000000..b4893b66c1
--- /dev/null
+++ b/docs/docs/02-extensions/natural-language/03-text-embeddings.md
@@ -0,0 +1,213 @@
+---
+title: Text Embeddings
+slug: /extensions/text-embeddings
+description: 'Generate high-dimensional semantic dense vectors from natural language text for on-device semantic search, vector databases, RAG, and cross-modal matching.'
+keywords:
+ [
+ react native,
+ text embeddings,
+ sentence transformers,
+ semantic search,
+ vector search,
+ rag,
+ minilm,
+ mpnet,
+ clip,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Text Embeddings
+
+Text embedding models convert sentences, paragraphs, or documents into dense numeric vectors (embeddings). Sentences with similar semantic meaning map to nearby points in the vector space, even when using completely different vocabulary.
+
+This enables on-device semantic search, offline Retrieval-Augmented Generation (RAG) against local SQLite vector stores, intent classification, and cross-modal text-to-image queries when paired with [Image Embeddings](../computer-vision/09-image-embeddings.md) — entirely on the client without sending private text to cloud APIs.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`useTextEmbedder`](../../06-api-reference/functions/useTextEmbedder.md) hook manages model downloading, tokenizer loading, and lifecycle:
+
+```tsx
+import { models, useTextEmbedder } from 'react-native-executorch';
+
+function MyComponent() {
+ const embedder = useTextEmbedder(models.textEmbeddings.ALL_MINILM_L6_V2.DEFAULT);
+
+ // Hook state:
+ // embedder.isReady — true once model and tokenizer are downloaded and loaded in memory
+ // embedder.downloadProgress — 0 to 100 download progress
+ // embedder.error — Error instance if download or load failed
+
+ const handleEmbed = async (inputText: string) => {
+ if (!embedder.isReady || !embedder.embed) return;
+
+ // Run inference on background thread
+ const vector = await embedder.embed(inputText);
+ console.log('Embedding dimension:', vector.length); // 384
+ };
+
+ // Trigger handleEmbed on submit from a search input or indexing loop
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/image-embeddings.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for a complete, runnable screen combining text and image embeddings for real-time cross-modal search.
+:::
+
+## Output Format
+
+[`embed()`](../../06-api-reference/type-aliases/TextEmbedder.md#embed) returns a 1D [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) containing the normalized feature vector:
+
+```typescript
+// Float32Array of length D (e.g. 384 for all-MiniLM-L6-v2, 768 for all-mpnet-base-v2)
+const vector: Float32Array = await embedder.embed('React Native ExecuTorch enables on-device ML.');
+```
+
+### Semantic Similarity Matching
+
+To compare semantic similarity between two text snippets (or between an asymmetric query and a document), calculate their cosine similarity / dot product:
+
+```typescript
+function cosineSimilarity(a: Float32Array, b: Float32Array): number {
+ let sum = 0;
+ for (let i = 0; i < a.length; i++) {
+ sum += a[i] * b[i];
+ }
+ return sum;
+}
+
+const v1 = await embedder.embed('How do I reset my password?');
+const v2 = await embedder.embed('Steps to change account credentials');
+const v3 = await embedder.embed('What is the weather in Tokyo?');
+
+console.log('Similarity (related):', cosineSimilarity(v1, v2)); // ~0.85
+console.log('Similarity (unrelated):', cosineSimilarity(v1, v3)); // ~0.15
+```
+
+## Asymmetric Retrieval & Prompt Prefixes
+
+Some embedding models (like [`LFM2_5_EMBEDDING_350M`](../../06-api-reference/variables/models.md#textembeddingslfm2_5_embedding_350m)) are trained asymmetrically where search queries and indexed passages use different prompt prefixes:
+
+- **Indexing documents**: [`embed(documentText, 'document: ')`](../../06-api-reference/type-aliases/TextEmbedder.md#embed)
+- **Searching queries**: [`embed(queryText, 'query: ')`](../../06-api-reference/type-aliases/TextEmbedder.md#embed) (default)
+
+You can pass a custom prefix string as the optional second [`prompt`](../../06-api-reference/type-aliases/TextEmbedder.md#prompt) argument to [`embed(input, prompt)`](../../06-api-reference/type-aliases/TextEmbedder.md#embed).
+
+## Imperative API
+
+For batch indexing, SQLite vector ingestion, or manual lifecycle management outside React components, create the embedder using [`createTextEmbedder`](../../06-api-reference/functions/createTextEmbedder.md):
+
+```typescript
+import { createTextEmbedder, download, models } from 'react-native-executorch';
+
+// Download and cache model assets before creating the imperative pipeline
+const model = await download(models.textEmbeddings.ALL_MINILM_L6_V2.DEFAULT);
+const embedder = await createTextEmbedder(model);
+
+try {
+ const vector = await embedder.embed('Vector search index item');
+ console.log('Generated vector:', vector.slice(0, 5));
+} finally {
+ // Always release native resources when finished
+ embedder.dispose();
+}
+```
+
+## Synchronous Execution
+
+For synchronous worklet execution contexts or high-throughput indexing workers, [`createTextEmbedder`](../../06-api-reference/functions/createTextEmbedder.md) exposes a synchronous [`embedWorklet`](../../06-api-reference/type-aliases/TextEmbedder.md#embedworklet) function:
+
+```typescript
+// Called synchronously inside a worklet runtime without Promise scheduling overhead
+const vector = embedder.embedWorklet(rawText);
+```
+
+See [Worklets & Threading](../../03-core-and-advanced/06-worklets-and-threading.md) for details on worklet execution contexts and zero-copy host objects.
+
+## Available Models
+
+The library provides ready-to-use text embedding models from the [Software Mansion HuggingFace Text Embeddings Collection](https://huggingface.co/collections/software-mansion/text-embeddings), available in [`models.textEmbeddings`](../../06-api-reference/variables/models.md#textembeddings):
+
+| Model Family | Variants | Output Dim | Languages | Size Range | Supported Backends | Notes |
+| :---------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------- | :------------ | :------------------ | :------------------------------------------------------------ | :---------------------------------------------------------------- |
+| **all-MiniLM-L6-v2** | [See](../../06-api-reference/variables/models.md#textembeddingsall_minilm_l6_v2) | 384 | English | 86.2 MB | XNNPACK (CPU), Core ML (Apple), Vulkan (Android) | Fast, lightweight sentence transformer for mobile vector search. |
+| **all-mpnet-base-v2** | [See](../../06-api-reference/variables/models.md#textembeddingsall_mpnet_base_v2) | 768 | English | 415.6 MB | XNNPACK (CPU), Vulkan (Android) | High-capacity model with superior semantic retrieval accuracy. |
+| **multi-qa-MiniLM / mpnet** | [`MiniLM`](../../06-api-reference/variables/models.md#textembeddingsmulti_qa_minilm_l6_cos_v1), [`mpnet`](../../06-api-reference/variables/models.md#textembeddingsmulti_qa_mpnet_base_dot_v1) | 384 / 768 | English | 86.2 MB – 415.6 MB | XNNPACK (CPU), Core ML (Apple), Vulkan (Android) | Fine-tuned specifically for Question-Answering retrieval. |
+| **paraphrase-multilingual-MiniLM-L12-v2** | [See](../../06-api-reference/variables/models.md#textembeddingsparaphrase_multilingual_minilm_l12_v2) | 384 | 50+ languages | 378.9 MB | XNNPACK (CPU), Core ML (Apple), Vulkan (Android) | Multilingual semantic similarity and cross-lingual text matching. |
+| **distiluse-base-multilingual-cased-v2** | [See](../../06-api-reference/variables/models.md#textembeddingsdistiluse_base_multilingual_cased_v2) | 512 | 50+ languages | 133.1 MB – 375.1 MB | XNNPACK (CPU), Core ML (Apple), MLX (Apple), Vulkan (Android) | Distilled Universal Sentence Encoder for multilingual clustering. |
+| **Liquid LFM 2.5 Embedding 350M** | [See](../../06-api-reference/variables/models.md#textembeddingslfm2_5_embedding_350m) | 512 | Multilingual | 179.8 MB – 548.2 MB | XNNPACK (CPU), MLX (Apple) | Asymmetric search with `query:` and `document:` prompting. |
+| **CLIP ViT-B/32 Text** | [See](../../06-api-reference/variables/models.md#textembeddingsclip_vit_base_patch32_text) | 512 | English | 242.2 MB | XNNPACK (CPU), Core ML (Apple), Vulkan (Android) | Text encoder for joint cross-modal text-to-image search. |
+
+:::tip Using Custom Models
+To use your own fine-tuned sentence transformer `.pte` model, pass a [`TextEmbedderModel`](../../06-api-reference/type-aliases/TextEmbedderModel.md) configuration object to [`useTextEmbedder`](../../06-api-reference/functions/useTextEmbedder.md) or [`createTextEmbedder`](../../06-api-reference/functions/createTextEmbedder.md):
+
+```typescript
+const customEmbedder = await createTextEmbedder({
+ modelPath: 'https://example.com/my-sentence-transformer.pte',
+ tokenizerPath: 'https://example.com/tokenizer.json',
+ defaultPrompt: 'passage: ', // Optional default prefix
+});
+```
+
+The pipeline automatically verifies that the model's exported input and output shapes match its requirements. To prepare and export your own `.pte` model to match this pipeline, see [Exporting Custom Models](../../03-core-and-advanced/07-exporting-custom-models.md#using-a-built-in-pipeline).
+:::
+
+## API Reference
+
+### Hooks & Pipelines
+
+- [`useTextEmbedder()`](../../06-api-reference/functions/useTextEmbedder.md) — React hook for text embedding model downloading, state, and lifecycle.
+- [`createTextEmbedder()`](../../06-api-reference/functions/createTextEmbedder.md) — Imperative factory for text embedding pipelines.
+- [`useImageEmbedder()`](../../06-api-reference/functions/useImageEmbedder.md) — React hook for vision embedding models to pair with text embeddings.
+
+### Types & Options
+
+- [`TextEmbedder`](../../06-api-reference/type-aliases/TextEmbedder.md) — Text embedder runner interface ([`embed`](../../06-api-reference/type-aliases/TextEmbedder.md#embed), [`embedWorklet`](../../06-api-reference/type-aliases/TextEmbedder.md#embedworklet)).
+- [`TextEmbedderModel`](../../06-api-reference/type-aliases/TextEmbedderModel.md) — Model configuration spec with `modelPath`, `tokenizerPath`, and `defaultPrompt`.
+
+### Model Presets
+
+- [`models.textEmbeddings`](../../06-api-reference/variables/models.md#textembeddings) — Pre-configured text embedding models registry.
diff --git a/docs/docs/02-extensions/natural-language/04-privacy-filter.md b/docs/docs/02-extensions/natural-language/04-privacy-filter.md
new file mode 100644
index 0000000000..4dcb643b1b
--- /dev/null
+++ b/docs/docs/02-extensions/natural-language/04-privacy-filter.md
@@ -0,0 +1,231 @@
+---
+title: Privacy Filter
+slug: /extensions/privacy-filter
+description: 'Detect and redact Personally Identifiable Information (PII) like names, emails, phone numbers, and secrets directly on-device in React Native.'
+keywords:
+ [
+ react native,
+ privacy filter,
+ pii detection,
+ redaction,
+ anonymization,
+ bioes,
+ viterbi,
+ openai,
+ nemotron,
+ mobile ml,
+ on-device ai,
+ ]
+---
+
+# Privacy Filter
+
+Privacy Filter models detect Personally Identifiable Information (PII) — such as personal names, email addresses, phone numbers, physical addresses, API keys, and credentials — in natural language text.
+
+By scanning text entirely on-device before sending prompts to cloud APIs, logging systems, or analytics backends, you can automatically redact or mask sensitive user data without exposing personal details over the network.
+
+
+
+
+
iOS
+
Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Quick Start
+
+The [`usePrivacyFilter`](../../06-api-reference/functions/usePrivacyFilter.md) hook downloads the `.pte` model and tokenizer files, initializes the native token classification pipeline, and manages lifecycle:
+
+```tsx
+import { models, usePrivacyFilter } from 'react-native-executorch';
+
+function MyComponent() {
+ const filter = usePrivacyFilter(models.privacyFilter.OPENAI.DEFAULT);
+
+ // Hook state:
+ // filter.isReady — true once model and tokenizer are downloaded and loaded in memory
+ // filter.downloadProgress — 0 to 100 download progress
+ // filter.error — Error instance if download or load failed
+
+ const handleScan = async (rawText: string) => {
+ if (!filter.isReady || !filter.detectPii) return;
+
+ // Detect all PII entity spans
+ const entities = await filter.detectPii(rawText);
+ console.log('Detected PII spans:', entities);
+ };
+
+ // Trigger handleScan on submit or before forwarding text to network
+}
+```
+
+:::tip Full Interactive Example in Gallery App
+See [`src/app/(screens)/privacy-filter.tsx`]() in the [React Native ExecuTorch Gallery](https://github.com/software-mansion-labs/react-native-executorch-gallery) for an interactive redaction demo with highlighted spans and entity replacement.
+:::
+
+## Output Format
+
+[`detectPii()`](../../06-api-reference/type-aliases/PrivacyFilter.md#detectpii) returns an array of [`PiiEntity`](../../06-api-reference/react-native-executorch/namespaces/nlp/interfaces/PiiEntity.md) objects representing detected spans:
+
+```typescript
+const entities = await filter.detectPii(
+ 'Contact John Doe at john.doe@example.com or (555) 019-2834.'
+);
+```
+
+Each [`PiiEntity`](../../06-api-reference/react-native-executorch/namespaces/nlp/interfaces/PiiEntity.md) object contains:
+
+```typescript
+interface PiiEntity