Skip to main content

Signatures

Building an ImageInput

ImageInput.bitmap is the Android-native path and the one you will use most.

From the photo picker

From CameraX

Throttle it. A VLM pass costs far more than a camera frame interval, so run one at a time and drop frames that arrive while a pass is in flight. The inFlight guard above is the minimum. Always close() the ImageProxy, or the analyzer stalls after a few frames.

Streaming

Options

vlm takes the same LlmOptions as llm, so maxOutputTokens, temperature, and systemPrompt all apply.

Models

VLM runs on the llama.cpp backend, so the model must be a GGUF vision model with its projector. Add runanywhere-llamacpp and pick a VLM entry from the catalog.