nat.profiler.prediction_trie.data_models#

Classes#

PredictionMetrics

Aggregated statistics for a single metric from profiler data.

LLMCallPrediction

Predictions for an LLM call at a given position in the call hierarchy.

PredictionTrieNode

A node in the prediction trie representing a function in the call hierarchy.

Module Contents#

class PredictionMetrics(/, **data: Any)#

Bases: pydantic.BaseModel

Aggregated statistics for a single metric from profiler data.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

sample_count: int = None#
mean: float = None#
p50: float = None#
p90: float = None#
p95: float = None#
class LLMCallPrediction(/, **data: Any)#

Bases: pydantic.BaseModel

Predictions for an LLM call at a given position in the call hierarchy.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

remaining_calls: PredictionMetrics = None#
interarrival_ms: PredictionMetrics = None#
output_tokens: PredictionMetrics = None#
latency_sensitivity: int | None = None#
class PredictionTrieNode(/, **data: Any)#

Bases: pydantic.BaseModel

A node in the prediction trie representing a function in the call hierarchy.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

name: str = None#
children: dict[str, PredictionTrieNode] = None#
predictions_by_call_index: dict[int, LLMCallPrediction] = None#
predictions_any_index: LLMCallPrediction | None = None#