pub trait InferenceEngine {
// Required methods
fn prefill(&mut self, tokens: &[Token]) -> Result<u32>;
fn next_logits(&mut self, committed: &[Token]) -> Vec<i32>;
fn eos_token(&self) -> Token;
}Expand description
The inference engine adapter (RuntimeAcl). Implemented for real by Candle
in the excluded adapter el-engine-candle (ADR-002).
Logits are integer milli-logits to keep the orchestrator deterministic and float-free; a real engine quantises its float logits at the ACL boundary.
Required Methods§
Sourcefn prefill(&mut self, tokens: &[Token]) -> Result<u32>
fn prefill(&mut self, tokens: &[Token]) -> Result<u32>
Encode the (compressed) prompt; returns the resulting KV length.
Sourcefn next_logits(&mut self, committed: &[Token]) -> Vec<i32>
fn next_logits(&mut self, committed: &[Token]) -> Vec<i32>
Produce next-token logits given the committed context.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".