Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ca7d6c1
feat: add resource fetcher adapters for Expo and bare React Native
rizalibnu Jan 23, 2026
6e1e5c1
feat: add bare React Native LLM chat example app
rizalibnu Jan 23, 2026
49c0404
feat: enhance resource fetcher with error handling and new methods fo…
rizalibnu Jan 27, 2026
314fed5
chore: exclude llm_bare app from workspace
rizalibnu Jan 27, 2026
f8f48e5
feat: integrate MMKV for persistent state storage in background downl…
rizalibnu Jan 27, 2026
da04f34
chore: temporarily remove bare RN LLM example app for code review
rizalibnu Jan 27, 2026
ee1da71
chore: remove bare app directories from .gitignore
rizalibnu Jan 27, 2026
4a0f946
chore: update react-native-executorch dependency to allow any version
rizalibnu Jan 27, 2026
7352559
docs: add bare and expo adapters with installation and usage instruct…
rizalibnu Jan 27, 2026
fce6ec2
chore: add react-native-executorch as a dependency to adapters
rizalibnu Jan 27, 2026
09a8391
chore: add RNFS to the spell check wordlist
rizalibnu Jan 27, 2026
e445638
chore: update Node version in .nvmrc and adjust typecheck scripts in …
rizalibnu Jan 27, 2026
92924b4
chore: replace generic error with RnExecutorchError in ResourceFetche…
rizalibnu Jan 27, 2026
9f09e53
chore: move yarn prepare from adapter typecheck scripts to CI workflow
rizalibnu Jan 27, 2026
e6e9126
chore: update workspaces to use wildcard patterns for packages and apps
rizalibnu Jan 29, 2026
1eb8700
fix: handle directory creation errors in ResourceFetcherUtils
rizalibnu Jan 29, 2026
9cf9cbb
refactor: rename adapters to resource-fetcher packages
rizalibnu Jan 29, 2026
4020294
refactor: add resetAdapter method to ResourceFetcher
rizalibnu Jan 30, 2026
92b0009
refactor: simplify ResourceFetcherAdapter interface
rizalibnu Jan 30, 2026
7529f7d
build: configure TypeScript compilation for resource-fetcher packages
rizalibnu Jan 30, 2026
1dde669
refactor: streamline Typecheck step in CI workflow
rizalibnu Jan 30, 2026
e09abc3
refactor: update CI workflow and package scripts for improved type ch…
rizalibnu Jan 30, 2026
74ec36e
refactor: extract download completion logic and improve type safety
rizalibnu Feb 8, 2026
747307e
docs: complete JSDoc documentation for ResourceFetcher modules
rizalibnu Feb 8, 2026
38af3ed
docs: Change docs to align them with the current state of resource fe…
msluszniak Feb 16, 2026
78db189
feat!: Add time stamping to speech to text (#742)
msluszniak Feb 12, 2026
ed32d62
docs: align documentation with api reference
msluszniak Feb 17, 2026
be28882
Update functions to throw errors if adapters not initialized
msluszniak Feb 17, 2026
246348c
rebase on main tip
msluszniak Feb 17, 2026
1bd3f2c
Fix error: loading different types of models in computer vision
msluszniak Feb 18, 2026
a5440c5
Apply suggestions from code review
msluszniak Feb 18, 2026
3da1cbf
Make sure that error messages are correctly propagated
msluszniak Feb 18, 2026
aef1f76
Update packages/react-native-executorch/src/controllers/BaseOCRContro…
msluszniak Feb 18, 2026
d4da8d4
Apply suggestions from code review
msluszniak Feb 18, 2026
0d3efe9
Apply suggestions from code review
msluszniak Feb 18, 2026
9f95d60
Update docs/docs/01-fundamentals/01-getting-started.md
msluszniak Feb 18, 2026
23924b1
chore: dont default do empty string in load method
msluszniak Feb 19, 2026
f4b7578
chore: change rest of the files to pass only real path
msluszniak Feb 19, 2026
1fc3d03
chore: Create a custom error for resource fetcher adapter initialization
msluszniak Feb 19, 2026
cff408c
chore: Refactor ts code
msluszniak Feb 19, 2026
421cc64
Update README with installation instructions
msluszniak Feb 19, 2026
ac40c6f
docs: update READMEs
msluszniak Feb 19, 2026
e594d50
chore: add counting of downloads in resource fetcher
msluszniak Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cspell-wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,7 @@ sublist
TTFT
timestamping
logprob
RNFS
pogodin
kesha
antonov
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "0.2",
"language": "en",
"ignorePaths": ["**/node_modules", "**/Pods"],
"ignorePaths": ["**/node_modules", "**/Pods", "**/readmes/**"],
"dictionaryDefinitions": [
{
"name": "project-words",
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: yarn lint

- name: Typecheck files
run: yarn typecheck
run: yarn workspaces foreach --all --topological-dev run prepare && yarn typecheck

build-library:
runs-on: ubuntu-latest
Expand All @@ -35,7 +35,5 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: |
cd packages/react-native-executorch
yarn prepare
- name: Build all packages
run: yarn workspaces foreach --all --topological-dev run prepare
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ React Native ExecuTorch is powering [Private Mind](https://privatemind.swmansion
```bash
# Install the package
yarn add react-native-executorch

# If you use expo, please add these packages for resource fetching:
yarn add @react-native-executorch/expo-adapter
yarn add expo-file-system expo-asset

#if you use bare React Native project use these packages:
yarn add @react-native-executorch/bare-adapter
yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader

# Depending on the platform, choose either iOS or Android
yarn expo run:< ios | android >
```
Expand All @@ -88,8 +97,14 @@ Add this to your component file:
import {
useLLM,
LLAMA3_2_1B,
Message
Message,
initExecutorch,
} from 'react-native-executorch';
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';

initExecutorch({
resourceFetcher: ExpoResourceFetcher,
});

function MyComponent() {
// Initialize the model 🚀
Expand Down
7 changes: 7 additions & 0 deletions apps/computer-vision/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Drawer } from 'expo-router/drawer';
import { initExecutorch } from 'react-native-executorch';
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';

import ColorPalette from '../colors';
import React, { useState } from 'react';
import { Text, StyleSheet, View } from 'react-native';
Expand All @@ -10,6 +13,10 @@ import {
} from '@react-navigation/drawer';
import { GeneratingContext } from '../context';

initExecutorch({
resourceFetcher: ExpoResourceFetcher,
});

interface CustomDrawerProps extends DrawerContentComponentProps {
isGenerating: boolean;
}
Expand Down
5 changes: 3 additions & 2 deletions apps/computer-vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lint": "eslint . --ext .ts,.tsx --fix"
},
"dependencies": {
"@react-native/metro-config": "^0.76.3",
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
"@react-native/metro-config": "^0.81.5",
"@react-navigation/drawer": "^7.3.9",
"@react-navigation/native": "^7.1.6",
"@shopify/react-native-skia": "2.2.12",
Expand All @@ -21,7 +22,7 @@
"expo-linking": "~8.0.10",
"expo-router": "~6.0.17",
"expo-status-bar": "~3.0.9",
"metro-config": "^0.81.0",
"metro-config": "^0.81.5",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-device-info": "^14.0.4",
Expand Down
5 changes: 4 additions & 1 deletion apps/computer-vision/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"customConditions": ["react-native"],
"noEmit": true,
"paths": {
"react-native-executorch": ["../../packages/react-native-executorch/src"]
"react-native-executorch": ["../../packages/react-native-executorch/src"],
"@react-native-executorch/expo-resource-fetcher": [
"../../packages/expo-resource-fetcher/src"
]
}
}
}
7 changes: 6 additions & 1 deletion apps/llm/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { Drawer } from 'expo-router/drawer';
import { initExecutorch } from 'react-native-executorch';
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';
import ColorPalette from '../colors';
import React, { useState } from 'react';
import { Text, StyleSheet, View } from 'react-native';

import {
DrawerContentComponentProps,
DrawerContentScrollView,
DrawerItemList,
} from '@react-navigation/drawer';
import { GeneratingContext } from '../context';

initExecutorch({
resourceFetcher: ExpoResourceFetcher,
});

interface CustomDrawerProps extends DrawerContentComponentProps {
isGenerating: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/llm/app/llm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function LLMScreen() {

useEffect(() => {
if (llm.error) {
console.log('LLM error:', llm.error);
console.error('LLM error:', llm.error);
}
}, [llm.error]);

Expand Down
2 changes: 1 addition & 1 deletion apps/llm/app/llm_structured_output/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function LLMScreen() {

useEffect(() => {
if (llm.error) {
console.log('LLM error:', llm.error);
console.error('LLM error:', llm.error);
}
}, [llm.error]);

Expand Down
2 changes: 1 addition & 1 deletion apps/llm/app/llm_tool_calling/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function LLMToolCallingScreen() {

useEffect(() => {
if (llm.error) {
console.log('LLM error:', llm.error);
console.error('LLM error:', llm.error);
}
}, [llm.error]);

Expand Down
12 changes: 12 additions & 0 deletions apps/llm/app/voice_chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ function VoiceChatScreen() {
}
};

useEffect(() => {
if (llm.error) {
console.error('LLM error:', llm.error);
}
}, [llm.error]);

useEffect(() => {
if (speechToText.error) {
console.error('speechToText error:', speechToText.error);
}
}, [speechToText.error]);

return !llm.isReady || !speechToText.isReady ? (
<Spinner
visible={!llm.isReady || !speechToText.isReady}
Expand Down
5 changes: 3 additions & 2 deletions apps/llm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lint": "eslint . --ext .ts,.tsx --fix"
},
"dependencies": {
"@react-native/metro-config": "^0.76.3",
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
"@react-native/metro-config": "^0.81.5",
"@react-navigation/drawer": "^7.3.9",
"@react-navigation/native": "^7.1.6",
"expo": "^54.0.27",
Expand All @@ -22,7 +23,7 @@
"expo-linking": "~8.0.10",
"expo-router": "~6.0.17",
"expo-status-bar": "~3.0.9",
"metro-config": "^0.81.0",
"metro-config": "^0.81.5",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-audio-api": "^0.8.2",
Expand Down
5 changes: 4 additions & 1 deletion apps/llm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"customConditions": ["react-native"],
"noEmit": true,
"paths": {
"react-native-executorch": ["../../packages/react-native-executorch/src"]
"react-native-executorch": ["../../packages/react-native-executorch/src"],
"@react-native-executorch/expo-resource-fetcher": [
"../../packages/expo-resource-fetcher/src"
]
}
}
}
6 changes: 6 additions & 0 deletions apps/speech/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { SpeechToTextScreen } from './screens/SpeechToTextScreen';
import ColorPalette from './colors';
import ExecutorchLogo from './assets/executorch.svg';
import { Quiz } from './screens/Quiz';
import { initExecutorch } from 'react-native-executorch';
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';

initExecutorch({
resourceFetcher: ExpoResourceFetcher,
});

export default function App() {
const [currentScreen, setCurrentScreen] = useState<
Expand Down
5 changes: 3 additions & 2 deletions apps/speech/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
"lint": "eslint . --ext .ts,.tsx --fix"
},
"dependencies": {
"@react-native/metro-config": "^0.76.3",
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
"@react-native/metro-config": "^0.81.5",
"buffer": "^6.0.3",
"expo": "^54.0.27",
"expo-font": "~14.0.10",
"expo-status-bar": "~3.0.9",
"metro-config": "^0.81.0",
"metro-config": "^0.81.5",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-audio-api": "0.11.3",
Expand Down
5 changes: 4 additions & 1 deletion apps/speech/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"customConditions": ["react-native"],
"noEmit": true,
"paths": {
"react-native-executorch": ["../../packages/react-native-executorch/src"]
"react-native-executorch": ["../../packages/react-native-executorch/src"],
"@react-native-executorch/expo-resource-fetcher": [
"../../packages/expo-resource-fetcher/src"
]
}
}
}
6 changes: 6 additions & 0 deletions apps/text-embeddings/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Drawer } from 'expo-router/drawer';
import { initExecutorch } from 'react-native-executorch';
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';
import ColorPalette from '../colors';
import React, { useState } from 'react';
import { Text, StyleSheet, View } from 'react-native';
Expand All @@ -10,6 +12,10 @@ import {
} from '@react-navigation/drawer';
import { GeneratingContext } from '../context';

initExecutorch({
resourceFetcher: ExpoResourceFetcher,
});

interface CustomDrawerProps extends DrawerContentComponentProps {
isGenerating: boolean;
}
Expand Down
1 change: 1 addition & 0 deletions apps/text-embeddings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@react-navigation/native": "*"
},
"dependencies": {
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
"@react-navigation/drawer": "^7.3.9",
"expo": "^54.0.27",
"expo-constants": "~18.0.11",
Expand Down
5 changes: 4 additions & 1 deletion apps/text-embeddings/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"customConditions": ["react-native"],
"noEmit": true,
"paths": {
"react-native-executorch": ["../../packages/react-native-executorch/src"]
"react-native-executorch": ["../../packages/react-native-executorch/src"],
"@react-native-executorch/expo-resource-fetcher": [
"../../packages/expo-resource-fetcher/src"
]
}
}
}
2 changes: 1 addition & 1 deletion docs/docs/01-fundamentals/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Installation is pretty straightforward, just use your favorite package manager.
</TabItem>
</Tabs>

If you're using bare React Native (instead of a managed Expo project), you also need to install Expo Modules because the underlying implementation relies on expo-file-system. Since expo-file-system is an Expo package, bare React Native projects need **Expo Modules** to properly integrate and use it. The link provided (https://docs.expo.dev/bare/installing-expo-modules/) offers guidance on setting up Expo Modules in a bare React Native environment.
Our library offers support for both bare React Native and Expo projects. Please follow the instructions from [Loading models section](./02-loading-models.md) 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.

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`:

Expand Down
40 changes: 40 additions & 0 deletions docs/docs/01-fundamentals/02-loading-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,46 @@ title: Loading Models

There are three different methods available for loading model files, depending on their size and location.

## Prerequisites

In our library, you can use two different resource fetching mechanisms. One is implemented using Expo FileSystem, the other one uses external library. We encourage you to use implementation utilizing Expo if possible.

To use the Expo adapter, please add these libraries:

```bash
yarn add @react-native-executorch/expo-adapter
yarn add expo-file-system expo-asset
```

and then add the following code in your React Native app:

```typescript
import { initExecutorch } from 'react-native-executorch';
import { ExpoResourceFetcher } from '@react-native-executorch/expo-resource-fetcher';

initExecutorch({
resourceFetcher: ExpoResourceFetcher,
});
```

If you cannot use Expo in your project, proceed with the following steps:

```bash
yarn add @react-native-executorch/bare-adapter
yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
```

and

```typescript
import { initExecutorch } from 'react-native-executorch';
import { BareResourceFetcher } from '@react-native-executorch/bare-adapter';

initExecutorch({
resourceFetcher: BareResourceFetcher,
});
```

**1. Load from React Native assets folder (For Files < 512MB)**

```typescript
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/01-fundamentals/03-frequently-asked-questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If your model doesn't support it, you can still work around it using context. Fo

### Can I use React Native ExecuTorch in bare React Native apps?

To use the library, you need to install Expo Modules first. For a setup guide, refer to [this tutorial](https://docs.expo.dev/bare/installing-expo-modules/). This is because we use Expo File System under the hood to download and manage the model binaries.
Yes, staring from version `0.8.x` you can use React Native ExecuTorch in bare React Native apps. You just need to use bare React Native resource fetcher instead of Expo one, see: [Loading models section](./02-loading-models.md) for more details.

### Do you support the old architecture?

Expand Down
Loading
Loading