sizeInTokens method

  1. @override
Future<int> sizeInTokens(
  1. String text
)
override

Approximate token count — matches FfiInferenceModelSession.sizeInTokens. The @litert-lm/core early-preview API does not expose a tokenizer.

Implementation

@override
Future<int> sizeInTokens(String text) async => (text.length / 4).ceil();