Unified ML API for Dala apps on iOS and Android.
Single entry point for machine learning in Dala, integrating:
- Nx - Core tensor library (pure Elixir, works everywhere)
- Scholar - Traditional ML (regression, clustering, SVM, etc.)
- NxSignal - Digital signal processing (audio, time series)
- Axon - Neural networks (deep learning)
- EMLX - Apple Silicon GPU acceleration (iOS only, auto-configured)
- CoreML - iOS-native ML framework (Neural Engine, iOS only)
- ONNX Runtime - Cross-platform inference engine (iOS/Android)
Quick Start
# Zero-config setup (call once at app startup)
Dala.ML.setup()
# Now use any of the integrated libraries
tensor = Nx.tensor([1.0, 2.0, 3.0])
Nx.sum(tensor)Platform Support
| Library | iOS Device | iOS Sim | Android |
|---|---|---|---|
| Nx | ✅ | ✅ | ✅ |
| Scholar | ✅ | ✅ | ✅ |
| NxSignal | ✅ | ✅ | ✅ |
| Axon | ✅ | ✅ | ✅ |
| EMLX (GPU) | ✅ | ✅ | ❌ |
| CoreML | ✅ | ✅ | ❌ |
| ONNX Runtime | ✅ | ✅ | ✅ |
Summary
Functions
Returns true if running on Android.
Returns a list of available ML backends for the current platform.
Benchmarks a simple ML operation on the current backend.
Returns true if running on any iOS platform (device or simulator).
Returns true if running on a real iOS device (not simulator).
Returns true if running in iOS Simulator.
Runs inference using the best available backend.
Sets up the ML stack for the current platform.
Gets the current ML stack status.
Quick verification that the ML stack is working.
Functions
@spec android?() :: boolean()
Returns true if running on Android.
@spec available_backends() :: [atom()]
Returns a list of available ML backends for the current platform.
Benchmarks a simple ML operation on the current backend.
Returns %{time_ms: float, backend: term, gflops: float}.
@spec ios?() :: boolean()
Returns true if running on any iOS platform (device or simulator).
@spec ios_device?() :: boolean()
Returns true if running on a real iOS device (not simulator).
@spec ios_simulator?() :: boolean()
Returns true if running in iOS Simulator.
Runs inference using the best available backend.
Dispatches based on model type:
- Binary (string) on iOS → CoreML
- Integer → ONNX session
- Tuple → Axon model
@spec setup() :: :ok
Sets up the ML stack for the current platform.
Call once at app startup. Detects platform and configures the best available backend automatically.
@spec status() :: map()
Gets the current ML stack status.
@spec verify() :: map()
Quick verification that the ML stack is working.