Skip to main content

ferrox_models/
recurrent_engine.rs

1//! Recurrent engine stub (Mamba / RWKV).
2//!
3//! Fail-closed at load via [`crate::capability`] until a real state-machine
4//! serve path lands. This module defines the engine shape so future work
5//! has a single place to grow without touching GQA kernels.
6
7use thiserror::Error;
8
9#[derive(Debug, Error)]
10#[error("recurrent engine not implemented for architecture {arch}")]
11pub struct RecurrentUnavailable {
12    pub arch: String,
13}
14
15/// Placeholder for Mamba/RWKV serve. Calling any method returns
16/// [`RecurrentUnavailable`].
17pub struct RecurrentEngine {
18    pub arch: String,
19}
20
21impl RecurrentEngine {
22    pub fn reject(arch: &str) -> Result<(), RecurrentUnavailable> {
23        Err(RecurrentUnavailable {
24            arch: arch.to_string(),
25        })
26    }
27}
28
29#[cfg(test)]
30mod tests {
31    use super::*;
32
33    #[test]
34    fn reject_is_fail_closed() {
35        assert!(RecurrentEngine::reject("mamba2").is_err());
36    }
37}