pub enum GenerationEvent {
Token {
token_id: TokenId,
is_draft: bool,
},
Burst {
accepted: usize,
total_produced: usize,
},
AdaptiveKChanged {
old_k: usize,
new_k: usize,
acceptance_rate: f32,
},
Metrics(SpeculativeMetrics),
Finished {
total_tokens: usize,
reason: String,
},
}Expand description
Events emitted during the speculative generation stream.
Variants§
Token
A committed token ready for output.
Fields
Burst
Telemetry burst summary for the speculative cycle.
AdaptiveKChanged
Adaptive K changed based on empirical acceptance rate.
Metrics(SpeculativeMetrics)
Updated performance metrics and speedup ratio.
Finished
Generation stream finished.
Trait Implementations§
Source§impl Clone for GenerationEvent
impl Clone for GenerationEvent
Source§impl Debug for GenerationEvent
impl Debug for GenerationEvent
Source§impl<'de> Deserialize<'de> for GenerationEvent
impl<'de> Deserialize<'de> for GenerationEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GenerationEvent
impl PartialEq for GenerationEvent
Source§impl Serialize for GenerationEvent
impl Serialize for GenerationEvent
impl StructuralPartialEq for GenerationEvent
Auto Trait Implementations§
impl Forget for GenerationEvent
impl Freeze for GenerationEvent
impl Move for GenerationEvent
impl RefUnwindSafe for GenerationEvent
impl Send for GenerationEvent
impl Sync for GenerationEvent
impl Unpin for GenerationEvent
impl UnsafeUnpin for GenerationEvent
impl UnwindSafe for GenerationEvent
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