Skip to main content
Antigravity Manager includes a comprehensive quota protection system that monitors account usage and automatically protects models from exhaustion.

Overview

The quota protection system prevents complete account exhaustion by:
  • Real-time quota monitoring - Tracks remaining quota per model
  • Model-level protection - Locks specific models when quota is low
  • Automatic recovery - Re-enables models when quota replenishes
  • Account rotation - Seamlessly switches to healthy accounts

How Quota Protection Works

1. Quota Monitoring

During account loading, the system checks quota levels for each model:

2. Model Grouping & Aggregation

The system groups model variants by standard ID to prevent conflicts:
This prevents issues like:
  • gemini-3.1-pro-low at 0% and gemini-3.1-pro-high at 100% causing routing conflicts

3. Protection Triggering

When quota falls below the threshold, the model is added to the protected list:

4. Runtime Filtering

During token selection, protected models are automatically skipped:

5. Automatic Recovery

When quota replenishes above the threshold, models are automatically restored:

In-Memory Quota Cache

To avoid disk I/O during routing, quota data is cached in memory:
This ensures:
  • Zero disk latency during hot path routing
  • Accurate quota-based sorting
  • Real-time protection status

Migration from Account-Level to Model-Level Protection

Antigravity v4.1.27 migrated from account-level to model-level protection:
Benefits:
  • Accounts with mixed quota levels remain partially available
  • Only exhausted models are protected
  • Better resource utilization

Configuration

Enable Quota Protection

Configuration Options

Best Practices

  1. Set threshold at 10-15% - Provides buffer before complete exhaustion
  2. Monitor high-value models - Focus on expensive models like Opus
  3. Keep auto-refresh enabled - Ensures protection reacts to quota changes
  4. Review protected models daily - Identify accounts needing attention
  5. Use multiple accounts - Distribute load to prevent single-point exhaustion

Monitoring Protected Models

Check protection status via the account detail view:

Troubleshooting

Issue: Account still used after protection enabled

Cause: Protection requires account reload to take effect. Solution:

Issue: Model shows protected but has quota

Cause: Variant grouping - one variant may have low quota while another has high. Solution: Check all variants (e.g., pro-low vs pro-high) in account details.

Issue: All accounts protected, service down

Cause: All accounts exhausted below threshold. Solution:
  • Add more accounts
  • Lower threshold temporarily
  • Wait for quota reset