initialize method

Future<void> initialize({
  1. required String modelPath,
  2. String backend = 'gpu',
  3. String? visionBackend,
  4. String? audioBackend,
  5. int maxTokens = 4096,
  6. int outputTokens = 256,
  7. int? prefillTokens,
  8. int? maxNumImages,
  9. String? cacheDir,
  10. bool speculativeDecoding = true,
  11. int minLogLevel = 3,
  12. LiteRtLmActivationDataType? activationDataType,
  13. int? prefillChunkSize,
  14. bool? parallelFileSectionLoading,
  15. String? dispatchLibDir,
  16. 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.');
}