setImageTokenBudget method

Future<void> setImageTokenBudget(
  1. int? imageTokenBudget
)

Changes the per-image vision token budget for subsequent image turns (see LlamaCppFlutter.loadModel's imageTokenBudget); null restores the model's metadata default.

Cheap relative to a model reload: the next image turn re-creates the mtmd context (a projector reload from disk) while the LLM context and every KV cache stay untouched. Throws LlamaException when the budget exceeds the micro-batch size fixed at load — raising it beyond that requires reloading the model with the larger imageTokenBudget.

Implementation

Future<void> setImageTokenBudget(int? imageTokenBudget) =>
    _isolate.setImageTokenBudget(id, imageTokenBudget);