Skip to main content

Crate qwen3_vl

Crate qwen3_vl 

Source
Expand description

Qwen3-VL structured-output engine for findit-studio.

Imported as qwen3_vl (the package name is qwen3-vl on crates.io; Cargo derives the lib name by replacing hyphens with underscores).

Standalone crate with no findit-proto dependency: the image-analysis preset produces a typed image_analysis::ImageAnalysis (re-exported from the llmtask sibling crate, which hosts the canonical shared type), whose shape mirrors findit-proto::database::SceneVlmResult so a downstream consumer can map field-by-field without re-running inference.

The crate has two layers:

  • Engine + Task — a generic Qwen3-VL constrained-JSON inference engine. Wraps mistralrs 0.8; backend selection (metal / cuda / …) is up to the consumer (see the README). Async-only; callers wrap returned Futures with tokio::time::timeout(..) or tokio::select! for shutdown observation.
  • image_analysis — the only preset that ships today. Owns the prompt, the constrained-JSON schema, the resilient parser, and the image_analysis::ImageAnalysis output type. Detection-array fields (subjects, objects, etc.) are flat Vec<SmolStr>; see the image_analysis module doc and CHANGELOG.md for the rationale on dropping the previous Detection { label, confidence } wrapper.

Cancellation contract: dropping the future returned by Engine::run is a fast wakeup, not GPU cancellation. mistralrs’s engine loop runs the in-flight scheduler step to completion in the background; the response is silently discarded on send. Use tokio::time::timeout(..) for a deadline.

Re-exports§

pub use crate::engine::Engine;
pub use crate::engine::EngineOptions;
pub use crate::engine::RequestOptions;
pub use crate::error::Error;
pub use crate::error::LoadError;
pub use crate::image_analysis::ImageAnalysisTask;

Modules§

engine
The Engine and EngineOptions types.
error
Top-level error types for the qwen3-vl crate.
image_analysis
The image-analysis preset: ImageAnalysisTask produces a typed ImageAnalysis with nine fields (scene category, free-form description, five detection lists, shot-type label, search tags). The “scene” wording survives in the scene field and in the prompt because the upstream use case is video keyframes representing scenes — but the type itself is engine-output for a single image and works for any single-image analysis pipeline.

Structs§

ImageAnalysis
Structured single-image VLM output. Construct via an engine’s ImageAnalysisTask::parse (the Task::parse impl) or, for tests/builders, ImageAnalysis::new followed by with_* chains. All fields are private; the accessor surface follows the rest of the crate’s scenesdetect-style getter / with_* / set_* convention.

Enums§

DynamicImage
Re-exported from the image crate for caller convenience — Engine::run consumes Vec<DynamicImage>. A Dynamic Image
JsonParseError
Convenience parse-error type for crate::Task implementations whose model output is JSON. Available behind the json feature.

Traits§

Task
A structured-output task description.