cortex_hybrid/lib.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3//! # cortex-hybrid
4//!
5//! Backend-neutral ANN stage layer plus a deterministic `Vec<f32>` reference
6//! backend for hybrid ANN/SNN research. Checkpoint parsing stays in
7//! `engram-parser`. Placement and session orchestration stay in
8//! `hybrid-fusion`. External ML engines are optional adapters, not core types.
9//!
10//! ## Modules
11//!
12//! | Module | Role |
13//! |--------|------|
14//! | [`stage`] | Backend-neutral ANN stage contracts; [`stage::ReferenceExecutor`] is the reference backend |
15//! | [`adapter`] | External-adapter capability contract, plus optional Candle `AnnExecutor` |
16//! | [`tensor`] | Reference-backend `Tensor`, fallible construction, core ops |
17//! | [`transformer`] | Reference-backend transformer blocks |
18//! | [`moe`] | Reference-backend MoE routing; checkpoints come from `engram-parser` 0.3.0 |
19//! | [`snn`] | SNN execution contract + optional crate-backed adapters |
20//! | [`types`] | Shared types used by `moe` |
21//! | [`error`] | `CortexError` unified error type |
22//!
23//! Panic-style constructors and ops (`Tensor::from_vec`, `ops::matmul`, …)
24//! remain as pre-1.0 compatibility wrappers. New code should use
25//! [`Tensor::try_from_vec`] and the `try_*` functions in [`crate::tensor::ops`].
26
27pub mod adapter;
28pub mod error;
29pub mod moe;
30pub mod reference_json;
31pub mod snn;
32pub mod stage;
33pub mod tensor;
34pub mod transformer;
35pub mod types;
36
37pub use error::{CortexError, HybridError, Result};
38pub use stage::{AnnExecutor, AnnStage, AnnTopology, ReferenceExecutor, StageId, StageKind};
39pub use tensor::Tensor;