Overview
The RunAnywhere Kotlin SDK runs AI models on the Android device itself. Once a model is downloaded, inference needs no network, and the audio, text, and images it processes stay on the phone.A single C++ core implements the model lifecycle, inference routing, and pipeline orchestration. The Kotlin SDK is a typed wrapper over it, so behavior matches the Swift, Flutter, React Native, and Web SDKs rather than being reimplemented per platform.LLM
Text generation with streaming support via Kotlin Flows
VLM
Vision language models for image understanding
LoRA
Hot-swap fine-tuned adapters at runtime
RAG
On-device retrieval-augmented generation
STT
Speech-to-text transcription with Whisper models
TTS
Neural voice synthesis with Sherpa-ONNX
Tool Calling
Function calling with typed tool definitions
VAD
Real-time voice activity detection
Voice Agent
Full VAD → STT → LLM → TTS pipeline
Hexagon NPU
Qualcomm QHexRT backend for LLM, VLM, STT, TTS, embeddings, and diffusion
Key capabilities
Backends are separate modules: llama.cpp for GGUF language and vision models, ONNX Runtime with Sherpa-ONNX for speech, and QHexRT for the Qualcomm Hexagon NPU. Link only the ones you use.The public surface is Kotlin coroutines and Flows throughout. Every structured type is generated from the same Protobuf IDL the C++ core is generated from, so field names and defaults are identical across the Swift, Kotlin, Flutter, React Native, and Web SDKs.Core philosophy
On-device first
On-device first
Inference runs locally. Once a model is downloaded, no network connection is needed to use it.
Modular backends
Modular backends
Each backend is a separate artifact carrying its own native libraries. Link only the ones you
use, so an LLM-only app does not ship the speech stack.
Data stays local
Data stays local
Audio, text, and images are processed on the device unless you explicitly configure a cloud
route.
One core, five SDKs
One core, five SDKs
Business logic lives in the shared C++ core and the structured types are generated from one
Protobuf IDL, so the Kotlin API mirrors Swift, Flutter, React Native, and Web.
Features
Every capability hangs off theRunAnywhere object as a namespace. The namespaces are extension
properties in com.runanywhere.sdk.public.api, so importing com.runanywhere.sdk.public.api.llm
gives you RunAnywhere.llm.One-shot verbs are
suspend functions and streaming verbs return a Flow. Every stream uses the
same grammar: a started event, then deltas, then a completed event carrying the aggregate result.
Cancelling the Flow cancels that one request.Reasoning models are handled by the SDK rather than by prompt text. LlmOptions.reasoning decides
whether the model thinks and whether those tokens reach you, and every streamed token carries a
TokenKind of TEXT or THOUGHT.System requirements
ARM64 is the primary target. The Hexagon NPU module is arm64-v8a only.
SDK modules
RAG is part of the core SDK and uses embedding models served by the ONNX module. There is no
separate RAG artifact. See Installation for versions and sizes.
Architecture
Next steps
Installation
Add the SDK to your project via Gradle
Quick start
Initialize the SDK and run your first inference