Skip to content

Model Cost & Quota Governance

Executive Summary

This sub-scenario focuses on centralized governance of model and external platform usage, cost, quotas, and health signals, ensuring transparent and controllable call costs with anomaly alerts within 5 minutes and automatic throttling, degradation, or shutdown triggers.

Scope & Guardrails

  • In Scope: Usage metering, cost aggregation, quota strategy, anomaly detection, alerts, reports, runbooks.
  • Out of Scope: Financial settlement process, contract management, business pricing strategy.
  • Environment & Flags: provider-cost-guard, quota-enforcer; depends on Cost Warehouse, Quota Service, Telemetry.

Participants & Responsibilities

ScopeRepositoryLayerResponsibilities & DeliverablesOwners
cost-meteringpowerxopsToken/Call metering, cost calculation, data persistenceOps Reliability Center
quota-servicepowerxopsQuota configuration, throttling, shutdown strategyAgent Platform Guild
observabilitypowerxopsMetrics, reports, runbooksOps Reliability Center

End-to-End Flow

  1. Collect call metering and calculate cost → 2. Compare with tenant/project quotas, trigger alerts or throttling when exceeding thresholds → 3. Push metrics to dashboards, generate reports → 4. If anomalies occur, execute degradation/shutdown and record audit logs.

Key Interactions & Contracts

  • POST /internal/provider-usage/report, GET /internal/provider-quotas, POST /internal/provider-quotas/enforce, EVENT agent.provider.cost.anomaly.
  • Configuration: config/cost/provider_rates.yaml, config/quotas/model_usage.yaml.

Acceptance Criteria

  • Cost data latency <1 minute; quota exceeded alerts delivered within 5 minutes; throttling/shutdown operations 100% audited; degradation strategy effective within 2 minutes.

Telemetry & Ops

  • Metrics: agent.provider.cost_total, agent.provider.quota_usage, agent.provider.alert_total, agent.provider.degrade_total.
  • Alerts: Cost spikes, quota exceeded, degradation failures.

References

  • docs/meta/scenarios/powerx/agent-and-automation/agent-model-platform/primary.md
  • scripts/qa/provider-drill.mjs

Released under the Apache 2.0 License.