RunAnywhere Flutter SDK
Privacy-first, on-device AI SDK for Flutter. Run LLMs, Speech-to-Text, Text-to-Speech, and Voice AI directly on user devices.
Installation
Step 1: Add packages to pubspec.yaml:
dependencies:
runanywhere: ^0.15.9
runanywhere_onnx: ^0.15.9 # STT, TTS, VAD
runanywhere_llamacpp: ^0.15.9 # LLM text generation
Step 2: Configure platforms (see below).
iOS Setup (Required)
After adding the packages, you must update your iOS Podfile for the SDK to work.
1. Update ios/Podfile
Make these two critical changes:
# Change 1: Set minimum iOS version to 14.0
platform :ios, '14.0'
# ... (keep existing flutter_root function and setup) ...
target 'Runner' do
# Change 2: Add static linkage - THIS IS REQUIRED
use_frameworks! :linkage => :static
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
# Required for microphone permission (STT/Voice features)
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_MICROPHONE=1',
]
end
end
end
⚠️ Without
use_frameworks! :linkage => :static, you will see "symbol not found" errors at runtime.
2. Update ios/Runner/Info.plist
Add microphone permission for STT/Voice features:
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for speech recognition</string>
3. Run pod install
cd ios && pod install
Android Setup
Add microphone permission to android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Quick Start
import 'package:runanywhere/runanywhere.dart';
import 'package:runanywhere_onnx/runanywhere_onnx.dart';
import 'package:runanywhere_llamacpp/runanywhere_llamacpp.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize SDK and register backends
await RunAnywhere.initialize();
await Onnx.register();
await LlamaCpp.register();
runApp(MyApp());
}
Text Generation (LLM)
final stream = RunAnywhere.generateStream('Tell me a joke');
await for (final token in stream) {
print(token);
}
Speech-to-Text
final result = await RunAnywhere.transcribe(audioData);
print(result.text);
Platform Support
| Platform | Minimum Version |
|---|---|
| iOS | 14.0+ |
| Android | API 24+ |
Documentation
For full documentation: runanywhere.ai
License
RunAnywhere License (Apache 2.0 based). See LICENSE.
Commercial licensing: san@runanywhere.ai
Libraries
- capabilities/voice/models/voice_session
- Voice Session Models
- capabilities/voice/models/voice_session_handle
- Voice Session Handle
- core/models/audio_format
- core/module/runanywhere_module
- RunAnywhere Module Protocol
- core/protocols/component/component
- core/protocols/component/component_configuration
- core/types/component_state
- core/types/model_types
- Model Types
- core/types/sdk_component
- Component Types
- core/types/storage_types
- Storage Types
- data/network/api_client
- data/network/api_endpoint
- data/network/models/auth/authentication_response
- data/network/network_service
- features/llm/structured_output/generatable
- features/llm/structured_output/generation_hints
- features/llm/structured_output/stream_accumulator
- features/llm/structured_output/stream_token
- features/llm/structured_output/structured_output
- Structured output feature barrel export Matches iOS StructuredOutput module structure
- features/llm/structured_output/structured_output_handler
- features/stt/services/audio_capture_manager
- features/tts/services/audio_playback_manager
- features/tts/system_tts_service
- System TTS Service
- features/vad/simple_energy_vad
- Simple Energy VAD
- features/vad/vad_configuration
- foundation/configuration/sdk_constants
- foundation/dependency_injection/service_container
- Service Container
- foundation/error_types/error_category
- foundation/error_types/error_code
- foundation/error_types/error_context
- foundation/error_types/sdk_error
- foundation/logging/sdk_logger
- SDK Logger
- foundation/security/keychain_manager
- infrastructure/device/models/device_info
- infrastructure/device/services/device_identity
- infrastructure/download/download_service
- infrastructure/events/event_publisher
- Event Publisher
- infrastructure/file_management/services/simplified_file_manager
- Simplified File Manager
- native/dart_bridge
- native/dart_bridge_auth
- native/dart_bridge_device
- native/dart_bridge_download
- native/dart_bridge_environment
- native/dart_bridge_events
- native/dart_bridge_http
- native/dart_bridge_llm
- DartBridge+LLM
- native/dart_bridge_model_assignment
- native/dart_bridge_model_paths
- native/dart_bridge_model_registry
- native/dart_bridge_platform
- native/dart_bridge_platform_services
- native/dart_bridge_state
- native/dart_bridge_storage
- native/dart_bridge_stt
- DartBridge+STT
- native/dart_bridge_telemetry
- native/dart_bridge_tts
- DartBridge+TTS
- native/dart_bridge_vad
- DartBridge+VAD
- native/dart_bridge_voice_agent
- DartBridge+VoiceAgent
- native/ffi_types
- native/native_backend
- native/platform_loader
- native/type_conversions/model_types_cpp_bridge
- ModelTypes + CppBridge
- public/configuration/sdk_environment
- public/errors/errors
- public/events/event_bus
- public/events/sdk_event
- public/extensions/runanywhere_frameworks
- RunAnywhere + Frameworks
- public/extensions/runanywhere_logging
- RunAnywhere + Logging
- public/extensions/runanywhere_storage
- RunAnywhere + Storage
- public/runanywhere
- public/types/capability_types
- Capability Types
- public/types/configuration_types
- Configuration Types
- public/types/download_types
- Download Types
- public/types/generation_types
- Generation Types
- public/types/message_types
- Message Types
- public/types/types
- Public Types
- public/types/voice_agent_types
- Voice Agent Types
- runanywhere
- RunAnywhere Flutter SDK - Core Package