runanywhere library
RunAnywhere Flutter SDK - Core Package
Privacy-first, on-device AI SDK for Flutter.
Classes
- AppStorageInfo
- App storage breakdown by directory type
- ArchiveArtifact
- BuiltInArtifact
- ComponentConfiguration
- Protocol for component configuration and initialization
- ComponentLoadState
- State of a voice agent component
- ComponentLoadStateLoaded
- Component loaded state
- ComponentLoadStateNotLoaded
- Component not loaded state
- ComponentOutput
- Protocol for component output data
- CustomArtifact
- DeviceRegistered
- DeviceRegistrationFailed
- DeviceStorageInfo
- Device storage information
- DownloadProgress
-
Download progress information
Matches Swift
DownloadProgress. - ErrorContext
- Context information captured when an error occurs Includes stack trace, source location, and timing information Matches iOS ErrorContext from Foundation/ErrorTypes/ErrorContext.swift
- EventBus
- Central event bus for SDK-wide event distribution Thread-safe event bus using Dart Streams
- ExpectedModelFiles
- Describes what files are expected after model extraction/download
- LLMGenerationOptions
- Options for LLM text generation Matches Swift's LLMGenerationOptions
- LLMGenerationResult
- Result of LLM text generation Matches Swift's LLMGenerationResult
- LLMStreamingResult
- Result of streaming LLM text generation Matches Swift's LLMStreamingResult
- LoggingConfiguration
- Configuration for SDK logging
- ModelArtifactType
- Describes how a model is packaged and what processing is needed after download
- ModelDownloadProgress
- Download progress information
- ModelDownloadService
- Model download service - handles actual file downloads
- ModelFileDescriptor
- Describes a file that needs to be downloaded as part of a multi-file model
- ModelInfo
- Information about a model - in-memory entity Matches Swift ModelInfo from Public/Extensions/Models/ModelTypes.swift
- ModelStorageMetrics
- Storage metrics for a single model All model metadata (id, name, framework, artifactType, etc.) is in ModelInfo This class adds the on-disk storage size
- MultiFileArtifact
- NativeBackend
- High-level wrapper around the RunAnywhere native C API.
- PlatformLoader
- Platform-specific library loader for RunAnywhere core native library (RACommons).
- RunAnywhere
- The RunAnywhere SDK entry point
- RunAnywhereModule
- Protocol for SDK modules that provide AI capabilities.
- SDKConfigurationEvent
- SDK configuration events
- SDKConstants
- SDK constants
- SDKDeviceEvent
- SDK device events.
- SDKEvent
- Base protocol for all SDK events.
- SDKGenerationCompleted
- SDKGenerationCostCalculated
- SDKGenerationEvent
- SDK generation events
- SDKGenerationFailed
- SDKGenerationStarted
- SDKInitializationCompleted
- SDKInitializationEvent
- SDK initialization events
- SDKInitializationFailed
- SDKInitializationStarted
- SDKInitParams
- SDK initialization parameters
- SDKLogger
- Centralized logging utility Aligned with iOS: Sources/RunAnywhere/Foundation/Logging/Logger/SDKLogger.swift
- SDKLoggerConfig
- Singleton for SDK logger configuration
- SDKModelDeleted
- SDKModelDownloadCompleted
- SDKModelDownloadFailed
- SDKModelDownloadProgress
- SDKModelDownloadStarted
- SDKModelEvent
- SDK model events
- SDKModelLoadCompleted
- SDKModelLoadFailed
- SDKModelLoadStarted
- SDKModelUnloadCompleted
- SDKModelUnloadStarted
- SDKStorageCacheCleared
- SDKStorageEvent
- SDK storage events
- SDKStorageTempFilesCleaned
- SDKVoiceAudioGenerated
- SDKVoiceEvent
- SDK voice events
- SDKVoiceListeningEnded
- SDKVoiceListeningStarted
- SDKVoicePipelineCompleted
- SDKVoicePipelineError
- SDKVoicePipelineStarted
- SDKVoiceResponseGenerated
- SDKVoiceSpeechDetected
- SDKVoiceSynthesisCompleted
- SDKVoiceSynthesisStarted
- SDKVoiceTranscriptionFinal
- SDKVoiceTranscriptionPartial
- SDKVoiceTranscriptionStarted
- SingleFileArtifact
- StorageAvailability
- Storage availability check result
- StorageInfo
- Complete storage information including device, app, and model storage
- StoredModel
- Backward-compatible stored model view Provides a simple view of a stored model with computed properties
- STTCapability
- Speech-to-Text capability information
- STTOutput
- Output from Speech-to-Text transcription Matches Swift STTOutput from Public/Extensions/STT/STTTypes.swift
- STTResult
- Result of STT transcription Matches Swift's STTOutput
- SupabaseConfig
- Supabase configuration
- ThinkingTagPattern
- Pattern for extracting thinking tags from model output
- TTSCapability
- Text-to-Speech capability information
- TTSResult
- Result of TTS synthesis Matches Swift's TTSOutput
- VADConfiguration
- Configuration for VAD component
- VoiceAgentComponentStates
- States of all voice agent components (STT, LLM, TTS)
- VoiceAgentProcessResult
- Result from voice agent processing
- VoiceSession
- Voice session state tracking (for internal use)
- VoiceSessionConfig
- Configuration for voice session behavior Matches iOS VoiceSessionConfig from RunAnywhere+VoiceSession.swift
- VoiceSessionError
- Error occurred
- VoiceSessionEvent
- Events emitted during a voice session Matches iOS VoiceSessionEvent from RunAnywhere+VoiceSession.swift
- VoiceSessionHandle
- Handle to control an active voice session Matches iOS VoiceSessionHandle from RunAnywhere+VoiceSession.swift
- VoiceSessionListening
- Listening for speech with current audio level (0.0 - 1.0)
- VoiceSessionProcessing
- Speech ended, processing audio
- VoiceSessionResponded
- Got response from LLM
- VoiceSessionSpeaking
- Playing TTS audio
- VoiceSessionSpeechStarted
- Speech detected, started accumulating audio
- VoiceSessionStarted
- Session started and ready
- VoiceSessionStopped
- Session stopped
- VoiceSessionTranscribed
- Got transcription from STT
- VoiceSessionTurnCompleted
- Complete turn result
Enums
- ArchiveStructure
- Describes the internal structure of an archive after extraction
- ArchiveType
- Supported archive formats for model packaging
- ComponentState
- Component state enumeration
- DownloadProgressStage
- Download progress stage (more detailed than state)
- DownloadProgressState
- Download progress state
- ErrorCategory
- Error categories for logical grouping and filtering Matches iOS ErrorCategory from Foundation/ErrorTypes/ErrorCategory.swift
- ErrorCode
- SDK error codes Matches iOS ErrorCode from Foundation/ErrorTypes/ErrorCodes.swift
- EventCategory
- Event categories for routing and filtering
- EventDestination
- Event destination for routing
- InferenceFramework
- Supported inference frameworks/runtimes for executing models
- LogLevel
- Log levels
- MessageRole
- Role of a message in a conversation
- ModelCategory
- Defines the category/type of a model based on its input/output modality
- ModelDownloadStage
- Download stages
- ModelFormat
- Model formats supported
- ModelSource
- Source of model data (where the model info came from)
- SDKComponent
- SDK component types for identification.
- SDKEnvironment
- SDK Environment mode - determines how data is handled
- SDKErrorType
- SDK error types Matches iOS RunAnywhereError cases
- SDKLogLevel
- SDK Log levels
- VoiceSessionErrorType
- VoiceSessionState
- Voice session state (for internal tracking) Matches iOS VoiceSessionState from VoiceSession.swift
Mixins
- SDKEventDefaults
- Mixin providing default implementations for SDKEvent fields. Similar to Swift protocol extensions.
Extensions
- ComponentStateExtension on ComponentState
- ErrorContextExtension on Object
- Extension to add context to any error
- RunAnywhereFrameworks on RunAnywhere
- Extension methods for framework discovery
- RunAnywhereLogging on RunAnywhere
- Extension methods for logging configuration
- RunAnywhereStorage on RunAnywhere
- Extension methods for storage operations
- SDKEnvironmentExtension on SDKEnvironment
Functions
-
captureErrorContext(
) → ErrorContext - Global function to capture error context at the call site Use this when throwing errors to capture the stack trace
Typedefs
- RunAnywhereError = SDKError
- Type alias for iOS parity iOS uses RunAnywhereError; this alias provides compatibility
Exceptions / Errors
- ContextualError
- A wrapper that attaches context to any error
- NativeBackendException
- Exception thrown by native backend operations.
- SDKError
- Main SDK error type Matches iOS RunAnywhereError from Public/Errors/RunAnywhereError.swift
- VoiceSessionException
- Voice session errors Matches iOS VoiceSessionError from RunAnywhere+VoiceSession.swift