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.
VlmPromptcan 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: DecodingToken-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
impl Clone for VlmOptions
Source§fn clone(&self) -> VlmOptions
fn clone(&self) -> VlmOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VlmOptions
impl Debug for VlmOptions
Source§impl Default for VlmOptions
impl Default for VlmOptions
Source§fn default() -> VlmOptions
fn default() -> VlmOptions
Auto Trait Implementations§
impl Freeze for VlmOptions
impl RefUnwindSafe for VlmOptions
impl Send for VlmOptions
impl Sync for VlmOptions
impl Unpin for VlmOptions
impl UnsafeUnpin for VlmOptions
impl UnwindSafe for VlmOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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