RunAnywhere class

The RunAnywhere SDK entry point

Matches Swift RunAnywhere enum from Public/RunAnywhere.swift

Available extensions

Constructors

RunAnywhere()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

currentModelId String?
Get the currently loaded LLM model ID Returns null if no LLM model is loaded.
no setter
currentSTTModelId String?
Get the currently loaded STT model ID Returns null if no STT model is loaded.
no setter
currentTTSVoiceId String?
Get the currently loaded TTS voice ID Returns null if no TTS voice is loaded.
no setter
currentVLMModelId String?
Get the currently loaded VLM model ID
no setter
environment SDKEnvironment?
Current environment
no setter
events EventBus
Event bus for SDK events
no setter
initParams SDKInitParams?
Get initialization parameters
no setter
isActive bool
Check if SDK is active
no setter
isModelLoaded bool
Check if an LLM model is currently loaded
no setter
isSDKInitialized bool
Check if SDK is initialized
no setter
isSTTModelLoaded bool
Check if an STT model is currently loaded
no setter
isTTSVoiceLoaded bool
Check if a TTS voice is currently loaded
no setter
isVLMModelLoaded bool
Check if a VLM model is currently loaded
no setter
isVoiceAgentReady bool
Check if the voice agent is ready (all required components loaded).
no setter
serviceContainer ServiceContainer
Access to service container
no setter
version String
SDK version
no setter

Static Methods

askAboutImage(String question, {required VLMImage image}) Future<String>
Ask a question about an image
availableModels() Future<List<ModelInfo>>
Get all available models from C++ registry.
cancelGeneration() Future<void>
Cancel ongoing generation
cancelVLMGeneration() Future<void>
Cancel ongoing VLM generation
chat(String prompt) Future<String>
Simple text generation - returns only the generated text
cleanupVoiceAgent() → void
Cleanup voice agent resources.
currentLLMModel() Future<ModelInfo?>
Get the currently loaded LLM model as ModelInfo Matches Swift: RunAnywhere.currentLLMModel
currentSTTModel() Future<ModelInfo?>
Get the currently loaded STT model as ModelInfo Matches Swift: RunAnywhere.currentSTTModel
currentTTSVoice() Future<ModelInfo?>
Get the currently loaded TTS voice as ModelInfo Matches Swift: RunAnywhere.currentTTSVoice (TTS uses "voice" terminology)
deleteStoredModel(String modelId) Future<void>
Delete a stored model
describeImage(VLMImage image, {String prompt = "What's in this image?"}) Future<String>
Describe an image with a text prompt
downloadModel(String modelId) Stream<DownloadProgress>
Download a model by ID
generate(String prompt, {LLMGenerationOptions? options}) Future<LLMGenerationResult>
Full text generation with metrics
generateStream(String prompt, {LLMGenerationOptions? options}) Future<LLMStreamingResult>
Streaming text generation
getCurrentEnvironment() SDKEnvironment?
Get current environment (alias for environment getter) Matches Swift pattern for explicit method call
getDownloadedModelsWithInfo() Future<List<StoredModel>>
Get downloaded models with their file sizes.
getStorageInfo() Future<StorageInfo>
Get storage info including device storage, app storage, and downloaded models.
getVoiceAgentComponentStates() VoiceAgentComponentStates
Get the current state of all voice agent components (STT, LLM, TTS).
initialize({String? apiKey, String? baseURL, SDKEnvironment environment = SDKEnvironment.development}) Future<void>
Initialize the SDK
initializeWithParams(SDKInitParams params) Future<void>
Initialize with params
loadModel(String modelId) Future<void>
Load a model by ID
loadSTTModel(String modelId) Future<void>
Load an STT model
loadTTSVoice(String voiceId) Future<void>
Load a TTS voice
loadVLMModel(String modelId) Future<void>
Load a VLM model by ID
processImage(VLMImage image, {required String prompt, int maxTokens = 2048, double temperature = 0.7, double topP = 0.9}) Future<VLMResult>
Process an image with VLM
processImageStream(VLMImage image, {required String prompt, int maxTokens = 2048, double temperature = 0.7, double topP = 0.9}) Future<VLMStreamingResult>
Stream image processing with real-time tokens
refreshDiscoveredModels() Future<void>
Re-discover models on the filesystem via C++ registry.
registerModel({String? id, required String name, required Uri url, required InferenceFramework framework, ModelCategory modality = ModelCategory.language, ModelArtifactType? artifactType, int? memoryRequirement, bool supportsThinking = false}) ModelInfo
Register a model with the SDK.
registerMultiFileModel({String? id, required String name, required List<ModelFileDescriptor> files, required InferenceFramework framework, ModelCategory modality = ModelCategory.embedding, int? memoryRequirement}) ModelInfo
Register a multi-file model with the SDK.
removeModel(String modelId) Future<void>
Remove a model from the C++ registry
reset() Future<void>
Reset SDK state
startVoiceSession({VoiceSessionConfig config = VoiceSessionConfig.defaultConfig}) Future<VoiceSessionHandle>
Start a voice session with audio capture, VAD, and full voice pipeline.
synthesize(String text, {double rate = 1.0, double pitch = 1.0, double volume = 1.0}) Future<TTSResult>
Synthesize speech from text.
transcribe(Uint8List audioData) Future<String>
Transcribe audio data to text.
transcribeWithResult(Uint8List audioData) Future<STTResult>
Transcribe audio data with detailed result.
unloadModel() Future<void>
Unload current model
unloadSTTModel() Future<void>
Unload the currently loaded STT model Matches Swift: RunAnywhere.unloadSTTModel()
unloadTTSVoice() Future<void>
Unload the currently loaded TTS voice Matches Swift: RunAnywhere.unloadTTSVoice()
unloadVLMModel() Future<void>
Unload the currently loaded VLM model
updateModelDownloadStatus(String modelId, String? localPath) Future<void>
Update the download status for a model in C++ registry