grate_limiter/provider.rs
1use serde::{Deserialize, Serialize};
2
3use crate::quota::QuotaConfig;
4
5/// Configuration for a provider.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct ProviderConfig {
8 /// Unique provider name (e.g., "openai", "anthropic").
9 pub name: String,
10 /// Quota configurations for this provider.
11 pub quotas: Vec<QuotaConfig>,
12 /// Default priority (higher = preferred). Overridden at capability level.
13 pub priority: u16,
14 /// Weight multiplier for scoring (default 1.0).
15 pub weight: f32,
16 /// Cooldown duration in seconds after repeated failures.
17 pub cooldown_seconds: u64,
18}