Skip to main content

Package Installation

Choose the packages based on your feature requirements:

Full Installation (All Features)

LLM Only (Text Generation)

Voice Only (STT/TTS)

Required Peer Dependencies

The SDK uses Nitro Modules for its native bridge and requires file system access for model downloads:
react-native-fs is required for model downloads. react-native-nitro-modules is required for the native bridge between JavaScript and the SDK’s native inference engines.
Include only the SDK modules you need. Each native module adds to your app size: - @runanywhere/core: ~2MB (required) - @runanywhere/llamacpp: ~15-25MB (for LLM text generation) - @runanywhere/onnx: ~50-70MB (for STT, TTS, and VAD)

Package Overview

Supported Model Formats

iOS Setup

automaticPodsInstallation must be set to false in react-native.config.js because @runanywhere packages use podspecPath which is not compatible with RN 0.83+ CLI auto-install. Pods must be installed manually.

Podfile Requirements

The NitroModules pod must be manually added in your Podfile:
Podfile

New Architecture (iOS)

If you encounter crashes with react-native-screens or native stack navigator on iOS with New Architecture, disable it:
Podfile
Use @react-navigation/stack (JS-based) instead of @react-navigation/native-stack on iOS, and mock react-native-screens via Metro config if needed.

iOS Permissions

Add required permissions to your Info.plist:
Info.plist
NSMicrophoneUsageDescription is only required if you’re using STT or VAD with microphone input. The app does NOT need NSAllowsArbitraryLoads — configure specific exceptions as needed.

Android Setup

Native libraries are automatically downloaded during the Gradle build.

Android Build Requirements

Gradle Configuration

In android/settings.gradle, explicitly include react-native-nitro-modules:
settings.gradle
In android/app/build.gradle, add pickFirsts to resolve duplicate native library conflicts:
app/build.gradle

Android Permissions

Add required permissions to your AndroidManifest.xml:
AndroidManifest.xml
Runtime permission for RECORD_AUDIO must be requested via PermissionsAndroid.request() before using STT or Voice Pipeline features.

Running on Physical Device

  1. Enable Developer Options: Settings → About Phone → Tap “Build Number” 7 times
  2. Enable USB Debugging: Settings → Developer Options → USB Debugging
  3. Connect device: adb devices (should show your device)
  4. Port forwarding: adb reverse tcp:8081 tcp:8081
  5. Start Metro: npm start
  6. Run app: npx react-native run-android

ProGuard Rules

If using ProGuard/R8 minification, add these rules to proguard-rules.pro:
proguard-rules.pro

Troubleshooting Installation

iOS: Pod Install Fails

Android: Native Library Not Found

This error typically occurs when running on an emulator:
Solution: Use a physical ARM64 Android device. Emulators are not supported. If using a physical device:

Android: “hermesEnabled” Property Not Found

Solution: Copy the gradle.properties example file:

Android: “Unable to load script” on Device

Solution: Set up port forwarding for Metro bundler:

Android: Grey Screen After Launch

Solution: Metro bundler may have stopped. Restart it:

Metro: Module Resolution Issues

Both Platforms: Fresh Build

Native Binary Sizes

The ONNX backend is significantly larger due to the ONNX Runtime library. If you only need LLM text generation, consider installing just @runanywhere/llamacpp to reduce app size.

Next Steps

Quick Start

Initialize the SDK and run your first inference →