README.md
Run LLMs, vision, speech-to-text, and text-to-speech locally. Private, offline, fast.
One SDK for iOS, Android, Flutter, React Native, and Web, with Hexagon NPU acceleration on Snapdragon.
</p> <p align="center"> <a href="https://apps.apple.com/us/app/runanywhere/id6756506307"> </a> <a href="https://play.google.com/store/apps/details?id=com.runanywhere.runanywhereai"> </a> </p> <p align="center"> <a href="https://github.com/RunanywhereAI/runanywhere-sdks/stargazers"></a> <a href="LICENSE"></a> <a href="https://docs.runanywhere.ai"></a> <a href="https://huggingface.co/runanywhere/models"></a> <a href="https://discord.gg/N359FBbDVd"></a> </p>RunAnywhere lets you add AI features to your app that run entirely on-device, with no cloud, no latency, and no data leaving the device:
One API spans iOS, Android, Flutter, React Native, and Web, and routes to the best engine on each device: Core ML on Apple, WebGPU in the browser, llama.cpp everywhere as a fallback, and the Hexagon NPU on Snapdragon.
QHexRT is RunAnywhere's inference runtime for the Qualcomm Hexagon NPU. It runs LLM, vision, speech, and text-to-speech models directly on the Snapdragon NPU (Hexagon v79 / v81) and ships as a built-in accelerator: your app calls the same loadModel and generate, and it uses the NPU automatically on supported devices.
Measured on a Samsung Galaxy S25 (Snapdragon 8 Elite, Hexagon v79):
| Model | Task | Params | Decode | Time to first token |
|---|---|---|---|---|
| LFM2.5-230M | LLM | 0.23 B | 164 tok/s | 32 ms |
| Qwen3-0.6B | LLM | 0.6 B | 33 tok/s (prefill up to 3,692 tok/s) | 127 ms |
| Llama-3.2-1B | LLM | 1.2 B | 16.3 tok/s | 56 ms |
| Phi-tiny-MoE | MoE LLM | 3.8 B (1.1 B active) | 5-7 tok/s | ~2.5 s |
| InternVL3.5-1B | VLM | 1 B | 37 tok/s | 290 ms |
| Whisper base | ASR | 74 M | ~5x real-time | n/a |
| MeloTTS-EN | TTS | n/a | ~4.5x real-time | n/a |
Available on the Kotlin, Flutter, and React Native SDKs. Snapdragon (Android arm64) only.
<strong>Text Generation</strong>
<sub>LLM inference, 100% on-device</sub>
</td>
<td width="40"></td>
<td align="center" width="50%">
<strong>Voice AI</strong>
<sub>STT to LLM to TTS pipeline, fully offline</sub>
</td>
<strong>Image Generation</strong>
<sub>On-device diffusion model</sub>
</td>
<td width="40"></td>
<td align="center" width="50%">
<strong>Visual Language Model</strong>
<sub>Vision + language understanding on-device</sub>
</td>
| Platform | Status | Installation | Documentation | NPU |
|---|---|---|---|---|
| Swift (iOS/macOS) | Stable | Swift Package Manager | docs.runanywhere.ai/swift | n/a |
| Kotlin (Android) | Stable | Gradle | docs.runanywhere.ai/kotlin | Yes |
| Web (Browser) | Beta | npm | SDK README | n/a |
| React Native | Beta | npm | docs.runanywhere.ai/react-native | Yes |
| Flutter | Beta | pub.dev | docs.runanywhere.ai/flutter | Yes |
import RunAnywhere
import LlamaCPPRuntime
// 1. Initialize
LlamaCPP.register()
try RunAnywhere.initialize()
// 2. Load a model
var load = RAModelLoadRequest()
load.modelID = "smollm2-360m"
load.category = .language
load.framework = .llamaCpp
_ = await RunAnywhere.loadModel(load)
// 3. Generate
var req = RALLMGenerateRequest()
req.prompt = "What is the capital of France?"
let result = try await RunAnywhere.generate(req)
print(result.text) // "Paris is the capital of France."
Install via Swift Package Manager:
https://github.com/RunanywhereAI/runanywhere-sdks
import com.runanywhere.sdk.public.RunAnywhere
import com.runanywhere.sdk.public.extensions.*
// 1. Initialize
LlamaCPP.register()
RunAnywhere.initialize(environment = SDKEnvironment.DEVELOPMENT)
// 2. Load a model
RunAnywhere.downloadModel("smollm2-360m").collect { println("${it.progress * 100}%") }
RunAnywhere.loadLLMModel("smollm2-360m")
// 3. Generate
val response = RunAnywhere.chat("What is the capital of France?")
println(response) // "Paris is the capital of France."
Install via Gradle:
dependencies {
implementation("com.runanywhere.sdk:runanywhere-kotlin:0.16.1")
implementation("com.runanywhere.sdk:runanywhere-core-llamacpp:0.16.1")
}
import { RunAnywhere, SDKEnvironment } from '@runanywhere/core';
import { LlamaCPP } from '@runanywhere/llamacpp';
// 1. Initialize
await RunAnywhere.initialize({ environment: SDKEnvironment.Development });
LlamaCPP.register();
// 2. Load a model
await RunAnywhere.downloadModel('smollm2-360m');
await RunAnywhere.loadModel('smollm2-360m');
// 3. Generate
const response = await RunAnywhere.chat('What is the capital of France?');
console.log(response); // "Paris is the capital of France."
Install via npm:
npm install @runanywhere/core @runanywhere/llamacpp
import 'package:runanywhere/runanywhere.dart';
import 'package:runanywhere_llamacpp/runanywhere_llamacpp.dart';
// 1. Initialize
await RunAnywhere.initialize();
await LlamaCpp.register();
// 2. Load a model
await RunAnywhere.downloadModel('smollm2-360m');
await RunAnywhere.loadModel('smollm2-360m');
// 3. Generate
final response = await RunAnywhere.chat('What is the capital of France?');
print(response); // "Paris is the capital of France."
Install via pub.dev:
dependencies:
runanywhere: ^0.16.0
runanywhere_llamacpp: ^0.16.0 # LLM text generation
# runanywhere_onnx: ^0.16.0 # Add this if you need STT, TTS, or Voice features
import { RunAnywhere } from '@runanywhere/web';
// 1. Initialize
await RunAnywhere.initialize({ environment: 'development' });
// 2. Load a model
await RunAnywhere.loadModel({
id: 'qwen2.5-0.5b',
source: '/models/qwen2.5-0.5b-instruct-q4_0.gguf',
});
// 3. Generate
const result = await RunAnywhere.generate({
prompt: 'What is the capital of France?',
});
console.log(result.text); // "Paris is the capital of France."
Install via npm:
npm install @runanywhere/web
| Feature | iOS | Android | Web | React Native | Flutter |
|---|---|---|---|---|---|
| LLM Text Generation | Yes | Yes | Yes | Yes | Yes |
| Streaming | Yes | Yes | Yes | Yes | Yes |
| Speech-to-Text | Yes | Yes | Yes | Yes | Yes |
| Text-to-Speech | Yes | Yes | Yes | Yes | Yes |
| Voice Assistant Pipeline | Yes | Yes | Yes | Yes | Yes |
| Vision Language Models | Yes | Yes | Yes | n/a | Yes |
| Hexagon NPU (QHexRT) | n/a | Yes | n/a | Yes | Yes |
| Model Download + Progress | Yes | Yes | Yes | Yes | Yes |
| Structured Output (JSON) | Yes | Yes | Yes | Soon | Soon |
| Tool Calling | Yes | Yes | Yes | n/a | n/a |
| Embeddings | n/a | n/a | Yes | n/a | n/a |
| Apple Foundation Models | Yes | n/a | n/a | n/a | n/a |
Prebuilt bundles published on Hugging Face; the SDK downloads the one matching the device.
| Model | Task | Params | Bundle |
|---|---|---|---|
| Llama-3.2-1B | LLM | 1.2 B | llama3_2_1b_HNPU |
| LFM2.5-230M / 350M | LLM | 0.23 / 0.35 B | lfm2_5_230m_HNPU · lfm2_5_350m_HNPU |
| Qwen3.5-0.8B / 2B / 4B | LLM | 0.8-4 B | qwen3_5_0_8b_HNPU · 2b · 4b |
| Gemma-4-E2B / E4B | LLM + VLM | ~2 / 4 B | gemma4_e2b_HNPU · gemma4_e4b_HNPU |
| Phi-tiny-MoE | MoE LLM | 3.8 B | phi_tiny_moe_HNPU |
| DeepSeek-R1-Distill-Qwen | LLM | 1.5 / 7 B | 1.5b · 7b |
| Qwen3-VL-2B | VLM | 2 B | qwen3_vl_HNPU |
| InternVL3.5-1B | VLM | 1 B | internvl3_5_1b_HNPU |
| Whisper base / small | ASR | 74 / 244 M | whisper_base_HNPU · whisper_small_HNPU |
| Moonshine tiny / base | ASR | n/a | moonshine_base_HNPU |
| MeloTTS-EN | TTS | n/a | melotts_en_HNPU |
| EmbeddingGemma-300M | Embeddings | 300 M | embeddinggemma_300m_HNPU |
Browse all models on Hugging Face
| Type | Models | Runtime |
|---|---|---|
| LLM | SmolLM2, Qwen 2.5, Llama 3.2, Mistral 7B | llama.cpp |
| Speech-to-Text | Whisper Tiny / Base | ONNX |
| Text-to-Speech | Piper (US / UK English) | ONNX |
| Platform | Source | Download |
|---|---|---|
| iOS | examples/ios/RunAnywhereAI | App Store |
| Android | examples/android/RunAnywhereAI | Google Play |
| Web | examples/web/RunAnywhereAI | Build from source |
| React Native | examples/react-native/RunAnywhereAI | Build from source |
| Flutter | examples/flutter/RunAnywhereAI | Build from source |
The Android, Flutter, and React Native apps include an NPU section that detects the device's Hexagon arch and runs LLM, vision, speech, and text-to-speech on the NPU.
Minimal projects to get up and running on each platform:
| Platform | Repository |
|---|---|
| Kotlin (Android) | kotlin-starter-example |
| Swift (iOS) | swift-starter-example |
| Flutter | flutter-starter-example |
| React Native | react-native-starter-app |
Real-world projects built with RunAnywhere. Each ships as a standalone app you can build and run.
A single C/C++ core (runanywhere-commons) behind a C ABI, with thin platform SDKs on top and a plugin registry that selects the best engine per device (llama.cpp, ONNX/sherpa, Core ML, Metal, and QHexRT on the Hexagon NPU). Business logic lives in the core, so one fix lands on all five SDKs.
runanywhere-sdks/
├── sdk/
│ ├── runanywhere-swift/ # iOS/macOS SDK
│ ├── runanywhere-kotlin/ # Android SDK
│ ├── runanywhere-web/ # Web SDK (WebAssembly / WebGPU)
│ ├── runanywhere-react-native/ # React Native SDK
│ ├── runanywhere-flutter/ # Flutter SDK
│ └── runanywhere-commons/ # Shared C/C++ core
│
├── engines/ # Pluggable inference backends
├── examples/ # Sample apps
├── Playground/ # Real-world reference apps
└── docs/ # Documentation
| Platform | Minimum | Recommended |
|---|---|---|
| iOS | 17.0+ | 17.0+ |
| macOS | 14.0+ | 14.0+ |
| Android | API 24 (7.0) | API 28+ |
| Web | Chrome 96+ / Edge 96+ | Chrome 120+ |
| React Native | 0.74+ | 0.76+ |
| Flutter | 3.10+ | 3.24+ |
Hexagon NPU: Snapdragon with Hexagon v79 / v81 (Snapdragon 8 Elite class), Android arm64. Memory: 2 GB minimum, 4 GB+ recommended for larger models.
We welcome contributions. See our Contributing Guide for details.
git clone https://github.com/RunanywhereAI/runanywhere-sdks.git
cd runanywhere-sdks
# Build the native XCFrameworks into sdk/runanywhere-swift/Binaries/.
# Required for local Swift development.
./sdk/runanywhere-swift/scripts/build-core-xcframework.sh
# Run the iOS sample app
cd examples/ios/RunAnywhereAI
open RunAnywhereAI.xcodeproj
RunAnywhere License (Apache 2.0 based, with additional commercial-use terms). See LICENSE for details.