pub struct KimiEngine {
pub weights: KimiDecoderWeights,
pub cfg: KimiDecoderConfig,
pub mla_cfg: MlaConfig,
pub kda_cfg: KdaConfig,
}Expand description
Bundles Kimi K3’s weights with the three real config structs
kimi_forward_token needs, so Engine::forward_token’s three-
argument shape (token_id, pos, state) can wrap Kimi’s real
four-config-argument function.
Fields§
§weights: KimiDecoderWeights§cfg: KimiDecoderConfig§mla_cfg: MlaConfig§kda_cfg: KdaConfigTrait Implementations§
Source§impl Engine for KimiEngine
impl Engine for KimiEngine
type State = KimiDecodeState
Source§fn new_state(&self) -> KimiDecodeState
fn new_state(&self) -> KimiDecodeState
Builds fresh (empty) per-layer state for a new request.
fn vocab_size(&self) -> usize
fn forward_token( &self, token_id: usize, _pos: usize, state: &mut Self::State, ) -> Vec<f32>
Auto Trait Implementations§
impl Freeze for KimiEngine
impl RefUnwindSafe for KimiEngine
impl Send for KimiEngine
impl Sync for KimiEngine
impl Unpin for KimiEngine
impl UnsafeUnpin for KimiEngine
impl UnwindSafe for KimiEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more