From 740fe83d796a8dd17000bfdb18a531eb25e2b831 Mon Sep 17 00:00:00 2001 From: Norbert Klockiewicz Date: Thu, 9 Apr 2026 14:26:28 +0200 Subject: [PATCH 1/3] feat: add LFM2.5-VL-450M quantized model (#1066) ## Description Adds the `LFM2_VL_450M_QUANTIZED` model constant for the new 450M quantized LFM2.5-VL variant. Reuses the existing LFM2.5-VL tokenizer and tokenizer config, and registers the model in `MODEL_REGISTRY`. ### Introduces a breaking change? - [ ] Yes - [x] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [x] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions 1. Import `LFM2_VL_450M_QUANTIZED` from `react-native-executorch`. 2. Pass it to `useLLM` and verify the model downloads and runs inference with image input. ### Screenshots ### Related issues ### Checklist - [x] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [x] My changes generate no new warnings ### Additional notes Tokenizer and tokenizer config are shared with `LFM2_VL_1_6B_QUANTIZED`. --- .../01-natural-language-processing/useLLM.md | 1 + .../01-natural-language-processing/useLLM.md | 1 + .../src/constants/modelUrls.ts | 25 ++++++++++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/docs/03-hooks/01-natural-language-processing/useLLM.md b/docs/docs/03-hooks/01-natural-language-processing/useLLM.md index ad26123ef..15d6d3191 100644 --- a/docs/docs/03-hooks/01-natural-language-processing/useLLM.md +++ b/docs/docs/03-hooks/01-natural-language-processing/useLLM.md @@ -561,4 +561,5 @@ const handleGenerate = async () => { | [SmolLM 2](https://huggingface.co/software-mansion/react-native-executorch-smolLm-2) | 135M, 360M, 1.7B | ✅ | - | | [LLaMA 3.2](https://huggingface.co/software-mansion/react-native-executorch-llama-3.2) | 1B, 3B | ✅ | - | | [LFM2.5](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5) | 350M, 1.2B, 1.6B-VL | ✅ | - | +| [LFM2.5-VL-450M](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5/tree/main/lfm2.5-VL-450M) | 450M | ✅ | vision | | [LFM2.5-VL-1.6B](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5/tree/main/lfm2.5-VL-1.6B) | 1.6B | ✅ | vision | diff --git a/docs/versioned_docs/version-0.8.x/03-hooks/01-natural-language-processing/useLLM.md b/docs/versioned_docs/version-0.8.x/03-hooks/01-natural-language-processing/useLLM.md index d881d9292..14fe51c21 100644 --- a/docs/versioned_docs/version-0.8.x/03-hooks/01-natural-language-processing/useLLM.md +++ b/docs/versioned_docs/version-0.8.x/03-hooks/01-natural-language-processing/useLLM.md @@ -561,4 +561,5 @@ const handleGenerate = async () => { | [SmolLM 2](https://huggingface.co/software-mansion/react-native-executorch-smolLm-2) | 135M, 360M, 1.7B | ✅ | - | | [LLaMA 3.2](https://huggingface.co/software-mansion/react-native-executorch-llama-3.2) | 1B, 3B | ✅ | - | | [LFM2.5](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5) | 350M, 1.2B, 1.6B-VL | ✅ | - | +| [LFM2.5-VL-450M](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5/tree/v0.8.0/lfm2.5-VL-450M) | 450M | ✅ | vision | | [LFM2.5-VL-1.6B](https://huggingface.co/software-mansion/react-native-executorch-lfm-2.5/tree/v0.8.0/lfm2.5-VL-1.6B) | 1.6B | ✅ | vision | diff --git a/packages/react-native-executorch/src/constants/modelUrls.ts b/packages/react-native-executorch/src/constants/modelUrls.ts index 2eb3c3f41..3bf07a175 100644 --- a/packages/react-native-executorch/src/constants/modelUrls.ts +++ b/packages/react-native-executorch/src/constants/modelUrls.ts @@ -433,8 +433,13 @@ export const LFM2_5_350M_QUANTIZED = { // LFM2.5-VL-1.6B const LFM2_VL_1_6B_QUANTIZED_MODEL = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/quantized/lfm2_5_vl_1_6b_8da4w_xnnpack.pte`; -const LFM2_VL_TOKENIZER = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/tokenizer.json`; -const LFM2_VL_TOKENIZER_CONFIG = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/tokenizer_config.json`; +const LFM2_VL_1_6B_TOKENIZER = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/tokenizer.json`; +const LFM2_VL_1_6B_TOKENIZER_CONFIG = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-1.6B/tokenizer_config.json`; + +// LFM2.5-VL-450M +const LFM2_VL_450M_QUANTIZED_MODEL = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-450M/lfm2_5_vl_450m_8da4w_xnnpack.pte`; +const LFM2_VL_450M_TOKENIZER = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-450M/tokenizer.json`; +const LFM2_VL_450M_TOKENIZER_CONFIG = `${URL_PREFIX}-lfm-2.5/${VERSION_TAG}/lfm2.5-VL-450M/tokenizer_config.json`; /** * @category Models - VLM @@ -443,8 +448,19 @@ export const LFM2_VL_1_6B_QUANTIZED = { modelName: 'lfm2.5-vl-1.6b-quantized', capabilities: ['vision'], modelSource: LFM2_VL_1_6B_QUANTIZED_MODEL, - tokenizerSource: LFM2_VL_TOKENIZER, - tokenizerConfigSource: LFM2_VL_TOKENIZER_CONFIG, + tokenizerSource: LFM2_VL_1_6B_TOKENIZER, + tokenizerConfigSource: LFM2_VL_1_6B_TOKENIZER_CONFIG, +} as const; + +/** + * @category Models - VLM + */ +export const LFM2_VL_450M_QUANTIZED = { + modelName: 'lfm2.5-vl-450m-quantized', + capabilities: ['vision'], + modelSource: LFM2_VL_450M_QUANTIZED_MODEL, + tokenizerSource: LFM2_VL_450M_TOKENIZER, + tokenizerConfigSource: LFM2_VL_450M_TOKENIZER_CONFIG, } as const; // Classification @@ -1106,6 +1122,7 @@ export const MODEL_REGISTRY = { LFM2_5_1_2B_INSTRUCT, LFM2_5_1_2B_INSTRUCT_QUANTIZED, LFM2_VL_1_6B_QUANTIZED, + LFM2_VL_450M_QUANTIZED, EFFICIENTNET_V2_S, EFFICIENTNET_V2_S_QUANTIZED, SSDLITE_320_MOBILENET_V3_LARGE, From 8dfa50f849301891a4fdfa2b574803c71be5ba58 Mon Sep 17 00:00:00 2001 From: Norbert Klockiewicz Date: Thu, 9 Apr 2026 15:32:31 +0200 Subject: [PATCH 2/3] fix: add missing lfm type to LLMModelName (#1069) ## Description ### Introduces a breaking change? - [ ] Yes - [ ] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions ### Screenshots ### Related issues ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes --- packages/react-native-executorch/src/types/llm.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native-executorch/src/types/llm.ts b/packages/react-native-executorch/src/types/llm.ts index f37dbb9cd..83f9630c1 100644 --- a/packages/react-native-executorch/src/types/llm.ts +++ b/packages/react-native-executorch/src/types/llm.ts @@ -55,7 +55,8 @@ export type LLMModelName = | 'lfm2.5-350m-quantized' | 'lfm2.5-1.2b-instruct' | 'lfm2.5-1.2b-instruct-quantized' - | 'lfm2.5-vl-1.6b-quantized'; + | 'lfm2.5-vl-1.6b-quantized' + | 'lfm2.5-vl-450m-quantized'; /** * Properties for initializing and configuring a Large Language Model (LLM) instance. From b7065ebb8c004e32e35cf425c2cbd5703162723a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Kopci=C5=84ski?= Date: Thu, 9 Apr 2026 15:34:22 +0200 Subject: [PATCH 3/3] Release v0.8.2 --- packages/react-native-executorch/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-executorch/package.json b/packages/react-native-executorch/package.json index 80dbe1e06..ba8cb30bb 100644 --- a/packages/react-native-executorch/package.json +++ b/packages/react-native-executorch/package.json @@ -1,6 +1,6 @@ { "name": "react-native-executorch", - "version": "0.8.1", + "version": "0.8.2", "description": "An easy way to run AI models in React Native with ExecuTorch", "source": "./src/index.ts", "main": "./lib/module/index.js",