pub struct MockEngine { /* private fields */ }Expand description
A mock engine implementation for Milestone A.
Uses a simple whitespace tokenizer and greedy sampler to demonstrate the “narrow waist” API without requiring a real model or MLX backend.
Implementations§
Source§impl MockEngine
impl MockEngine
Trait Implementations§
Source§impl Default for MockEngine
impl Default for MockEngine
Source§impl LlamaEngine for MockEngine
impl LlamaEngine for MockEngine
Source§fn load_model(&self, _spec: &ModelSpec) -> Result<ModelHandle>
fn load_model(&self, _spec: &ModelSpec) -> Result<ModelHandle>
Load a model from disk given a specification.
Source§fn tokenize(&self, text: &str) -> Result<Vec<TokenId>>
fn tokenize(&self, text: &str) -> Result<Vec<TokenId>>
Convert text into a sequence of token IDs.
Source§fn prefill(
&self,
_session: &mut Session,
tokens: &[TokenId],
) -> Result<PrefillResult>
fn prefill( &self, _session: &mut Session, tokens: &[TokenId], ) -> Result<PrefillResult>
Run the prefill phase: process prompt tokens and populate the KV cache.
Auto Trait Implementations§
impl !Freeze for MockEngine
impl RefUnwindSafe for MockEngine
impl Send for MockEngine
impl Sync for MockEngine
impl Unpin for MockEngine
impl UnsafeUnpin for MockEngine
impl UnwindSafe for MockEngine
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