Expand description
QuotaTracker — the per-provider availability decision layer (RFC-031 §4).
Unifies three signals into one verdict per provider:
- Self-tracked counter (primary) —
ProviderBudgettracks tokens oxios itself sent. The base signal. Works on ZAI/Minimax today with zero endpoint work. - Reactive override (safety net) — when a real request 429s or
hits
QuotaExhausted/Transient(which is whatclassify.rsmaps rate-limit/429 to), we mark the providerCooledDownuntilresets_at ?? now + window. This is the drift failsafe: even if the counter still shows headroom, a 429 always wins. - Recalibration (accuracy upgrade) — where a
[
crate::api::quota::QuotaFetcher] exists, periodic recalibration snaps the self-tracked counter to real provider state.
§Decision rule
availability(p):
if reactive_cooldown[p] active: return CooledDown(cooldown[p].until)
if not eligible: return Ineligible
rem% = counter[p].remaining_percent # snapped to last recalibration
if rem% <= min_remaining_percent: return Draining
return AvailableStructs§
- Cooldown
Record - Reactive cooldown record. The 429 failsafe.
- Quota
Tracker - The
QuotaTracker. - Quota
Tracker Snapshot - Snapshot of a provider’s tracker state — used by the API to render the live status panel.
- Recalibration
Record - One recalibration event for the report.
Enums§
- Availability
- Per-provider availability verdict (RFC-031 §4).
- Recalibration
Outcome - Outcome of one recalibration attempt.