grate-limiter 0.1.1

Anticipatory rate-limit orchestration engine for multi-provider systems. Predict limits before providers enforce them.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::{Deserialize, Serialize};

use crate::quota::QuotaConfig;

/// Configuration for a provider.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProviderConfig {
    /// Unique provider name (e.g., "openai", "anthropic").
    pub name: String,
    /// Quota configurations for this provider.
    pub quotas: Vec<QuotaConfig>,
    /// Default priority (higher = preferred). Overridden at capability level.
    pub priority: u16,
    /// Weight multiplier for scoring (default 1.0).
    pub weight: f32,
    /// Cooldown duration in seconds after repeated failures.
    pub cooldown_seconds: u64,
}