initialize method
Future<void>
initialize({
- required String modelPath,
- String backend = 'gpu',
- String? visionBackend,
- String? audioBackend,
- int maxTokens = 4096,
- int outputTokens = 256,
- int? prefillTokens,
- int? maxNumImages,
- String? cacheDir,
- bool speculativeDecoding = true,
- int minLogLevel = 3,
- LiteRtLmActivationDataType? activationDataType,
- int? prefillChunkSize,
- bool? parallelFileSectionLoading,
- String? dispatchLibDir,
- int? numberOfThreads,
Initializes the native LiteRT-LM engine.
outputTokens is the fallback per-request output limit, not a benchmark
decode-step count.
Implementation
Future<void> initialize({
required String modelPath,
String backend = 'gpu',
String? visionBackend,
String? audioBackend,
int maxTokens = 4096,
int outputTokens = 256,
int? prefillTokens,
int? maxNumImages,
String? cacheDir,
bool speculativeDecoding = true,
int minLogLevel = 3,
LiteRtLmActivationDataType? activationDataType,
int? prefillChunkSize,
bool? parallelFileSectionLoading,
String? dispatchLibDir,
int? numberOfThreads,
}) {
throw UnsupportedError('LiteRT-LM runtime requires a native platform.');
}