> ## 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.

# Introduction

> RunAnywhere React Native SDK for iOS and Android

<div style={{ marginBottom: '24px' }}>
  <button
    id="copy-all-btn"
    onClick={() => {
  const btn = document.getElementById('copy-all-btn')
  btn.innerText = 'Copying...'
  fetch('/llms-full.txt')
    .then((res) => (res.ok ? res.text() : Promise.reject()))
    .then((text) => {
      const sections = text.split(/(?=^# )/m)
      const filtered = sections.filter((s) =>
        s.includes('Source: https://docs.runanywhere.ai/react-native/')
      )
      if (filtered.length === 0) throw new Error('empty')
      return filtered.join('\n')
    })
    .catch(() => document.getElementById('full-guide-content').innerText)
    .then((text) => navigator.clipboard.writeText(text))
    .then(() => {
      btn.innerText = 'Copied!'
      setTimeout(() => {
        btn.innerText = 'Copy Full React Native SDK Docs for AI Agent'
      }, 2000)
    })
}}
    style={{
  background: 'linear-gradient(135deg, #ff6900 0%, #fb2c36 100%)',
  color: 'white',
  border: 'none',
  padding: '12px 24px',
  borderRadius: '8px',
  fontSize: '16px',
  fontWeight: '600',
  cursor: 'pointer',
  display: 'flex',
  alignItems: 'center',
  gap: '8px',
}}
  >
    Copy Full React Native SDK Docs for AI Agent
  </button>
</div>

<div id="full-guide-content">
  ## Overview

  The **RunAnywhere React Native SDK** is a production-grade, on-device AI SDK for React Native applications. It enables developers to run AI models directly on iOS and Android devices without requiring network connectivity for inference, ensuring minimal latency and maximum privacy for your users.

  The SDK provides a unified interface to multiple AI capabilities:

  <CardGroup cols={3}>
    <Card title="LLM" icon="brain" href="/react-native/llm/chat">
      Text generation with streaming support via async iterators
    </Card>

    <Card title="STT" icon="microphone" href="/react-native/stt/transcribe">
      Speech-to-text transcription with Whisper models
    </Card>

    <Card title="TTS" icon="volume-high" href="/react-native/tts/synthesize">
      Neural voice synthesis with Piper TTS
    </Card>

    <Card title="Tool Calling" icon="wrench" href="/react-native/tool-calling">
      Function calling with typed tool definitions and parseToolCall
    </Card>

    <Card title="VAD" icon="waveform" href="/react-native/vad">
      Real-time voice activity detection with Silero VAD
    </Card>
  </CardGroup>

  ## Key Capabilities

  * **Multi-backend architecture** – Choose from LlamaCPP (GGUF models) or ONNX Runtime
  * **Cross-platform** – Single codebase for iOS and Android
  * **TypeScript-first** – Full type safety and IDE autocomplete
  * **Production-ready** – Built-in analytics, logging, and model lifecycle management

  ## Core Philosophy

  <AccordionGroup>
    <Accordion title="On-Device First" icon="microchip">
      All AI inference runs locally, ensuring low latency and data privacy. Once models are
      downloaded, no network connection is required for inference.
    </Accordion>

    <Accordion title="Modular Architecture" icon="puzzle-piece">
      Backend engines are optional packages—include only what you need. This keeps your app bundle
      size minimal.
    </Accordion>

    <Accordion title="Privacy by Design" icon="shield-check">
      Audio and text data never leaves the device unless explicitly configured. Only anonymous
      analytics are collected by default.
    </Accordion>

    <Accordion title="Platform Parity" icon="equals">
      API mirrors the iOS Swift SDK and Android Kotlin SDK for consistent cross-platform development.
    </Accordion>
  </AccordionGroup>

  ## Features

  ### Language Models (LLM)

  * On-device text generation with streaming support
  * Async iterator-based token streaming
  * System prompts and customizable generation parameters
  * Support for thinking/reasoning models
  * LlamaCPP backend for GGUF models

  ### Speech-to-Text (STT)

  * Real-time streaming transcription
  * Batch audio transcription
  * Multi-language support
  * Whisper-based models via ONNX Runtime

  ### Text-to-Speech (TTS)

  * Neural voice synthesis with Piper TTS
  * System voices via platform TTS
  * Streaming audio generation for long text
  * Customizable voice, pitch, rate, and volume

  ### Voice Activity Detection (VAD)

  * Energy-based speech detection with Silero VAD
  * Configurable sensitivity thresholds
  * Real-time audio stream processing

  ### Tool Calling

  * Register typed tool definitions with parameter schemas
  * Automatic tool execution with configurable limits
  * Manual parsing with parseToolCall for custom flows
  * Multi-tool chaining for complex agent workflows

  ### Voice Agent Pipeline

  * Full VAD → STT → LLM → TTS orchestration
  * Complete voice conversation flow
  * Push-to-talk and hands-free modes

  ## System Requirements

  | Platform     | Minimum Version |
  | ------------ | --------------- |
  | React Native | 0.74+           |
  | iOS          | 15.1+           |
  | Android      | API 24 (7.0+)   |

  **Node.js:** 18+

  **TypeScript:** 5.0+ (recommended)

  <Note>
    Apple Silicon devices (M1/M2/M3, A14+) and Android devices with 6GB+ RAM are recommended. Metal
    GPU acceleration provides 3-5x speedup on iOS.
  </Note>

  ## Multi-Package Architecture

  | Package                 | Purpose                              |
  | ----------------------- | ------------------------------------ |
  | `@runanywhere/core`     | Core SDK (required)                  |
  | `@runanywhere/llamacpp` | LLM text generation with GGUF models |
  | `@runanywhere/onnx`     | STT/TTS/VAD via ONNX Runtime         |

  ## Architecture

  ```mermaid theme={null}
  graph TB
      A(Your React Native App)
      A --> B(@runanywhere/core)

      B --> C(LLM)
      B --> D(STT)
      B --> E(TTS)
      B --> F(VAD)

      B --> G(VoiceAgent - Orchestration)

      C & D & E & F & G --> H(Native Layer - JSI/Nitro)

      H --> I(llama.cpp - LLM)
      H --> J(ONNX Runtime + Sherpa-ONNX)

      style A fill:#334155,color:#fff,stroke:#334155
      style B fill:#ff6900,color:#fff,stroke:#ff6900
      style C fill:#475569,color:#fff,stroke:#475569
      style D fill:#475569,color:#fff,stroke:#475569
      style E fill:#475569,color:#fff,stroke:#475569
      style F fill:#475569,color:#fff,stroke:#475569
      style G fill:#ff6900,color:#fff,stroke:#ff6900
      style H fill:#fb2c36,color:#fff,stroke:#fb2c36
      style I fill:#475569,color:#fff,stroke:#475569
      style J fill:#475569,color:#fff,stroke:#475569
  ```

  ## Example Apps

  Working example apps to help you get started:

  * [**React Native Starter App**](https://github.com/RunanywhereAI/react-native-starter-app) – Bare React Native CLI app with Chat, STT, TTS, and Voice Pipeline demos
  * [**Monorepo Example**](https://github.com/RunanywhereAI/runanywhere-sdks/tree/main/examples/react-native/RunAnywhereAI) – Full-featured reference app from the SDK repository

  ## Next Steps

  <CardGroup cols={2}>
    <Card title="Installation" icon="download" href="/react-native/installation">
      Add the SDK to your project via npm
    </Card>

    <Card title="Quick Start" icon="rocket" href="/react-native/quick-start">
      Build your first AI feature in minutes
    </Card>
  </CardGroup>
</div>
