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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//! Universal LLM API client with provider-agnostic chat, embeddings, files,
//! batches, responses, image generation, transcription, moderation, OCR,
//! rerank, and web-search across 143 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.
/// Pluggable cache key derivation strategies ([`CacheKeyStrategy`], built-in impls).
/// High-level LLM client traits and the reqwest-backed [`client::DefaultClient`].
/// Token-cost tracking helpers.
/// Embedding provider abstraction ([`EmbeddingProvider`], [`SelfHostedEmbeddingProvider`]).
/// Public error types and the crate-wide [`Result`] alias.
/// Vendor-neutral guardrail plugin system (trait, stage enum, registry, built-in primitives).
pub
/// Canonical per-request usage events and pluggable sinks.
/// Provider catalog (built-in providers plus runtime registration of custom providers).
/// Unified Realtime API event schema and per-provider translator trait.
/// Ingress/egress streaming pipeline with zero-copy passthrough optimisation.
///
/// Exposes [`streaming::IngressStream`], [`streaming::StreamPipeline`], and
/// [`streaming::EgressStream`] for composing streaming request pipelines with
/// optional per-chunk middleware and end-to-end cancellation.
/// Generic multi-tenant primitives: [`tenant::TenantId`], [`tenant::TenantContext`],
/// [`tenant::KeyResolver`], and [`tenant::InMemoryKeyResolver`].
/// Tokenizer helpers for measuring prompt and completion lengths.
/// `tower` middleware layers (rate limiting, retries, observability).
/// Request/response DTOs shared across providers and bindings.
/// Shared utility helpers (memory-bound guards, etc.).
/// Vector store abstraction for the semantic cache tier ([`VectorStore`], [`InMemoryVectorStore`]).
// Re-export key types at crate root.
pub use ;
// Batch polling helpers: WaitForBatchConfig and BatchWaitError are Tier C
// (binding-public) — users call wait_for_batch from every language binding.
pub use ;
pub use TransportConfig;
// 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 ;
// Cache key strategies and vector store / embedding / guardrail abstractions
// are surfaced at the crate root so bindings and application code can import
// them without spelling out the full `tower::` path.
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 *;
// Realtime API public surface.
pub use ;
/// Tenant primitives re-exported at the crate root.
///
/// Importers can write `liter_llm::TenantId` without spelling out the
/// `tenant::` path.
///
/// # Example
///
/// ```
/// let id = liter_llm::TenantId::from("acme-corp");
/// assert_eq!(id.as_ref(), "acme-corp");
/// ```
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 after
/// another rustls crypto provider has already been installed 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.