BerriAI/litellm · error
failed to build reqwest client
Error message
failed to build reqwest client
What it means
Error "failed to build reqwest client" thrown in BerriAI/litellm.
Source
Thrown at litellm-rust/crates/ai-gateway/src/client.rs:12
use std::sync::OnceLock;
use std::time::Duration;
const HTTP_CLIENT_TIMEOUT_SECS: u64 = 600;
pub(crate) fn http_client() -> &'static reqwest::Client {
static CLIENT: OnceLock<reqwest::Client> = OnceLock::new();
CLIENT.get_or_init(|| {
reqwest::Client::builder()
.timeout(Duration::from_secs(HTTP_CLIENT_TIMEOUT_SECS))
.build()
.expect("failed to build reqwest client")
})
}
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check TLS/certificate configuration and system resources; reqwest client build usually fails on invalid TLS roots or missing CA certificates.
When it happens
Trigger: Thrown at litellm-rust/crates/ai-gateway/src/client.rs:12 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/072a48f89b18d4f9.
Report an issue: GitHub.