Skip to main content

VlmOptions

Struct VlmOptions 

Source
pub struct VlmOptions {
    pub prompt: Option<String>,
    pub system_prompt: Option<String>,
    pub decoding: Decoding,
    pub max_new_tokens: Option<usize>,
    pub stop: Vec<String>,
    pub frames_per_window: Option<usize>,
    pub repetition_penalty: Option<f32>,
}
Expand description

Options for a VLM call (Argus).

§Gate 2 — the v1 surface, and what is deliberately NOT here

Settled once, before implementation, because every field is cheap now and a breaking change later (docs/plans/argus-launch-plan.md §2 Gate 2).

Excluded from v1, as decisions rather than oversights:

  • Streaming. Tokens as produced. It changes the return type of every method, so it is a trait redesign and not a field; it waits until there is a consumer that needs it.
  • Grounding. Region-in (“what is in this box”) and grounded-out (“the dog [x,y,w,h]”). Diana already returns boxes; a second, weaker box source in the toolkit needs a reason beyond “the model can”.
  • Structured / JSON output. Needs constrained decoding to be worth anything — an unconstrained “please reply in JSON” is a request, not a guarantee. High value for a tooling product, so it is v2 rather than never; mistral.rs already provides grammar-constrained decoding, which is what makes it cheap when it lands.
  • Token-level confidence (logprobs). Carmenta uses recognition confidence for its verifier and the analog is genuinely valuable, but it is only meaningful once an engine exists to produce it honestly.
  • Conversation history / multi-turn. VlmPrompt can already express an interleaved turn sequence; a typed history is a chat-session concern, and Argus is a media op.

Not here because it belongs to the ENGINE, not the caller: the chat template, the special vision tokens (<image>, <|vision_start|>), and the M-RoPE time axis for video. Those are properties of a specific checkpoint. Exposing them as options would invite a caller to set them wrong — and the launch plan measured what that costs: 43 of 50 answers changed on identical weights purely from prompt formatting, with no error raised.

Fields§

§prompt: Option<String>

Instruction for the model; None = plain captioning.

Read by VlmEngine::describe_image only. VlmEngine::describe takes its text from the prompt’s own VlmPart::Text parts, because position matters there and a separate field could not say where the text goes.

§system_prompt: Option<String>

Role/behaviour framing, when the checkpoint’s template has a slot for it. Engines without one must ignore it rather than concatenate it into the user turn, which changes the prompt the model was tuned on.

§decoding: Decoding

Token-selection strategy. Defaults to Decoding::Greedy.

§max_new_tokens: Option<usize>

Token budget. None = the engine’s own default.

§stop: Vec<String>

Stop strings. Generation halts as soon as one is produced; the string itself is not included in the returned text.

EOS is not here — that is the tokenizer’s, and an engine that needed to be told its own EOS would be misconfigured.

§frames_per_window: Option<usize>

Frames shown to the model per video caption. None = the engine’s own default.

This is the video knob that decides what a caption can be ABOUT, and the arithmetic is worth stating because it is not obvious. A still image is split into tiles so fine print survives — for SmolVLM that is 17 tiles at 64 tokens, 1088 tokens per image. A text tower with 8192 positions therefore holds seven such frames, which is not a window so much as a slideshow.

Video engines turn splitting off, making a frame one tile, and the same 8192 positions then hold a hundred. So this number trades fine detail within a frame against temporal context across frames, and the right value depends on the question being asked — which is why it is a caller’s option and not a constant.

1 degenerates to per-frame captioning: correct, and blind to motion.

§repetition_penalty: Option<f32>

Repetition penalty, None = disabled.

Sits beside Self::decoding rather than inside Decoding::Sampled because it is a logit transform, not a sampling one: it applies to greedy decoding too, and small models loop under greedy more than under sampling.

Trait Implementations§

Source§

impl Clone for VlmOptions

Source§

fn clone(&self) -> VlmOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VlmOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VlmOptions

Source§

fn default() -> VlmOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V