Skip to main content
Every SDK follows the same three steps: install, register a backend and initialize, generate. Models are not bundled. You register a model once by URL, then name it in your generation options. The SDK downloads and loads it on first use, so there is no separate download or load step to sequence yourself. The examples below use SmolLM2 360M (386 MB), the smallest model that produces coherent output.

1. Install

build.gradle.kts
mavenCentral() is the only repository required. Minimum Android API 24.

2. Register a backend, then initialize

Register backends before initialize(). The C++ plugin registry has to know which engines exist before the first model load, or the load fails with error -422, “No provider could handle the request”.Pass the Application context so the SDK can reach Android file storage and the Keystore.
One call is enough. Authentication, device registration, and telemetry run in the background, and local inference is usable as soon as initialize returns.

3. Register a model and generate

Naming the model in LlmOptions downloads and loads it if needed. Later calls skip that work. To watch download progress, call RunAnywhere.models.download(id) yourself and collect its Flow<DownloadEvent>.

4. Stream

Cancel by cancelling the coroutine collecting the flow.

Full Kotlin documentation

Installation, LLM, STT, TTS, VAD, VLM, RAG, LoRA, tool calling, voice agent

SDK overview

Platform requirements and which features each SDK ships

Text generation

Generation options, streaming, structured output

Speech-to-text

Transcription and streaming transcription

Voice agent

One session that runs VAD, STT, LLM, and TTS together