Four layers, four responsibilities
Gemma weights encode learned parameters. The tokenizer maps text into model tokens. LiteRT-LM loads compatible artifacts, executes inference and owns native resources. PocketStories supplies image/text inputs, product rules and persistence. Writing a prompt changes the input; it does not retrain Gemma. This is app-managed inference, unlike a remote Gemini request or a system-managed model service.
The selected artifact is gemma-4-E2B-it.litertlm, pinned at revision b3ca0d2f076785a8f4b2219ddbd2bdb99954eae1. Its size is 2,588,147,712 bytes and SHA-256 is 181938105e0eefd105961417e8da75903eacda102c4fce9ce90f50b97139a63c. Inspect data/ModelStore.kt; the download URL, size and digest form a single versioned contract.
The earlier -gpu filename was a different export and lacked the required vision encoder. A name containing GPU says nothing by itself about image support. The corrected header contains a vision encoder, adapter and end-of-vision component. Header presence establishes packaged capability, not successful execution on every device.
Why a file can fit while inference fails
Storage holds downloaded bytes. RAM holds runtime state, tensors and caches. GPU allocations have their own constraints, including a maximum size for one buffer. Quantization changes weight representation; it does not make intermediate activations free. Context length and image processing add working memory beyond the file size.
Artifact present → size/hash verified → engine initializes
→ conversation allocates resources → image encodes → tokens stream
Each arrow can fail independently. The preview's installed() checks file presence and length after verified acquisition; it does not rerun SHA-256 on every launch or certify GPU readiness. A green setup screen therefore means installed, not benchmarked.
Practice and answer check
Write a compatibility row containing artifact revision, runtime 0.16.1, ARM64, Android version, text backend, vision backend, free storage and observed result. Compare 2.59 GB of disk space with the emulator's 128 MiB per-buffer limit: can more free disk resolve that allocation? No. Do not redownload an already verified model for a backend allocation failure.
Read the model card and terms before acquisition. Device compatibility and redistribution conditions are separate questions from checksum integrity.