1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! Universal LLM API client with provider-agnostic chat, embeddings, files,
//! batches, responses, image generation, transcription, moderation, OCR,
//! rerank, and web-search across 140+ providers.
//!
//! See [`LlmClient`] for the high-level streaming client, [`DefaultClient`]
//! (native-http only) for the canonical reqwest-backed implementation, and
//! [`client::ClientConfig`] for builder-style configuration.
// Provider, HTTP, and retry infrastructure are only active with native-http.
// Suppress dead_code lints on the wasm / no-native-http target so that the
// type-only surface compiles cleanly.
// Many doc comments reference types by short name (`Service`, `LlmRequest`,
// `LiterLlmError::ServiceUnavailable`) when they are in lexical scope inside
// the surrounding `impl` block but not in the rustdoc resolution context.
// These links render fine in the rendered docs (rustdoc treats them as
// plain text); the warnings are noise for our docs flow.
/// Per-provider authentication strategies (API keys, AWS SigV4, OAuth tokens).
/// FFI-friendly client constructors used by the polyglot bindings.
/// High-level LLM client traits and the reqwest-backed [`client::DefaultClient`].
/// Token-cost tracking helpers.
/// Public error types and the crate-wide [`Result`] alias.
pub
/// Provider catalog (built-in providers plus runtime registration of custom providers).
/// Tokenizer helpers for measuring prompt and completion lengths.
/// `tower` middleware layers (rate limiting, retries, observability).
/// Request/response DTOs shared across providers and bindings.
// Re-export key types at crate root.
pub use ;
// DefaultClient requires the native HTTP stack (reqwest on native or WASM fetch API).
pub use DefaultClient;
// Binding-friendly constructors require the native HTTP stack.
pub use ;
// ManagedClient requires both the native HTTP stack and Tower middleware.
pub use ManagedClient;
pub use ;
// Tower middleware public config DTOs (only the configs — Layer/Service/State
// types stay inside the `tower` module since middleware composition is a Rust
// pattern that does not cross FFI cleanly).
pub use ;
// Re-export the public provider helper functions that are part of the crate's
// public API even though the `provider` module itself is pub(crate).
pub use ;
pub use ;
pub use ;
pub use ;
pub use *;
/// Install the `ring` crypto provider as the rustls process default, idempotently.
///
/// rustls 0.23+ removed the implicit default provider. This function installs
/// `ring` once per process. Subsequent calls are no-ops. Calling it from a
/// downstream Rust app that has already installed `aws-lc-rs` is safe — the
/// `Err` from `install_default()` is silently ignored.
///
/// Called automatically by every internal `reqwest::Client` constructor
/// (auth providers, default HTTP client). Bindings and downstream consumers
/// reach those constructors transitively, so no manual init is required.
///
/// WASM builds are exempt — the WASM target uses the browser/Node.js fetch
/// API instead of rustls, so no crypto provider is needed.
///
/// Windows builds use native-tls (SChannel) via reqwest, so rustls is not
/// present and no crypto provider installation is needed.
/// No-op on Windows: reqwest uses native-tls (SChannel), so no rustls provider
/// installation is needed. All callers use the same call site regardless of
/// platform.