Skip to main content

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.

FailoverConfig

Configuration for failover behavior.

FailoverManager

Manages failover between multiple LLM auth profiles. Provides automatic failover when rate limits or errors occur, with configurable retry behavior…

FailoverStatus

Status information for the failover manager.

ProviderStatus

Status of an LLM provider.

Rust Failover

Rust Retry