For Japanese version, see IProviderUsageStats-jp.md.
IProviderUsageStats (Usage Telemetry Interface Specification)
1. Responsibility Boundary
IProviderUsageStats exposes near-real-time throughput, token consumption, and rate-limit pressure to drive dynamic routing decisions.
- Role:
- Non-role:
Provide short-window usage and performance signals for operational balancing.
Long-term archival/audit retention is outside this interface scope.
2. Properties
| Property | Type | Description |
|---|---|---|
ProviderId |
string |
Provider identifier. |
WindowStartUtc |
DateTimeOffset |
Usage aggregation window start. |
WindowEndUtc |
DateTimeOffset |
Usage aggregation window end. |
RequestsCount |
long |
Total requests in window. |
InputTokens |
long |
Total input tokens in window. |
OutputTokens |
long |
Total output tokens in window. |
AvgLatencyMs |
double |
Average request latency. |
RateLimitUtilization |
double |
Ratio between current usage and limit (0.0 to 1.0+). |
3. Use Cases
UC-19Parallel multi-model execution:UC-23AI credit management:
Uses latency/pressure signals to rebalance traffic across providers.
Uses token telemetry to monitor live budget burn rate.
4. Integration with IModelVectorRouter
- Congestion avoidance:
- Allocation efficiency:
Down-rank providers when RateLimitUtilization rises or AvgLatencyMs degrades.
Temporarily avoid high-pressure routes to preserve system-wide availability.
5. Visualization Mapping (Dashboard/Pie)
- Request share:
- Token throughput:
- Rate-limit pressure:
- Labels:
RequestsCount
InputTokens, OutputTokens
RateLimitUtilization
ProviderId, WindowStartUtc, WindowEndUtc
6. Governance & Determinism
- Observation accuracy:
- Replay integrity:
- Window consistency:
Include error paths (e.g., 429s) in pressure/latency interpretation to avoid optimistic bias.
Persist referenced usage snapshots so congestion context is reconstructable during replay.
Align comparison windows or define interpolation rules before cross-provider scoring.
Changelog
- v0.0.0 / v0.0.0.0: Initial draft
- v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
architecture/interfaces/provider/IProviderUsageStats.md