Skip to main content

Crate shift_preflight

Crate shift_preflight 

Source
Expand description

§SHIFT — Smart Hybrid Input Filtering & Transformation

A multimodal preflight layer that automatically adapts inputs (images, video, audio, documents, text) before they are sent to an AI model.

§Quick Start

use shift_preflight::{pipeline, ShiftConfig, DriveMode};
use serde_json::json;

let payload = json!({
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello"}]
});

let config = ShiftConfig {
    mode: DriveMode::Balanced,
    provider: "openai".to_string(),
    ..Default::default()
};

let (transformed, report) = pipeline::process(&payload, &config).unwrap();

Re-exports§

pub use cost::ImageMetrics;
pub use cost::TokenEstimate;
pub use cost::TokenSavings;
pub use mode::DriveMode;
pub use mode::SafetyLimits;
pub use mode::ShiftConfig;
pub use mode::SvgMode;
pub use pipeline::process;
pub use report::Report;
pub use stats::RunRecord;

Modules§

cost
Token cost estimation for AI vision providers.
inspector
mode
payload
pipeline
Core SHIFT pipeline: inspect → policy → transform → reconstruct.
policy
report
stats
Persistent run statistics for cumulative token savings tracking.
transformer