Skip to main content

Crate ffai_core

Crate ffai_core 

Source
Expand description

§ffai-core

The spine of FFai: shared media/AI types, one trait per task, and the engine registry that makes implementations interchangeable.

The design borrows ffmpeg’s load-bearing idea: AVCodec is a registry of interchangeable implementations selected by name (-c:v libx264). FFai’s equivalent: engine::AsrEngine, engine::TtsEngine, engine::OcrEngine, and engine::VlmEngine are traits with many competing engines behind them, selected with --engine <name>.

Candle is the tensor spine — re-exported here as candle so every engine crate shares one Tensor/Device and buffers flow between models without copies.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use candle_core as candle;

Modules§

cost
A deterministic cost model — counters, not a stopwatch.
engine
One trait per task, many engines per trait.
error
fastmath
Transcendentals without libm calls — the shared kernel every engine uses.
fastops
Tensor-level activations on crate::fastmath — the drop-in replacements for candle’s, which compute a scalar libm call per element.
registry
The engine registry — FFai’s equivalent of ffmpeg’s codec registry.
types
Shared media and AI result types.

Functions§

best_device
Pick the best available compute device.
release_load_arena
Release memory the allocator is holding after a large one-off load.