> ## 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 Flutter 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/flutter/')
      )
      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 Flutter 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 Flutter SDK Docs for AI Agent
  </button>
</div>

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

  The **RunAnywhere Flutter SDK** is a production-grade, on-device AI SDK for Flutter 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="/flutter/llm/chat">
      Text generation with streaming support via Dart Streams
    </Card>

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

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

    <Card title="Tool Calling" icon="wrench" href="/flutter/tool-calling">
      Function calling with RunAnywhereTools and sealed ToolValue types
    </Card>

    <Card title="VAD" icon="waveform" href="/flutter/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
  * **Dart-native** – Built with async/await and Streams for reactive programming
  * **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 Backends" icon="puzzle-piece">
      Backend engines are separate 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="Event-Driven" icon="bell">
      Subscribe to SDK events for reactive UI updates and observability.
    </Accordion>
  </AccordionGroup>

  ## Features

  ### Language Models (LLM)

  * On-device text generation with streaming support
  * Dart Stream-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 via RunAnywhereTools
  * Automatic tool execution with configurable limits
  * Dart 3 sealed class ToolValue types with pattern matching
  * 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 |
  | -------- | --------------- |
  | Flutter  | 3.10.0+         |
  | Dart     | 3.0.0+          |
  | iOS      | 14.0+           |
  | Android  | API 24 (7.0+)   |

  <Note>
    ARM64 devices are recommended for best performance. Metal GPU acceleration on iOS and NEON SIMD on
    Android provide significant speedups over CPU-only inference.
  </Note>

  ## Package Composition

  | Package                | Size      | Purpose                              |
  | ---------------------- | --------- | ------------------------------------ |
  | `runanywhere`          | \~5MB     | Core SDK (required)                  |
  | `runanywhere_llamacpp` | \~15-25MB | LLM text generation with GGUF models |
  | `runanywhere_onnx`     | \~50-70MB | STT/TTS/VAD via ONNX Runtime         |

  ## Architecture

  ```mermaid theme={null}
  graph TB
      A(Your Flutter Application)
      A --> B(RunAnywhere Flutter SDK)

      B --> C(RunAnywhere API)
      B --> D(EventBus)
      B --> E(ModelRegistry)

      C & D & E --> F(DartBridge - FFI to C++)

      F --> G(LlamaCpp - LLM)
      F --> H(ONNX - STT/TTS/VAD)
      F --> I(Future Backends)

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

  ## Starter Example

  <Card title="Flutter Starter Example" icon="github" href="https://github.com/RunanywhereAI/flutter-starter-example">
    Complete working example with LLM chat, STT, TTS, and Voice Agent demos
  </Card>

  ## Next Steps

  <CardGroup cols={2}>
    <Card title="Installation" icon="download" href="/flutter/installation">
      Add the SDK packages via pub.dev
    </Card>

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