failover • Rust AI Agent SDK
Model Failover Module for PraisonAI Rust SDK
failover
Rust AI Agent SDK
Model Failover Module for PraisonAI Rust SDK
Provides auth profile management and automatic failover between LLM providers when rate limits or errors occur.
Example
use praisonai::{FailoverManager, AuthProfile, FailoverConfig};
let mut manager = FailoverManager::new(FailoverConfig::default());
manager.add_profile(AuthProfile::new("openai-primary", "openai", "sk-..."));
manager.add_profile(AuthProfile::new("openai-backup", "openai", "sk-...").priority(1));
// Get next available profile
if let Some(profile) = manager.get_next_profile() {
println!("Using profile: {}", profile.name);
}Import
use praisonai::failover::*;Classes
AuthProfile
Authentication profile for an LLM provider.
FailoverConfigConfiguration for failover behavior.
FailoverManagerManages failover between multiple LLM auth profiles. Provides automatic failover when rate limits or errors occur, with configurable retry behavior…
FailoverStatusStatus information for the failover manager.
ProviderStatusStatus of an LLM provider.