npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yocontra/react-native-executorch

v0.8.1

Published

An easy way to run AI models in React Native with ExecuTorch

Downloads

508

Readme

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 page to explore these models.

ExecuTorch, developed by Meta, is a novel framework allowing AI model execution on devices like mobile phones or microcontrollers.

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.

npm version npm nightly CI

:yin_yang: Supported Versions

The minimal supported version are:

  • iOS 17.0
  • Android 13
  • React Native 0.81

[!IMPORTANT] React Native ExecuTorch supports only the New React Native architecture.

:earth_africa: Real-world Example

React Native ExecuTorch is powering Private Mind, a privacy-first mobile AI app available on App Store and Google Play.

:llama: Quickstart - Running Llama

Get started with AI-powered text generation in 3 easy steps!

:one: Installation

# 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-resource-fetcher
yarn add expo-file-system expo-asset

#if you use bare React Native project use these packages:
yarn add @react-native-executorch/bare-resource-fetcher
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 >

:two: Setup & Initialization

Add this to your component file:

import {
  useLLM,
  LLAMA3_2_1B,
  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: LLAMA3_2_1B });
  // ... rest of your component
}

:three: Run the Model!

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('Llama says:', llm.response);
};

:calling: Demo Apps

We currently host a few example 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

If you would like to run demo app, navigate to its project directory and install dependencies with:

yarn

Then, depending on the platform, choose either iOS or Android:

yarn expo run:< ios | android >

[!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.

:robot: 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 and optimum-executorch README.

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

:balance_scale: License

This library is licensed under The MIT License.

:soon: What's Next?

To learn about our upcoming plans and developments, please visit our milestones.

React Native ExecuTorch is created by Software Mansion

Since 2012, Software Mansion 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.

swm