What LiteRT-LM's benchmark reports about a conversation: its tokens over
every turn so far, the last decode's speed, the first token's latency and
the engine's load time. LiteRT-LM's Kotlin/Swift BenchmarkInfo, summed
over the conversation rather than its last turn.
What a .litertlm file says about itself, read before any engine exists:
its container version, its system metadata, and its sections with their
declared constraints and the NPU each compiled section targets.
LiteRT-LM builds an engine's sampler at its first generation and keeps it
for every later conversation (google-ai-edge/LiteRT-LM#2080), so a later
session that asks for another sampler does not get it. This records the
first and says what a later generation should report.
An error thrown while libLiteRtLm, or a library it needs, loads or is
checked: what Engine.create reports as a LiteRtLmLibraryException.
Each keeps the type the load threw (the Flutter adapter's backend fallback
tells an Exception from an Error), so this marks it instead of replacing
it.
The .litertlm embedder on the web: text, images when declared on a
bundle with a vision encoder, audio when declared on a bundle with an
audio encoder, and any combination of them in one vector.
What the pass hands EmbeddingEngine.create (EmbeddingEngineSettings).
A null field is left out of the settings object, so the runtime applies
its own rule — for visionBackend and audioBackend, that tower
disabled.
What one computeEmbedding call embeds: one part — a string, an encoded
image or an encoded audio clip — or several of them in one vector
(LiteRtLmWebParts).
The SoC a .litertlm bundle's compiled sections target: the
LiteRtStamp the AOT compiler writes into each section it compiles, with
the vendor and SoC spelled as the compiler stamped them.
How native's last send ended (LiteRtLmTurnEnd in the patched
c/conversation.h), as litert_lm_conversation_get_last_turn_end reports
it after a send (§23) and litert_lm_conversation_rewind_cancelled_turn
after waiting for one (§16). In the C enum's order: the index is the code.
The hosts, in Abi.current() spelling, where a generic EmbeddingGemma 2
bundle runs on the GPU when preferredBackend: gpu asks for it: LiteRT-LM's
GPU executor, over the WebGPU accelerator these archives ship on Linux and
Windows and the Metal accelerator linked into libLiteRtLm on macOS.
Which generic EmbeddingGemma 2 bundles have run with their text tower on
the GPU of each liteRtLmEmbeddingGpuAbis host; a gpu request for any
other is refused there, naming the missing run. Linux x64: all three since
litertlm 1.19.0 (measured on the 270m; the others run the same text tower
with their media towers on CPU). Windows x64: the 270m on Panther Lake and
Lunar Lake (L1, 2026-11-04). macOS: the 270m and the 740m text towers on
Metal (L1 C probe; the 270m and 740m through this pass, L2).
The hosts where preferredBackend: gpu for a generic EmbeddingGemma 2
bundle is refused with an EmbeddingLoadException
(liteRtLmEmbeddingGpuRefusal) instead of running anywhere: a host whose
GPU path ends the process, which no Dart code can catch, so the request is
refused rather than run on the CPU (the app asked for the GPU). None on
native-v0.19.0-a: Windows x64 was here on native-v0.18.0-h (#744, an
access violation in webgpu_dawn.dll at the first EmbeddingGemma 2 GPU
load) and runs on 0.19 (liteRtLmEmbeddingGpuAbis).
The hosts, in Abi.current() spelling, the native archive is published
for (hook/build.dart, one litertlm-<host>.tar.gz each; the iOS
simulator's ios_sim_arm64 archive reports ios_arm64). Anywhere else
the app builds without libLiteRtLm, and nothing of this package loads.
The backend of the audio tower on the web: WebGPU, as the text and vision
towers. Both work; WebGPU is about 65 times faster. Measured on the 740m,
Chrome 155, Tesla T4 (2.6-3.6 s clips of speech):
contents as one embedder request: at most one text part, any image
parts and at most one audio part. Throws ArgumentError for contents an
engine of modalities does not take (checkEmbeddingRequest).
Whether a bundle whose TFLiteModel sections have modelTypes carries an
audio tower: a tf_lite_audio_encoder_hw section, the one key LiteRT-LM
builds its audio executor for (ModelType::kTfLiteAudioEncoderHw); only
the 740m has it, beside tf_lite_audio_adapter and tf_lite_end_of_audio.
Compiled at create like the vision tower (litertlmHasVisionTower).
Whether a bundle whose TFLiteModel sections have modelTypes carries a
vision tower: a tf_lite_vision_encoder section, the one key LiteRT-LM
builds its vision executor for (runtime/core/embedding_engine_impl.cc,
ModelType::kTfLiteVisionEncoder). The 440m and the 740m have it beside
tf_lite_vision_adapter and tf_lite_end_of_vision, neither of which
gets an executor of its own; the 270m has only tf_lite_text_encoder and
tf_lite_embedder. LiteRT-LM compiles a present tower at create, declared
or not: on its own backend when one is named, else on the main one.
The JSON native wrote for message, when it was parsed from a reply
chunk: the Flutter adapter hands it to core's own parser, which reads what
Message does not keep (a call's id).
Every library of vendor's stack on operatingSystem
(Platform.operatingSystem spelling), as CodeAsset names: what
NativeAssetsManifest.json lists when the build carries the stack, and what
Android hands LiteRT as the dispatch directory.
The vendor this package dispatches a bundle stamped target to, or null
when it has no dispatch for that vendor. Internal: not in the package's
show list, so NpuStack stays out of the public API.
The model_type of every TFLiteModel section of a .litertlm file,
lowercased, in file order, from prefix — a reader of the file's first
length bytes (fewer when the file is shorter). It is asked for the
32-byte preamble, then for everything up to the header end.
Throws EmbedderLoadException unless the .litertlm bundle at url
has an audio encoder, read from its container header through
runtime's readPrefix (a few KB) — D23, the native rule
(litertlm_container.dart): ModelInfo claims audio on the 270m and the
440m, and the web has no ModelInfo at all. A header that cannot be read or
parsed is a load failure naming fileName, never "no audio".
requireLiteRtLmWebAudioEncoder for the bundle config names, as
describe() runs it before core closes the embedder it holds: the
opfs:// path resolved to a blob: URL for the read, and that URL
revoked after it, whatever the outcome.
LiteRT-LM's benchmark record of a conversation (LiteRtLmBenchmarkInfo),
turn by turn: the engine's init time, the first token's latency, every
prefill and decode turn, and the context window the executor uses (0
before the first prefill).
Native cancelled a turn that nobody on this side asked to cancel: the turn
depended on an earlier cancelled one, so the conversation is poisoned and
has to be rebuilt.
A turn ended by closing its session or model before anyone asked to stop
it (B90): a StateError, so a consumer of getResponseAsync sees one,
and a type of its own, so the session's startTurn can report the close
as TurnEnd.closed and end the text cleanly instead.
The NPU cannot be reached on this device: no dispatch stack in the build,
no Qualcomm FastRPC or DSP on the device, or a dispatch directory that
could not be prepared. message says which.
The stopped turn could not be rewound, so the conversation must be
rebuilt. code is the absl status code native returned (-1 when the call
itself failed), lastTurnEnd how native's last send had ended.