pub trait VlmEngine: Send + Sync {
// Required methods
fn info(&self) -> EngineInfo;
fn describe(
&self,
prompt: &VlmPrompt<'_>,
opts: &VlmOptions,
) -> Result<String>;
fn describe_video(
&self,
frames: &[VideoFrame],
opts: &VlmOptions,
) -> Result<Vec<TimedSegment<String>>>;
// Provided method
fn describe_image(
&self,
image: &ImageBuffer,
opts: &VlmOptions,
) -> Result<String> { ... }
}Expand description
Image/video → description (Argus).
See VlmOptions for the Gate-2 surface decision and the written-down v1
exclusions.
Required Methods§
fn info(&self) -> EngineInfo
Sourcefn describe(&self, prompt: &VlmPrompt<'_>, opts: &VlmOptions) -> Result<String>
fn describe(&self, prompt: &VlmPrompt<'_>, opts: &VlmOptions) -> Result<String>
The general path: an ordered, interleaved multimodal prompt.
This is the required method, and describe_image is derived from
it, rather than the other way round. An engine that implemented only
the single-image case would still compile against a multi-image
prompt — and would then silently answer using the first image, or the
last, or a concatenation. Making the general case the one an
implementor must write means multi-image support is a compile-time
obligation instead of a runtime surprise.
Sourcefn describe_video(
&self,
frames: &[VideoFrame],
opts: &VlmOptions,
) -> Result<Vec<TimedSegment<String>>>
fn describe_video( &self, frames: &[VideoFrame], opts: &VlmOptions, ) -> Result<Vec<TimedSegment<String>>>
Video understanding over sampled frames → a timed caption track.
Frames arrive with their timestamps (VideoFrame::timestamp) so an
engine can encode time and not merely order — M-RoPE’s third axis.
Whether it does is the engine’s business; the trait’s job is to make
sure the information reaches it.
Provided Methods§
Sourcefn describe_image(
&self,
image: &ImageBuffer,
opts: &VlmOptions,
) -> Result<String>
fn describe_image( &self, image: &ImageBuffer, opts: &VlmOptions, ) -> Result<String>
One image, with VlmOptions::prompt as the instruction.
Provided: builds a single-image VlmPrompt and calls
Self::describe. Zero-copy — the prompt borrows the image.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".