From 2e9a2c4d2b96929e77fe7e26c4852d9691e083c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20S=C5=82uszniak?= Date: Fri, 22 May 2026 14:30:39 +0200 Subject: [PATCH 1/3] chore: bump executorch peer deps to 0.9.0 and migrate to models.* accessor - Bump peerDeps/devDeps to react-native-executorch ^0.9.0 and react-native-rag ^0.9.0 across workspaces; package version 0.9.0. - Migrate example app and READMEs from named model constants (ALL_MINILM_L6_V2, QWEN3_0_6B_QUANTIZED, ...) to the new typed models.* registry accessor recommended in rne 0.9.0. - Drop stale imports of symbols that were never exported by react-native-executorch (ALL_MINILM_L6_V2_TOKENIZER, LLAMA3_2_TOKENIZER, LLAMA3_2_1B_TOKENIZER, LLAMA3_2_TOKENIZER_CONFIG). - yarn.lock pins to 0.9.0-nightly-7b452e6-20260522 for local typecheck; regenerate against the published 0.9.0 release before publishing. --- README.md | 59 ++++++++------------------------ example/package.json | 4 +-- example/src/App.tsx | 12 +++---- package.json | 2 +- packages/executorch/README.md | 21 ++++-------- packages/executorch/package.json | 8 ++--- packages/op-sqlite/package.json | 4 +-- yarn.lock | 28 +++++++-------- 8 files changed, 49 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 21769cd..11a0eb1 100644 --- a/README.md +++ b/README.md @@ -65,30 +65,19 @@ import React from 'react'; import { Text } from 'react-native'; import { useRAG, MemoryVectorStore } from 'react-native-rag'; -import { - ALL_MINILM_L6_V2, - ALL_MINILM_L6_V2_TOKENIZER, - LLAMA3_2_1B_QLORA, - LLAMA3_2_1B_TOKENIZER, - LLAMA3_2_TOKENIZER_CONFIG, -} from 'react-native-executorch'; +import { models } from 'react-native-executorch'; import { ExecuTorchEmbeddings, ExecuTorchLLM, } from '@react-native-rag/executorch'; const vectorStore = new MemoryVectorStore({ - embeddings: new ExecuTorchEmbeddings({ - modelSource: ALL_MINILM_L6_V2, - tokenizerSource: ALL_MINILM_L6_V2_TOKENIZER, - }), + embeddings: new ExecuTorchEmbeddings( + models.text_embedding.all_minilm_l6_v2() + ), }); -const llm = new ExecuTorchLLM({ - modelSource: LLAMA3_2_1B_QLORA, - tokenizerSource: LLAMA3_2_1B_TOKENIZER, - tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, -}); +const llm = new ExecuTorchLLM(models.llm.lfm2_5_1_2b_instruct()); const App = () => { const rag = useRAG({ vectorStore, llm }); @@ -109,13 +98,7 @@ import { ExecuTorchEmbeddings, ExecuTorchLLM, } from '@react-native-rag/executorch'; -import { - ALL_MINILM_L6_V2, - ALL_MINILM_L6_V2_TOKENIZER, - LLAMA3_2_1B_QLORA, - LLAMA3_2_1B_TOKENIZER, - LLAMA3_2_TOKENIZER_CONFIG, -} from 'react-native-executorch'; +import { models } from 'react-native-executorch'; const App = () => { const [rag, setRag] = useState(null); @@ -123,15 +106,12 @@ const App = () => { useEffect(() => { const initializeRAG = async () => { - const embeddings = new ExecuTorchEmbeddings({ - modelSource: ALL_MINILM_L6_V2, - tokenizerSource: ALL_MINILM_L6_V2_TOKENIZER, - }); + const embeddings = new ExecuTorchEmbeddings( + models.text_embedding.all_minilm_l6_v2() + ); const llm = new ExecuTorchLLM({ - modelSource: LLAMA3_2_1B_QLORA, - tokenizerSource: LLAMA3_2_1B_TOKENIZER, - tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, + ...models.llm.lfm2_5_1_2b_instruct(), responseCallback: setResponse, }); @@ -163,13 +143,7 @@ import { ExecuTorchEmbeddings, ExecuTorchLLM, } from '@react-native-rag/executorch'; -import { - ALL_MINILM_L6_V2, - ALL_MINILM_L6_V2_TOKENIZER, - LLAMA3_2_1B_QLORA, - LLAMA3_2_1B_TOKENIZER, - LLAMA3_2_TOKENIZER_CONFIG, -} from 'react-native-executorch'; +import { models } from 'react-native-executorch'; const App = () => { const [embeddings, setEmbeddings] = useState(null); @@ -182,16 +156,13 @@ const App = () => { // Instantiate and load the Embeddings Model // NOTE: Calling load on VectorStore will automatically load the embeddings model // so loading the embeddings model separately is not necessary in this case. - const embeddings = await new ExecuTorchEmbeddings({ - modelSource: ALL_MINILM_L6_V2, - tokenizerSource: ALL_MINILM_L6_V2_TOKENIZER, - }).load(); + const embeddings = await new ExecuTorchEmbeddings( + models.text_embedding.all_minilm_l6_v2() + ).load(); // Instantiate and load the Large Language Model const llm = await new ExecuTorchLLM({ - modelSource: LLAMA3_2_1B_QLORA, - tokenizerSource: LLAMA3_2_1B_TOKENIZER, - tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, + ...models.llm.lfm2_5_1_2b_instruct(), responseCallback: setResponse, }).load(); diff --git a/example/package.json b/example/package.json index 92c9605..1b13c9e 100644 --- a/example/package.json +++ b/example/package.json @@ -20,8 +20,8 @@ "react": "19.2.0", "react-dom": "19.2.0", "react-native": "0.83.2", - "react-native-executorch": "^0.8.0", - "react-native-executorch-expo-resource-fetcher": "^0.8.0", + "react-native-executorch": "^0.9.0", + "react-native-executorch-expo-resource-fetcher": "^0.9.0", "react-native-rag": "workspace:*", "react-native-safe-area-context": "~5.6.2", "react-native-svg": "15.15.3", diff --git a/example/src/App.tsx b/example/src/App.tsx index 40a3e8f..420a363 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,10 +1,6 @@ import { type Message, useRAG } from 'react-native-rag'; import { OPSQLiteVectorStore } from '@react-native-rag/op-sqlite'; -import { - QWEN3_0_6B_QUANTIZED, - ALL_MINILM_L6_V2, - initExecutorch, -} from 'react-native-executorch'; +import { initExecutorch, models } from 'react-native-executorch'; import { ExpoResourceFetcher } from 'react-native-executorch-expo-resource-fetcher'; import { ExecuTorchEmbeddings, @@ -39,13 +35,15 @@ export default function App() { const vectorStore = useMemo(() => { return new OPSQLiteVectorStore({ name: 'rag_example_db1', - embeddings: new ExecuTorchEmbeddings(ALL_MINILM_L6_V2), + embeddings: new ExecuTorchEmbeddings( + models.text_embedding.all_minilm_l6_v2() + ), }); }, []); const llm = useMemo(() => { return new ExecuTorchLLM({ - ...QWEN3_0_6B_QUANTIZED, + ...models.llm.qwen3_0_6b(), onDownloadProgress: setDownloadProgress, }); }, []); diff --git a/package.json b/package.json index f2f147d..47f4bb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-rag", - "version": "0.8.0", + "version": "0.9.0", "description": "Private, local RAGs. Supercharge LLMs with your own knowledge base.", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/packages/executorch/README.md b/packages/executorch/README.md index 7096982..056c640 100644 --- a/packages/executorch/README.md +++ b/packages/executorch/README.md @@ -24,13 +24,12 @@ initExecutorch({ resourceFetcher: ExpoResourceFetcher }); This class allows you to use an ExecuTorch-compatible model to generate text embeddings. ```typescript -import { ALL_MINILM_L6_V2, ALL_MINILM_L6_V2_TOKENIZER } from 'react-native-executorch'; +import { models } from 'react-native-executorch'; import { ExecuTorchEmbeddings } from '@react-native-rag/executorch'; -const embeddings = new ExecuTorchEmbeddings({ - modelSource: ALL_MINILM_L6_V2, - tokenizerSource: ALL_MINILM_L6_V2_TOKENIZER, -}); +const embeddings = new ExecuTorchEmbeddings( + models.text_embedding.all_minilm_l6_v2() +); ``` ### `ExecuTorchLLM` @@ -38,18 +37,10 @@ const embeddings = new ExecuTorchEmbeddings({ This class allows you to use an ExecuTorch-compatible language model for text generation. ```typescript -import { - LLAMA3_2_1B, - LLAMA3_2_TOKENIZER, - LLAMA3_2_TOKENIZER_CONFIG, -} from 'react-native-executorch'; +import { models } from 'react-native-executorch'; import { ExecuTorchLLM } from '@react-native-rag/executorch'; -const llm = new ExecuTorchLLM({ - modelSource: LLAMA3_2_1B, - tokenizerSource: LLAMA3_2_TOKENIZER, - tokenizerConfigSource: LLAMA3_2_TOKENIZER_CONFIG, -}); +const llm = new ExecuTorchLLM(models.llm.lfm2_5_1_2b_instruct()); ``` ### Integration with `react-native-rag` diff --git a/packages/executorch/package.json b/packages/executorch/package.json index dd29fbc..a41d950 100644 --- a/packages/executorch/package.json +++ b/packages/executorch/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-rag/executorch", - "version": "0.8.0", + "version": "0.9.0", "main": "src/index.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -17,11 +17,11 @@ "registry": "https://registry.npmjs.org/" }, "peerDependencies": { - "react-native-executorch": "^0.8.0", - "react-native-rag": "^0.8.0" + "react-native-executorch": "^0.9.0", + "react-native-rag": "^0.9.0" }, "devDependencies": { - "react-native-executorch": "^0.8.0", + "react-native-executorch": "^0.9.0", "react-native-rag": "workspace:*" } } diff --git a/packages/op-sqlite/package.json b/packages/op-sqlite/package.json index 6f4c864..bc6ddd8 100644 --- a/packages/op-sqlite/package.json +++ b/packages/op-sqlite/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-rag/op-sqlite", - "version": "0.8.0", + "version": "0.9.0", "main": "src/index.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -18,7 +18,7 @@ }, "peerDependencies": { "@op-engineering/op-sqlite": "^15.2.7", - "react-native-rag": "^0.8.0" + "react-native-rag": "^0.9.0" }, "devDependencies": { "@op-engineering/op-sqlite": "^15.2.7", diff --git a/yarn.lock b/yarn.lock index 72a9097..57d014d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3156,11 +3156,11 @@ __metadata: version: 0.0.0-use.local resolution: "@react-native-rag/executorch@workspace:packages/executorch" dependencies: - react-native-executorch: ^0.8.0 + react-native-executorch: 0.9.0-nightly-7b452e6-20260522 react-native-rag: "workspace:*" peerDependencies: - react-native-executorch: ^0.8.0 - react-native-rag: ^0.8.0 + react-native-executorch: ^0.9.0 + react-native-rag: ^0.9.0 languageName: unknown linkType: soft @@ -3172,7 +3172,7 @@ __metadata: react-native-rag: "workspace:*" peerDependencies: "@op-engineering/op-sqlite": ^15.2.7 - react-native-rag: ^0.8.0 + react-native-rag: ^0.9.0 languageName: unknown linkType: soft @@ -11893,22 +11893,22 @@ __metadata: languageName: node linkType: hard -"react-native-executorch-expo-resource-fetcher@npm:^0.8.0": - version: 0.8.0 - resolution: "react-native-executorch-expo-resource-fetcher@npm:0.8.0" +"react-native-executorch-expo-resource-fetcher@npm:0.9.0-nightly-7b452e6-20260522": + version: 0.9.0-nightly-7b452e6-20260522 + resolution: "react-native-executorch-expo-resource-fetcher@npm:0.9.0-nightly-7b452e6-20260522" peerDependencies: expo: ">=54.0.0" expo-asset: ">=12.0.0" expo-file-system: ">=19.0.0" react-native: "*" react-native-executorch: "*" - checksum: 3ea4d1059e4cde913009bb4d6c5dd76fad27e5c1992538ebb5f65823ca349c11caad1d8209528b1f8ee5e4a438fd9bc923a61dd3f9d8feffd9ae6e3088da9cc7 + checksum: 6fe6e1cf9b82510b7a51c4102ad08d1f3a0a648addda1fbe758dc8149e9dd405258c37508855163f4ff76bba5e3099f3fae8334f86d04cffe4a7d537cef07d0c languageName: node linkType: hard -"react-native-executorch@npm:^0.8.0": - version: 0.8.0 - resolution: "react-native-executorch@npm:0.8.0" +"react-native-executorch@npm:0.9.0-nightly-7b452e6-20260522": + version: 0.9.0-nightly-7b452e6-20260522 + resolution: "react-native-executorch@npm:0.9.0-nightly-7b452e6-20260522" dependencies: "@huggingface/jinja": ^0.5.0 jsonrepair: ^3.12.0 @@ -11918,7 +11918,7 @@ __metadata: peerDependencies: react: "*" react-native: "*" - checksum: 433a287be101ee6883d571cd77c54181606a7935fc4b596207e6773e3cf1967932c6d225520defb13111f4cf50da771830fcccced3d98c5096e41549941474ae + checksum: 80cc7c2a942562f430c765e00ca1e80abaa68f147e12d6b42b05d9114a142d5b1201b135fdcd74fd0b47d22123c58eceb99ae8ed42d4e41f3af45ed90421259d languageName: node linkType: hard @@ -11959,8 +11959,8 @@ __metadata: react-dom: 19.2.0 react-native: 0.83.2 react-native-builder-bob: ^0.40.11 - react-native-executorch: ^0.8.0 - react-native-executorch-expo-resource-fetcher: ^0.8.0 + react-native-executorch: 0.9.0-nightly-7b452e6-20260522 + react-native-executorch-expo-resource-fetcher: 0.9.0-nightly-7b452e6-20260522 react-native-monorepo-config: ^0.1.9 react-native-rag: "workspace:*" react-native-safe-area-context: ~5.6.2 From c62f63209991f7ef024b5949607ba1d956cba0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20S=C5=82uszniak?= Date: Fri, 22 May 2026 14:50:17 +0200 Subject: [PATCH 2/3] chore: pin executorch deps to 0.9.0 nightly so CI can resolve react-native-executorch 0.9.0 is not on npm yet (only nightlies), so ^0.9.0 has no resolution and `yarn install --immutable` fails in CI. Pin to 0.9.0-nightly-7b452e6-20260522 in the workspace and example package.json to unblock CI. Switch back to ^0.9.0 once the release is published. --- example/package.json | 4 ++-- packages/executorch/package.json | 4 ++-- yarn.lock | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/example/package.json b/example/package.json index 1b13c9e..7961893 100644 --- a/example/package.json +++ b/example/package.json @@ -20,8 +20,8 @@ "react": "19.2.0", "react-dom": "19.2.0", "react-native": "0.83.2", - "react-native-executorch": "^0.9.0", - "react-native-executorch-expo-resource-fetcher": "^0.9.0", + "react-native-executorch": "0.9.0-nightly-7b452e6-20260522", + "react-native-executorch-expo-resource-fetcher": "0.9.0-nightly-7b452e6-20260522", "react-native-rag": "workspace:*", "react-native-safe-area-context": "~5.6.2", "react-native-svg": "15.15.3", diff --git a/packages/executorch/package.json b/packages/executorch/package.json index a41d950..8ad66b5 100644 --- a/packages/executorch/package.json +++ b/packages/executorch/package.json @@ -17,11 +17,11 @@ "registry": "https://registry.npmjs.org/" }, "peerDependencies": { - "react-native-executorch": "^0.9.0", + "react-native-executorch": "0.9.0-nightly-7b452e6-20260522", "react-native-rag": "^0.9.0" }, "devDependencies": { - "react-native-executorch": "^0.9.0", + "react-native-executorch": "0.9.0-nightly-7b452e6-20260522", "react-native-rag": "workspace:*" } } diff --git a/yarn.lock b/yarn.lock index 57d014d..9735ccb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3159,7 +3159,7 @@ __metadata: react-native-executorch: 0.9.0-nightly-7b452e6-20260522 react-native-rag: "workspace:*" peerDependencies: - react-native-executorch: ^0.9.0 + react-native-executorch: 0.9.0-nightly-7b452e6-20260522 react-native-rag: ^0.9.0 languageName: unknown linkType: soft From 91dbbe47e4f8bc9d6e10f713b218581e5b8555ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20S=C5=82uszniak?= Date: Mon, 25 May 2026 15:02:54 +0200 Subject: [PATCH 3/3] chore: switch executorch pin back to ^0.9.0 now that 0.9.0 is published react-native-executorch@0.9.0 and react-native-executorch-expo-resource-fetcher@0.9.0 are now on npm, so the temporary nightly pin can be reverted. Lockfile regenerated against the release. --- example/package.json | 4 ++-- packages/executorch/package.json | 4 ++-- yarn.lock | 32 ++++++++++++-------------------- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/example/package.json b/example/package.json index 7961893..1b13c9e 100644 --- a/example/package.json +++ b/example/package.json @@ -20,8 +20,8 @@ "react": "19.2.0", "react-dom": "19.2.0", "react-native": "0.83.2", - "react-native-executorch": "0.9.0-nightly-7b452e6-20260522", - "react-native-executorch-expo-resource-fetcher": "0.9.0-nightly-7b452e6-20260522", + "react-native-executorch": "^0.9.0", + "react-native-executorch-expo-resource-fetcher": "^0.9.0", "react-native-rag": "workspace:*", "react-native-safe-area-context": "~5.6.2", "react-native-svg": "15.15.3", diff --git a/packages/executorch/package.json b/packages/executorch/package.json index 8ad66b5..a41d950 100644 --- a/packages/executorch/package.json +++ b/packages/executorch/package.json @@ -17,11 +17,11 @@ "registry": "https://registry.npmjs.org/" }, "peerDependencies": { - "react-native-executorch": "0.9.0-nightly-7b452e6-20260522", + "react-native-executorch": "^0.9.0", "react-native-rag": "^0.9.0" }, "devDependencies": { - "react-native-executorch": "0.9.0-nightly-7b452e6-20260522", + "react-native-executorch": "^0.9.0", "react-native-rag": "workspace:*" } } diff --git a/yarn.lock b/yarn.lock index 9735ccb..2dd92da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3156,10 +3156,10 @@ __metadata: version: 0.0.0-use.local resolution: "@react-native-rag/executorch@workspace:packages/executorch" dependencies: - react-native-executorch: 0.9.0-nightly-7b452e6-20260522 + react-native-executorch: ^0.9.0 react-native-rag: "workspace:*" peerDependencies: - react-native-executorch: 0.9.0-nightly-7b452e6-20260522 + react-native-executorch: ^0.9.0 react-native-rag: ^0.9.0 languageName: unknown linkType: soft @@ -11567,13 +11567,6 @@ __metadata: languageName: node linkType: hard -"pngjs@npm:^7.0.0": - version: 7.0.0 - resolution: "pngjs@npm:7.0.0" - checksum: b19a018930d27de26229c1b3ff250b3a25d09caa22cbb0b0459987d91eb0a560a18ab5d67da45a38ed7514140f26d1db58de83c31159ec101f2bb270a3c707f1 - languageName: node - linkType: hard - "possible-typed-array-names@npm:^1.0.0": version: 1.1.0 resolution: "possible-typed-array-names@npm:1.1.0" @@ -11893,32 +11886,31 @@ __metadata: languageName: node linkType: hard -"react-native-executorch-expo-resource-fetcher@npm:0.9.0-nightly-7b452e6-20260522": - version: 0.9.0-nightly-7b452e6-20260522 - resolution: "react-native-executorch-expo-resource-fetcher@npm:0.9.0-nightly-7b452e6-20260522" +"react-native-executorch-expo-resource-fetcher@npm:^0.9.0": + version: 0.9.0 + resolution: "react-native-executorch-expo-resource-fetcher@npm:0.9.0" peerDependencies: expo: ">=54.0.0" expo-asset: ">=12.0.0" expo-file-system: ">=19.0.0" react-native: "*" react-native-executorch: "*" - checksum: 6fe6e1cf9b82510b7a51c4102ad08d1f3a0a648addda1fbe758dc8149e9dd405258c37508855163f4ff76bba5e3099f3fae8334f86d04cffe4a7d537cef07d0c + checksum: c7e31ff0cdf6d37a6205650a63808e443a690cedbb2df1b2b45e0ad0777caa020e396f44a55662eb2b4da6bb061bd9764e6a64109e54db8a1bab34da49bafb71 languageName: node linkType: hard -"react-native-executorch@npm:0.9.0-nightly-7b452e6-20260522": - version: 0.9.0-nightly-7b452e6-20260522 - resolution: "react-native-executorch@npm:0.9.0-nightly-7b452e6-20260522" +"react-native-executorch@npm:^0.9.0": + version: 0.9.0 + resolution: "react-native-executorch@npm:0.9.0" dependencies: "@huggingface/jinja": ^0.5.0 jsonrepair: ^3.12.0 jsonschema: ^1.5.0 - pngjs: ^7.0.0 zod: ^4.3.6 peerDependencies: react: "*" react-native: "*" - checksum: 80cc7c2a942562f430c765e00ca1e80abaa68f147e12d6b42b05d9114a142d5b1201b135fdcd74fd0b47d22123c58eceb99ae8ed42d4e41f3af45ed90421259d + checksum: 2a82198053da86694c6f7dc9f1b658d03fdbd1ff3e672f2979972725b82f1307f0fef910b5e4be88018adf7b43e66d48624ec6f0e0f766490d07a6923427cc8d languageName: node linkType: hard @@ -11959,8 +11951,8 @@ __metadata: react-dom: 19.2.0 react-native: 0.83.2 react-native-builder-bob: ^0.40.11 - react-native-executorch: 0.9.0-nightly-7b452e6-20260522 - react-native-executorch-expo-resource-fetcher: 0.9.0-nightly-7b452e6-20260522 + react-native-executorch: ^0.9.0 + react-native-executorch-expo-resource-fetcher: ^0.9.0 react-native-monorepo-config: ^0.1.9 react-native-rag: "workspace:*" react-native-safe-area-context: ~5.6.2