RunAnywhereModule class abstract
Protocol for SDK modules that provide AI capabilities.
Modules encapsulate backend-specific functionality for the SDK. Each module typically provides one or more capabilities (LLM, STT, TTS, VAD).
Registration with the C++ service registry is handled via FFI by calling
rac_backend_*_register() functions during module initialization.
Implementing a Module (matches Swift pattern)
class LlamaCpp implements RunAnywhereModule {
@override
String get moduleId => 'llamacpp';
@override
String get moduleName => 'LlamaCpp';
@override
Set<SDKComponent> get capabilities => {SDKComponent.llm};
@override
int get defaultPriority => 100;
@override
InferenceFramework get inferenceFramework => InferenceFramework.llamaCpp;
static Future<void> register({int priority = 100}) async {
// Call C++ registration via FFI
final result = _lib.lookupFunction<...>('rac_backend_llamacpp_register')();
// ...
}
}
Constructors
Properties
-
capabilities
→ Set<
SDKComponent> -
Set of capabilities this module provides
no setter
- defaultPriority → int
-
Default priority for service registration (higher = preferred)
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- inferenceFramework → InferenceFramework
-
The inference framework this module uses
no setter
- moduleId → String
-
Unique identifier for this module (e.g., "llamacpp", "onnx")
no setter
- moduleName → String
-
Human-readable name for the module
no setter
- 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