pub struct Metrics {
pub prompt_tokens: Option<u64>,
pub completion_tokens: Option<u64>,
pub cached_tokens: Option<u64>,
pub cost_usd: Option<f64>,
pub logprobs: Option<Vec<f64>>,
pub completion_token_ids: Option<Vec<u64>>,
pub prompt_token_ids: Option<Vec<u64>>,
pub extra: Option<Value>,
}Expand description
Per-step LLM metrics. cached_tokens preservation is the Module H
replayable-KV-checkpoint requirement (success criterion R17/R28).
Fields§
§prompt_tokens: Option<u64>Prompt tokens.
completion_tokens: Option<u64>Completion tokens.
cached_tokens: Option<u64>Provider-cached prompt tokens.
cost_usd: Option<f64>Cost in USD.
logprobs: Option<Vec<f64>>Per-token logprobs (optional).
completion_token_ids: Option<Vec<u64>>Completion token ids (v1.3, RL training).
prompt_token_ids: Option<Vec<u64>>Prompt token ids (v1.4).
extra: Option<Value>Additional operational metrics.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metrics
impl<'de> Deserialize<'de> for Metrics
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 Metrics
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
impl UnwindSafe for Metrics
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