Flutter SDK
Run AI models on-device with dart:ffi direct bindings for iOS, macOS, and Android.Building
| File | Platform |
|---|---|
libcactus.so | Android (arm64-v8a) |
cactus-ios.xcframework | iOS |
cactus-macos.xcframework | macOS |
Integration
Android
- Copy
libcactus.sotoandroid/app/src/main/jniLibs/arm64-v8a/ - Copy
cactus.dartto yourlib/folder
iOS
- Copy
cactus-ios.xcframeworkto yourios/folder - Open
ios/Runner.xcworkspacein Xcode - Drag the xcframework into the project
- In Runner target > General > “Frameworks, Libraries, and Embedded Content”, set to “Embed & Sign”
- Copy
cactus.dartto yourlib/folder
macOS
- Copy
cactus-macos.xcframeworkto yourmacos/folder - Open
macos/Runner.xcworkspacein Xcode - Drag the xcframework into the project
- In Runner target > General > “Frameworks, Libraries, and Embedded Content”, set to “Embed & Sign”
- Copy
cactus.dartto yourlib/folder
Usage
Handles are typed asCactusModelT, CactusIndexT, and CactusStreamTranscribeT (all Pointer<Void> aliases). All functions are top-level.
Basic Completion
Completion with Options and Streaming
Audio Transcription
Streaming Transcription
Embeddings
Tokenization
Vector Index
API Reference
All functions are top-level and mirror the C FFI directly. All functions throwException on failure.
Types
Init / Lifecycle
Completion
Transcription
Embeddings
Tokenization / Scoring
VAD / RAG
Vector Index
Telemetry
Bundling Model Weights
Models must be accessible via file path at runtime.Android
Copy from assets to internal storage on first launch:iOS/macOS
Add model to bundle and access via path:Requirements
- Flutter 3.0+
- Dart 2.17+
- iOS 14.0+ / macOS 13.0+
- Android API 24+ / arm64-v8a
See Also
C API Reference
Full C API reference underlying the Flutter bindings
Vector Index API
Vector database API for RAG applications
Swift SDK
Native Swift alternative for Apple platforms
Kotlin SDK
Native Kotlin alternative for Android