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
//! # llm-trait
//!
//! Trait definitions and core types for LLM providers.
//!
//! This crate is the **interface layer**: the traits and types that both
//! `llm-unified` (implementations) and consumer applications (runtimes, CLIs,
//! servers) depend on. Depending on this crate alone is enough to accept and
//! call a provider without pulling in any vendor adapter, the model registry,
//! or the CLI.
//!
//! It is not dependency-free: [`ReqwestHttpClient`] is the default transport, so
//! reqwest and its TLS stack come along. That trade-off is what lets adapters be
//! unit-tested against a mocked [`HttpClient`] without a second crate in the
//! dependency graph.
//!
//! ## Architecture
//!
//! ```text
//! ┌──────────────────────────┐ ┌──────────────────────────┐
//! │ llm-unified │ │ your app │
//! │ (implementation) │ │ (runtime) │
//! └──────────┬───────────────┘ └──────────┬───────────────┘
//! │ │
//! │ depends on │ depends on
//! ▼ ▼
//! ┌──────────────────────────────────────────────────────────┐
//! │ llm-trait (this crate) │
//! │ LlmProvider trait, RawAdapter trait, core types │
//! └──────────────────────────────────────────────────────────┘
//! ```
//!
//! ## Quick Start
//!
//! ```
//! use llm_trait::{LlmConfig, LlmProvider, ChatRequest, ChatMessage};
//! ```
// Re-export key types at crate root for convenience.
pub use Protocol;
pub use ;
pub use LlmConfig;
pub use LlmError;
pub use ;
pub use ;
pub use LlmProvider;
pub use ;
pub use ;
pub use ;
pub use ;
pub use UsageInfo;