web/flutter_gemma_web library

Classes

AudioPromptPart
Audio prompt part with raw audio bytes For Gemma 3n E4B models - supports PCM audio (16kHz, 16-bit, mono)
BlobUrlModelSource
WebStorageMode.cacheApi / WebStorageMode.none path. url is a blob: URL produced by WebCacheService / BlobUrlManager, or an https: URL when caching is disabled.
FlutterGemmaWeb
ImagePromptPart
Image prompt part with data URL
LiteRtLmWebInferenceModel
Web .litertlm inference via the upstream @litert-lm/core early-preview JS API (LiteRT-LM v0.12.0+ on web through WebGPU/WASM).
LiteRtLmWebSession
Session-side accumulator + async iterator pump for @litert-lm/core.
OpfsStreamModelSource
WebStorageMode.streaming + opfs://<filename> path. Carries the WebOPFSService and the OPFS filename so each engine can ask for the form it consumes — MediaPipe wants a ReadableStreamDefaultReader, @litert-lm/core wants the raw ReadableStream.
PromptPart
Base class for prompt parts (text, image, audio)
TextPromptPart
Text prompt part
WebInferenceModel
WebModelManager
Web Model Manager - Modern API Facade Pattern
WebModelSession
WebModelSource
Result of resolving an active web model into a form an engine (MediaPipe LlmInference OR @litert-lm/core Engine) can consume.
WebModelSourceResolver
Resolves the active inference model from WebModelManager into the correct WebModelSource subtype based on ServiceRegistry useStreamingStorage and the resolved path prefix. This is the single piece of code that decides blob-URL vs OPFS-stream — both WebInferenceModel (MediaPipe) and LiteRtLmWebInferenceModel (@litert-lm/core) consume it.