Signatures
Building an ImageInput
The constructors are exported as
ImageInputs, plural. Every other SDK names this singular,
so copied examples will not resolve.From the image picker
base64 avoids a filesystem round trip, which matters on iOS where the picker hands you a
sandboxed URI.
From the camera
inFlight guard the queue grows
until the app runs out of memory.
Streaming
setState per token.
Options
vlm takes the same LlmOptions as llm, so maxOutputTokens, temperature, and
systemPrompt all apply. Cap the output: a caption does not need 300 tokens.
Models
VLM runs on the llama.cpp backend, so the model must be a GGUF vision model with its projector. Install@runanywhere/llamacpp and pick a VLM entry from the catalog.
Vision models are larger than text models of the same parameter count, because the projector
ships alongside. Check the download size before offering one on cellular.