Zurück zum Ranking

RunanywhereAI/runanywhere-sdks

C++runanywhere.ai

Production ready toolkit to run AI locally

ioskotlinllmswiftinferencemultimodalon-device-aivoice-aiandroidedgellamacppapple-intelligence
Sterne-Wachstum
Sterne
10.3k
Forks
365
Wochenwachstum
Issues
16
5k10k
Aug. 25Nov. 25März 26Juli 26
README

RunAnywhere Logo

RunAnywhere

On-device AI for every platform.
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.

Download on App Store   Get it on Google Play

GitHub Stars RunAnywhere License Documentation Hugging Face Models Discord


What is RunAnywhere?

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:

  • LLM Chat: Llama, Qwen, Gemma, Phi, LFM, Mistral, and more
  • Vision (VLM): image understanding and captioning
  • Speech-to-Text: Whisper- and Moonshine-based transcription
  • Text-to-Speech: neural voice synthesis
  • Voice Assistant: a full speech-to-text, LLM, and text-to-speech pipeline

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.


Hexagon NPU acceleration (QHexRT)

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.

  • Runs LLM, VLM, speech-to-text, and text-to-speech on the NPU, including text-to-speech, which other runtimes run on the CPU.
  • Runs Mixture-of-Experts and hybrid-attention models on the NPU (Phi-tiny-MoE, Qwen3.5).
  • Fast prefill and low time-to-first-token, with context that extends past the compiled window.
  • Prebuilt model bundles published on Hugging Face; the SDK downloads the one matching the device.

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.


See It In Action

Text Generation

Text Generation
LLM inference, 100% on-device
Voice AI

Voice AI
STT to LLM to TTS pipeline, fully offline
Image Generation

Image Generation
On-device diffusion model
Visual Language Model

Visual Language Model
Vision + language understanding on-device

SDKs

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

Quick Start

Swift (iOS / macOS)

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

Documentation · Source code


Kotlin (Android)

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")
}

Documentation · Source code


React Native

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

Documentation · Source code


Flutter

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

Documentation · Source code


Web (Browser)

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

Source code


Features

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

Supported Models

Hexagon NPU (QHexRT)

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

Cross-platform (GGUF / ONNX)

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

Sample Apps

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.


Starter Examples

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

Playground

Real-world projects built with RunAnywhere. Each ships as a standalone app you can build and run.


Architecture

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

Requirements

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.


Contributing

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

Support


License

RunAnywhere License (Apache 2.0 based, with additional commercial-use terms). See LICENSE for details.

Ähnliche Repositories
flutter/flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

DartBSD 3-Clause "New" or "Revised" Licensemobileandroid
flutter.dev
177.9k30.7k
react/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
126.2k25.2k
facebook/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
120.9k24.5k
rustdesk/rustdesk

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

Rustcrates.ioGNU Affero General Public License v3.0remote-controlremote-desktop
rustdesk.com
118.6k18.1k
justjavac/free-programming-books-zh_CN

:books: 免费的计算机编程类中文书籍,欢迎投稿

GNU General Public License v3.0pythonjavascript
weibo.com/justjavac
117.7k28.2k
Solido/awesome-flutter

An awesome list that curates the best Flutter libraries, tools, tutorials, articles and more.

Dartflutterawesome-list
60.7k6.9k
FiloSottile/mkcert

A simple zero-config tool to make locally trusted development certificates with any names you'd like.

GoGo ModulesBSD 3-Clause "New" or "Revised" Licensehttpstls
mkcert.dev
59.4k3.1k
appwrite/appwrite

Appwrite® - complete cloud infrastructure for your web, mobile and AI apps. Including Auth, Databases, Storage, Functions, Messaging, Hosting, Realtime and more

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenseappwritedocker
appwrite.io
56.6k5.6k
google/material-design-icons

Material Design icons by Google (Material Symbols)

Apache License 2.0materialmaterial-design
google.github.io/material-design-icons/
53.6k9.7k
vsouza/awesome-ios

A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

SwiftMIT Licenseawesomeswift-library
awesomeios.dev
52.8k7k
ionic-team/ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

TypeScriptnpmMIT Licenseionicmobile
ionicframework.com
52.6k13.3k
dkhamsing/open-source-ios-apps

:iphone: Collaborative List of Open-Source iOS Apps

Creative Commons Zero v1.0 Universaliosswift
51.3k6k