ffai_argus/lib.rs
1//! # Argus — `FFai`'s vision-language component
2//!
3//! Named for Argus Panoptes, the all-seeing hundred-eyed watchman: image
4//! captioning, visual Q&A, and video understanding.
5//!
6//! # What runs
7//!
8//! **`SmolVLM`-256M-Instruct on candle** — a `SigLIP` tower, a pixel-shuffle
9//! connector and a Llama text decoder, each gated tensor-by-tensor against the
10//! reference implementation (`docs/plans/argus-launch-plan.md`, steps 3-6).
11//! Video understanding composes `ffai-media::stream_frames` (rff-backed
12//! sampling) with per-frame captioning into a timed track.
13//!
14//! **`mistral.rs` is not rejected** — it stays the documented path for the
15//! serving concerns it owns (quantized weights, grammar-constrained JSON), and
16//! the `mistralrs-backend` feature is reserved for it. It is not the path here
17//! because the version proven to serve `SmolVLM` is a git revision, and
18//! `cargo publish` refuses a git dependency — a constraint that has already
19//! made every downstream `FFai` crate unpublishable once.
20
21pub mod clock;
22pub mod cost;
23pub mod decode;
24pub mod engine;
25pub mod par;
26pub mod preprocess;
27pub mod prompt;
28pub mod siglip;
29pub mod text;
30pub mod vision;
31
32use std::sync::Arc;
33
34use ffai_core::registry::EngineRegistry;
35
36pub use engine::SmolVlm;
37
38/// Install every Argus engine into a registry.
39pub fn register(reg: &mut EngineRegistry) {
40 reg.register_vlm(Arc::new(SmolVlm::new()));
41}
42
43#[cfg(test)]
44mod tests {
45 use super::*;
46 use ffai_core::engine::EngineStatus;
47
48 #[test]
49 fn registers_vlm_engine() {
50 let mut reg = EngineRegistry::new();
51 register(&mut reg);
52 let e = reg.vlm(None).expect("vlm engine");
53 assert_eq!(e.info().name, "smolvlm");
54 // The status is what `ffai engines` prints. `Stable` is defined as
55 // "oracle-gated against a reference implementation" — a claim steps
56 // 3-6 earned and that this assert stops anyone quietly re-stubbing.
57 assert_eq!(e.info().status, EngineStatus::Stable);
58 }
59}