Skip to main content

Package Installation

Choose the packages based on your feature requirements:

Full Installation (All Features)

npm install @runanywhere/core @runanywhere/llamacpp @runanywhere/onnx
# or
yarn add @runanywhere/core @runanywhere/llamacpp @runanywhere/onnx

LLM Only (Text Generation)

npm install @runanywhere/core @runanywhere/llamacpp
# or
yarn add @runanywhere/core @runanywhere/llamacpp

Voice Only (STT/TTS)

npm install @runanywhere/core @runanywhere/onnx
# or
yarn add @runanywhere/core @runanywhere/onnx
Include only the 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

PackageSizeFeatures
@runanywhere/core~2MBCore SDK, model management, events
@runanywhere/llamacpp~15-25MBLLM text generation (GGUF models)
@runanywhere/onnx~50-70MBSTT, TTS, VAD (ONNX models)

Supported Model Formats

FormatExtensionBackendUse Case
GGUF.ggufLlamaCPPLLM text generation
ONNX.onnxONNX RuntimeSTT, TTS, VAD

iOS Setup

After installing packages, run CocoaPods:
cd ios && pod install && cd ..

iOS Permissions

Add required permissions to your Info.plist:
Info.plist
<!-- Required for model downloads -->
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

<!-- Required for STT/VAD with microphone -->
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for voice features.</string>

<!-- Required for background audio (optional) -->
<key>UIBackgroundModes</key>
<array>
  <string>audio</string>
</array>
NSMicrophoneUsageDescription is only required if you’re using STT or VAD with microphone input.

Android Setup

No additional setup required for most configurations. Native libraries are automatically downloaded during the Gradle build.

Android Permissions

Add required permissions to your AndroidManifest.xml:
AndroidManifest.xml
<!-- Required for model downloads -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Required for STT/VAD with microphone -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<!-- Required for large model storage (optional) -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="28" />

ProGuard Rules

If using ProGuard/R8 minification, add these rules to proguard-rules.pro:
proguard-rules.pro
-keep class com.runanywhere.** { *; }
-keepclassmembers class com.runanywhere.** { *; }
-keep class ai.runanywhere.** { *; }

Troubleshooting Installation

iOS: Pod Install Fails

# Clean and reinstall pods
cd ios
rm -rf Pods Podfile.lock
pod cache clean --all
pod install
cd ..

Android: Native Library Not Found

# Clean and rebuild
cd android
./gradlew clean
cd ..
npx react-native run-android

Metro: Module Resolution Issues

# Reset Metro bundler cache
npx react-native start --reset-cache

Both Platforms: Fresh Build

# Complete clean build
rm -rf node_modules
npm install
cd ios && pod install && cd ..
npx react-native run-ios  # or run-android

Native Binary Sizes

FrameworkiOS (xcframework)Android (so)
RACommons~2MB~2MB
RABackendLLAMACPP~15-25MB~15-25MB
RABackendONNX~50-70MB~50-70MB
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 →