The complete integration path for adding on-device LLM, STT, and TTS to a React Native app with
the RunAnywhere SDK, written against SDK 0.20.27. It is written step by step, so a coding agent
can follow it as-is. Every step assumes the app runs in RunAnywhere AI Studio rather than standard
Expo Go.
Working starter project
RunAnywhere AI Studio app
You must run the app inside RunAnywhere AI Studio, a fork of Expo Go carrying the native
libraries the SDK needs. Standard Expo Go does not include them, so
RunAnywhere.initialize() and
every inference call below fail there with a missing native module.1. Install
package.json
@runanywhere/mlx (^0.20.27) for Apple MLX on physical iOS devices, and
@runanywhere/qhexrt (^0.20.19, note the different version) for the Qualcomm Hexagon NPU.
2. Register a backend, then initialize
App.tsx
initialize(). The plugin registry has to know which engines
exist before the first model load.
3. Register models
API reference
Model management
models.get(id) on React Native. Use models.loaded(category), or list() and
filter.
LLM
Speech to text
stt.openStream on React Native.
Text to speech
Voice agent
The ModelService pattern
A React context that owns registration and readiness, so screens do not each re-initialize.ModelService.tsx
Chat screen
ChatScreen.tsx
cancelled ref stops the loop writing state
after unmount, and buffering tokens on a 50ms interval stops a re-render per token.
Errors
try around
the for await catches it. That differs from the Web SDK, where the failure arrives as a
failed event.