1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Candle Runtime backend module.
//!
//! This module provides Candle-based inference for models using the
//! HuggingFace Candle framework. Candle is a pure Rust ML framework
//! with native support for Whisper, LLaMA, and other transformer models.
//!
//! # Features
//!
//! - **Pure Rust**: No external C/C++ dependencies (unlike ONNX Runtime)
//! - **Native Whisper**: Uses candle-transformers Whisper implementation
//! - **Hardware Acceleration**: Metal (macOS/iOS), CUDA (Linux/Windows)
//! - **SafeTensors**: Loads models in HuggingFace SafeTensors format
//!
//! # Feature Flags
//!
//! - `candle`: Enable Candle backend (CPU)
//! - `candle-metal`: Enable Metal acceleration (Apple Silicon)
//! - `candle-cuda`: Enable CUDA acceleration (NVIDIA GPUs)
//!
//! # Example
//!
//! ```no_run
//! # fn _example() -> Result<(), Box<dyn std::error::Error>> {
//! use xybrid_core::runtime_adapter::candle::CandleRuntimeAdapter;
//! use xybrid_core::runtime_adapter::RuntimeAdapter;
//! use xybrid_core::ir::{Envelope, EnvelopeKind};
//!
//! let mut adapter = CandleRuntimeAdapter::new()?;
//! adapter.load_model("/path/to/whisper-tiny")?;
//! # let audio_envelope = Envelope::new(EnvelopeKind::Audio(vec![]));
//! let output = adapter.execute(&audio_envelope)?;
//! # let _ = output;
//! # Ok(())
//! # }
//! ```
// New runtime implementation
pub use CandleRuntimeAdapter;
pub use CandleBackend;
pub use ;
pub use ;
pub use CandleRuntime;
pub use ;