#[non_exhaustive]pub struct Stats { /* private fields */ }Expand description
What the turn cost, as the engine measured it.
§Examples
use cactus_rs::needle::Completion;
let completion: Completion =
r#"{"type":"respond","prefill_tps":1966.8,"decode_tps":809.7,"peak_ram_mb":90.9}"#
.parse()?;
assert_eq!(completion.stats().decode_tps(), 809.7);Implementations§
Source§impl Stats
impl Stats
Sourcepub const fn prefill_tps(&self) -> f32
pub const fn prefill_tps(&self) -> f32
Tokens per second while reading the prompt.
§Examples
use cactus_rs::needle::Completion;
let completion: Completion = r#"{"type":"respond","prefill_tps":1966.8}"#.parse()?;
assert!(completion.stats().prefill_tps() > 0.0);Sourcepub const fn decode_tps(&self) -> f32
pub const fn decode_tps(&self) -> f32
Tokens per second while writing the answer.
§Examples
use cactus_rs::needle::Completion;
let completion: Completion = r#"{"type":"respond","decode_tps":809.7}"#.parse()?;
assert!(completion.stats().decode_tps() > 0.0);Sourcepub const fn peak_ram_mb(&self) -> f32
pub const fn peak_ram_mb(&self) -> f32
Peak resident memory during the turn, in megabytes.
§Examples
use cactus_rs::needle::Completion;
let completion: Completion = r#"{"type":"respond","peak_ram_mb":90.9}"#.parse()?;
assert!(completion.stats().peak_ram_mb() > 0.0);Trait Implementations§
impl Copy for Stats
Source§impl<'de> Deserialize<'de> for Stats
impl<'de> Deserialize<'de> for Stats
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
impl StructuralPartialEq for Stats
Auto Trait Implementations§
impl Freeze for Stats
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin for Stats
impl UnsafeUnpin for Stats
impl UnwindSafe for Stats
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