MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

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…

View as Markdown
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.

Namespace: Novior.MentorAgent.Abstractions.Models. Package: Novior.MentorAgent.Abstractions.

public sealed record MentorModelUsage : IEquatable<MentorModelUsage>

Terminal
dotnet add package Novior.MentorAgent.Abstractions

public MentorModelUsage()

public double? AvgLatencyMs { get; init; }

Average full-response latency (ms) across all calls, or null.

public double? AvgTimeToFirstByteMs { get; init; }

Average time-to-first-byte (ms) for streaming calls, or null.

public decimal? InputCost { get; init; }

Estimated input cost, or null when no pricing is configured for this model.

public long InputTokens { get; init; }

public MentorModelKind Kind { get; init; }

public required string ModelId { get; init; }

public decimal? OutputCost { get; init; }

Estimated output cost, or null when no pricing is configured.

public long OutputTokens { get; init; }

public long RequestCount { get; init; }

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).

public IReadOnlyList<MentorUsagePoint> Series { get; init; }

Time-series buckets, oldest first.

public decimal? TotalCost { get; }

Estimated total cost, or null when pricing is not available.

public long TotalTokens { get; }