> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runanywhere.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the RunAnywhere Flutter SDK

## Packages on pub.dev

The RunAnywhere Flutter SDK consists of three packages:

| Package                                                                 | Description                           | pub.dev                                                                                                                |
| ----------------------------------------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [`runanywhere`](https://pub.dev/packages/runanywhere)                   | Core SDK with APIs and infrastructure | [![pub package](https://img.shields.io/pub/v/runanywhere.svg)](https://pub.dev/packages/runanywhere)                   |
| [`runanywhere_llamacpp`](https://pub.dev/packages/runanywhere_llamacpp) | LLM text generation (GGUF models)     | [![pub package](https://img.shields.io/pub/v/runanywhere_llamacpp.svg)](https://pub.dev/packages/runanywhere_llamacpp) |
| [`runanywhere_onnx`](https://pub.dev/packages/runanywhere_onnx)         | STT, TTS, VAD (ONNX models)           | [![pub package](https://img.shields.io/pub/v/runanywhere_onnx.svg)](https://pub.dev/packages/runanywhere_onnx)         |

## Add Dependencies

Add the packages you need to your `pubspec.yaml`:

<Tabs>
  <Tab title="LLM Only">
    Add these dependencies to `pubspec.yaml`:

    ```yaml theme={null}
    dependencies:
      runanywhere: ^0.16.0
      runanywhere_llamacpp: ^0.16.0
    ```
  </Tab>

  <Tab title="STT/TTS Only">
    Add these dependencies to `pubspec.yaml`:

    ```yaml theme={null}
    dependencies:
      runanywhere: ^0.16.0
      runanywhere_onnx: ^0.16.0
    ```
  </Tab>

  <Tab title="All Features">
    Add these dependencies to `pubspec.yaml`:

    ```yaml theme={null}
    dependencies:
      runanywhere: ^0.16.0
      runanywhere_llamacpp: ^0.16.0
      runanywhere_onnx: ^0.16.0
    ```
  </Tab>
</Tabs>

Then run:

```bash theme={null}
flutter pub get
```

## iOS Setup (Required)

After adding the packages, update your iOS configuration:

### 1. Update Podfile

Open `ios/Podfile` and update:

```ruby ios/Podfile theme={null}
# Set minimum iOS version to 14.0
platform :ios, '14.0'

target 'Runner' do
  # REQUIRED: Add static linkage
  use_frameworks! :linkage => :static

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
      # Required for microphone and speech recognition permissions
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        'PERMISSION_MICROPHONE=1',
        'PERMISSION_SPEECH_RECOGNIZER=1',
      ]
    end
  end
end
```

<Warning>
  Without `use_frameworks! :linkage => :static`, you will encounter "symbol not found" errors at
  runtime.
</Warning>

### 2. Add Microphone Permission

Add to `ios/Runner/Info.plist` (for STT/Voice features):

```xml ios/Runner/Info.plist theme={null}
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for speech recognition and voice commands.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>This app uses on-device speech recognition to transcribe your voice.</string>
```

### 3. Install Pods

```bash theme={null}
cd ios && pod install && cd ..
```

## Android Setup

Add required permissions to `android/app/src/main/AndroidManifest.xml`:

```xml android/app/src/main/AndroidManifest.xml theme={null}
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
```

Also set `android:usesCleartextTraffic="true"` on the `<application>` tag if your app downloads models over HTTP or uses HTTP APIs (e.g., weather).

### Android Build Configuration

The recommended Gradle configuration for optimal performance:

```kotlin android/gradle.properties theme={null}
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m
```

<Note>
  The higher JVM memory allocation (`-Xmx8G`) may be needed for native SDK compilation. Android
  requires Java 17 compatibility.
</Note>

## Verify Installation

Run your app to verify everything is set up correctly:

```bash theme={null}
flutter run
```

## Starter Example

Want to see a complete working example? Check out our official Flutter starter app:

<Card title="Flutter Starter Example" icon="github" href="https://github.com/RunanywhereAI/flutter-starter-example">
  Clone and run a complete example app with LLM, STT, TTS, and Voice Agent
</Card>

```bash theme={null}
git clone https://github.com/RunanywhereAI/flutter-starter-example.git
cd flutter-starter-example
flutter pub get
flutter run
```

## Next Steps

<Card title="Quick Start" icon="rocket" href="/flutter/quick-start">
  Build your first AI feature →
</Card>
