providers/unified_provider.rs

litellm-rs · src/core/providers/unified_provider.rs · rust · MIT
auth

Unified error handling for AI providers with retry logic and HTTP mapping

// Source: https://github.com/majiayu000/litellm-rs | License: MIT | Copyright 2024 Rust LiteLLM Gateway Contributors
// Provided via justclaw.it.com; keep this notice with the code.
//! Unified Provider Error Handling
//!
//! Single error type for all providers - optimized design for simplicity and performance
//!
//! This module provides a unified error handling system for all AI providers.
//!
//! ## Core Components
//!
//! ### `ProviderError` Enum
//! A comprehensive error type that covers all possible failure scenarios across different AI providers.
//!
//! | Variant | Purpose | HTTP Status | Retryable |
//! |------|------|------------|--------|
//! | Authentication | Authentication failed | 401 | No |
//! | RateLimit | Rate limit exceeded | 429 | Yes (after delay) |
//! | ModelNotFou

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key