MentorModelUsage record
The MentorModelUsage record of Novior.MentorAgent.Abstractions.Models: Per-model usage, cost and time series for the admin dashboard (roadmap #9). One entry…
On this page
Per-model usage, cost and time series for the admin dashboard (roadmap #9). One entry per distinct model id seen at runtime — typically the cheap chat model, the strong routing model, and the embedding model. Cost is populated only when MentorOptions.ModelPricing has an entry for MentorModelUsage.ModelId.
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Abstractions.Models. Package: Novior.MentorAgent.Abstractions.
public sealed record MentorModelUsage : IEquatable<MentorModelUsage>
dotnet add package Novior.MentorAgent.AbstractionsConstructors
Section titled “Constructors”public MentorModelUsage()
Properties
Section titled “Properties”AvgLatencyMs
Section titled “AvgLatencyMs”public double? AvgLatencyMs { get; init; }
Average full-response latency (ms) across all calls, or null.
AvgTimeToFirstByteMs
Section titled “AvgTimeToFirstByteMs”public double? AvgTimeToFirstByteMs { get; init; }
Average time-to-first-byte (ms) for streaming calls, or null.
InputCost
Section titled “InputCost”public decimal? InputCost { get; init; }
Estimated input cost, or null when no pricing is configured for this model.
InputTokens
Section titled “InputTokens”public long InputTokens { get; init; }
public MentorModelKind Kind { get; init; }
ModelId
Section titled “ModelId”public required string ModelId { get; init; }
OutputCost
Section titled “OutputCost”public decimal? OutputCost { get; init; }
Estimated output cost, or null when no pricing is configured.
OutputTokens
Section titled “OutputTokens”public long OutputTokens { get; init; }
RequestCount
Section titled “RequestCount”public long RequestCount { get; init; }
RequestsWithoutUsage
Section titled “RequestsWithoutUsage”public long RequestsWithoutUsage { get; init; }
How many of MentorModelUsage.RequestCount reached the provider but reported no token usage — in practice, turns the user stopped mid-stream.
Providers send usage in the final streaming update, so a cancelled stream never delivers it. Those calls are still billed, and billed for the entire input prompt, so omitting them understates spend; but their token counts are genuinely unknown and inventing a number — zero included — would quietly drag every per-request average down. They are therefore counted as requests, contribute nothing to the token totals, and are disclosed here (BUG-032).
Series
Section titled “Series”public IReadOnlyList<MentorUsagePoint> Series { get; init; }
Time-series buckets, oldest first.
TotalCost
Section titled “TotalCost”public decimal? TotalCost { get; }
Estimated total cost, or null when pricing is not available.
TotalTokens
Section titled “TotalTokens”public long TotalTokens { get; }
