Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

runanywhere-sdks

> 前端框架
Open source

Production ready toolkit to run AI locally

10.3K stars0 likes1 views
WebsiteGitHub

About

Production ready toolkit to run AI locally

RunAnywhere

One SDK. Every device.
LLMs, vision, speech, voice agents, RAG, embeddings, and image generation, running locally on phones, browsers, desktops, and servers.
Private by default. Offline by design. Accelerated by whatever silicon the device has.

  


Eight SDKs, one C++ core. A capability registry routes every call to the best engine on the device, and the Console manages your fleet from above.


What you can build

Every capability below runs fully on-device behind one semantic API across the eight SDKs. Call RunAnywhere.capabilities() (v4) to discover what the current package and device can actually execute — enum presence alone does not mean an engine is installed.

  • LLM chat: Llama, Qwen, Gemma, Phi, LFM, SmolLM, DeepSeek, and more, with token streaming, multi-turn history, and LoRA adapters
  • Structured output: schema-validated JSON; constrained decoding where the engine supports it (generateStructured + enforcement mode)
  • Tool calling: local function tools with stable call IDs and an agent loop (parallel calls when the engine/capability reports support)
  • Vision (VLM): image understanding, live camera description, and photo Q&A
  • Computer-use action parser (CUA): parse Fara1.5-style action strings into viewport-scaled coordinates — not a full autonomous agent framework
  • Speech-to-Text: Whisper and Moonshine transcription, batch and live frame streams
  • Text-to-Speech: neural voices from Piper, Kokoro, Kitten, MeloTTS, and Magpie
  • Voice agents: VAD, STT, LLM, and TTS in one pipeline with SpeechHandle-scoped playback (wake-word detection is not implemented)
  • Embeddings: L2-normalized vectors for search and retrieval
  • RAG: local document ingestion and retrieval-augmented answers, with streaming
  • Image generation: Stable Diffusion on Core ML, plus inpainting on the Hexagon NPU (platform/backend gated)

Your code rarely picks hardware. Engines register what they can run, and the highest-priority engine that fits the device wins: QHexRT on the Snapdragon Hexagon NPU, MLX on Apple silicon, llama.cpp everywhere (Metal on Apple, CUDA on NVIDIA as an opt-in build, WebGPU in the browser), sherpa + ONNX for speech and embeddings, and Core ML for diffusion. LiteRT and ExecuTorch are reserved framework values only — they are not integrated runtimes yet.


See it in action


Quick start

The fastest way to feel it. Install, load, generate, all local:

bash
pip install runanywhere
python
import runanywhere as ra
from runanywhere import LlmOptions

ra.initialize()
# downloads on first use
print(ra.llm.generate("Explain on-device AI in one sentence.",
                      LlmOptions(model="qwen2.5-0.5b")).text)

Prefer a terminal? Install the CLI from RunanywhereAI/RCLI — it consumes the C++ desktop kit this repo publishes:

bash
brew install runanywhereai/tap/rcli
# or
curl -fsSL https://raw.githubusercontent.com/RunanywhereAI/RCLI/main/install.sh | sh
rcli run qwen3 "Explain on-device AI in one sentence."

Building for mobile, web, or desktop? Every platform below speaks the same API.

Swift (iOS / macOS)
swift
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."

Add the MLX backend (import RunAnywhereMLX; MLX.register()) for Apple-native LLM, VLM, STT, TTS, and embeddings on Apple silicon.

Install via Swift Package Manager:

https://github.com/RunanywhereAI/runanywhere-sdks

Documentation · Source

Kotlin (Android)
…

Install via Gradle (Maven Central):

kotlin
dependencies {
    implementation("io.github.sanchitmonga22:runanywhere-sdk:0.20.11")
    implementation("io.github.sanchitmonga22:runanywhere-llamacpp:0.20.11")
    // Optional: STT / TTS / VAD
    // implementation("io.github.sanchitmonga22:runanywhere-onnx:0.20.11")
}

Documentation · Source

Flutter
dart
import 'package:runanywhere/runanywhere.dart';
import 'package:runanywhere_llamacpp/runanywhere_llamacpp.dart';

// 1. Initialize
LlamaCpp.register();
await RunAnywhere.initialize();

// 2. Download and load a model
await RunAnywhere.downloadModel('smollm2-360m');
await RunAnywhere.llm.load('smollm2-360m');

// 3. Generate
final response = await RunAnywhere.llm.chat('What is the capital of France?');
print(response); // "Paris is the capital of France."

Install via pub.dev:

yaml
dependencies:
  runanywhere: ^0.20.11
  runanywhere_llamacpp: ^0.20.11  # LLM/VLM text generation
  # runanywhere_onnx: ^0.20.11    # STT, TTS, VAD, voice agent
  # runanywhere_mlx: ^0.20.11     # Apple-native LLM/VLM/STT/TTS/embeddings
  # runanywhere_qhexrt: ^0.20.11  # Snapdragon Hexagon NPU

Documentation · Source

React Native
typescript
import { RunAnywhere, SDKEnvironment } from '@runanywhere/core';
import { LlamaCPP } from '@runanywhere/llamacpp';

// 1. Initialize
await RunAnywhere.initialize({ environment: SDKEnvironment.SDK_ENVIRONMENT_DEVELOPMENT });
LlamaCPP.register();

// 2. Download and load a model
await RunAnywhere.downloadModel('smollm2-360m');
await RunAnywhere.loadModel('smollm2-360m');

// 3. Generate
const result = await RunAnywhere.generate('What is the capital of France?');
console.log(result.text); // "Paris is the capital of France."

Install via npm:

bash
npm install @runanywhere/[email protected] @runanywhere/[email protected]
# optional backends: @runanywhere/onnx @runanywhere/mlx @runanywhere/qhexrt

Documentation · Source

Web (TypeScript, WASM + WebGPU)
…

Install via npm:

bash
npm install @runanywhere/[email protected] @runanywhere/[email protected]
# @runanywhere/web-onnx for STT/TTS/VAD/embeddings in the browser

Source · Web starter app

Electron (Windows-first desktop)
javascript
const { RunAnywhere } = require('@runanywhere/electron');

// 1. Initialize
RunAnywhere.initialize();

// 2. Load a model (catalog id or a local path)
const llm = await RunAnywhere.loadLLM('qwen2.5-0.5b');

// 3. Generate (streaming)
for await (const token of llm.generate('What is the capital of France?')) {
  process.stdout.write(token);
}

llm.unload();
RunAnywhere.shutdown();

A native N-API addon over the C core. Inference runs in an isolated Electron utility process and streams to the renderer over a MessagePort. LLM, VLM, STT, TTS, embeddings, RAG, structured output, tool calling, and a voice pipeline, with a prebuilt win32-x64 addon. CUDA is available as an opt-in source build.

Install: build from source (Windows x64 preview), see the SDK README for steps.

Python (Windows / macOS / Linux)
…

Namespaces per modality (llm, vlm, stt, tts, vad, embeddings, rag, models), an a-prefixed async twin for every blocking verb, structured output and tool calling, with prebuilt wheels that bundle the native runtime. CUDA is available as an opt-in source build.

Install via pip:

bash
pip install runanywhere==0.20.11

Source

rcli (terminal)
bash
$ rcli pull qwen3
pulling qwen3-0.6b ▕████████████▏ 100%  639 MB/639 MB  32 MB/s
$ rcli run qwen3 "Reply with exactly: RCLI WORKS" --no-think
RCLI WORKS
$ rcli tts --text "RunAnywhere runs models on device." --output hello.wav
$ rcli stt --input hello.wav
 Run anywhere runs models on device.
$ rcli voice --input question.wav --output reply.wav   # full STT > LLM > TTS turn
$ rcli serve qwen3        # OpenAI-compatible API on :8080

Also: rcli run --image photo.jpg (VLM), rcli vad, rcli embed, rcli image (diffusion, Apple), rcli lora, and --json on everything.

Install (macOS Apple Silicon, Linux x86_64):

bash
brew install runanywhereai/tap/rcli
# or
curl -fsSL https://raw.githubusercontent.com/RunanywhereAI/RCLI/main/install.sh | sh

Windows (x64):

powershell
irm https://raw.githubusercontent.com/RunanywhereAI/RCLI/main/install.ps1 | iex

CLI README


SDKs

SDK Platforms Status Install Docs
Swift iOS 17.5+, macOS 14.5+ Stable Swift Package Manager docs.runanywhere.ai/swift
Kotlin Android API 24+ Stable Gradle (io.github.sanchitmonga22:runanywhere-sdk) docs.runanywhere.ai/kotlin
Flutter iOS, Android Beta pub.dev (runanywhere) docs.runanywhere.ai/flutter
React Native iOS, Android Beta npm (@runanywhere/core) docs.runanywhere.ai/react-native
Web Chromium, Safari, Firefox Beta npm (@runanywhere/web) SDK README
Electron Windows x64 desktop Preview Build from source SDK README
Python Windows, macOS, Linux Alpha pip (runanywhere) SDK README
rcli macOS, Linux, Windows Stable Homebrew / install script RCLI

All SDKs ship on one version line, currently 0.20.29, from a single C++ core. Pin the same version across the core package and its backends. See Releases for what is published today.


Features

Feature Swift Kotlin Flutter RN Web Electron Python rcli
LLM generation + streaming Yes Yes Yes Yes Yes Yes Yes Yes
Vision language models (VLM) Yes Yes Yes Yes Yes Yes Yes Yes
Computer-use agent (CUA) Yes Yes Yes Yes API only n/a n/a n/a
Speech-to-Text Yes Yes Yes Yes Yes Yes Yes Yes
Text-to-Speech Yes Yes Yes Yes Yes Yes Yes Yes
Voice activity detection Yes Yes Yes Yes Yes Yes Yes Yes
Voice agent pipeline Yes Yes Yes Yes Yes Yes Stub Yes
Wake word No No

Issues· 155 open

View all issuesOpen on GitHub
  • #914

    No SDK path stamps session_handle_id, so RAG can't run end to end

    enhancementP1coreUpdated Sep 24, 2026
  • #876

    Generate a protobuf-free AcceleratorPolicy header

    P3tech-debtUpdated Sep 19, 2026
  • #953

    Swift SDK fails to compile under Xcode 27 / iOS 27 SDK: AVAudioPlayerDelegate is now @MainActor

    Updated Sep 16, 2026
  • #929

    Propagate UTF-8 text-run streaming-docstring wording to VLM headers

    documentationgood first issuecoreUpdated Sep 15, 2026
  • #886

    docs: rcli was renamed to wally — update README install instructions

    documentationP2Updated Sep 11, 2026
  • #885

    docs: keep root README.md version pins in sync with core/VERSION

    documentationP2tech-debtUpdated Sep 11, 2026
  • #924

    Prove the cloud MSVC dllimport fix by turning on the Windows shared build

    tech-debtcoreUpdated Sep 11, 2026
  • #923

    Update stale "Called for each generated token" docstring on rac_llm_component.h:199

    documentationgood first issuecoreUpdated Sep 11, 2026
  • #922

    Web SDK RAG chunker makes a whitespace-free CJK document one unbounded chunk

    bugweb-sdkUpdated Sep 11, 2026
  • #921

    rag_rerank truncates chunk text mid-UTF-8-character for CJK content

    bugP2coreUpdated Sep 11, 2026

> Tags

C++androidapple-intelligencecppdiffusion-models

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架