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
use async_trait;
/// Pluggable LLM backend.
///
/// All analysis primitives in this crate (`analyze_email`, `classify_spam`,
/// `generate_embedding`, …) take `&dyn LlmProvider` so the caller is the one
/// who chooses *which* model handles *which* request — making small-core vs
/// big-core decisions explicit and grep-auditable in the consumer code.
///
/// A reference implementation backed by an OpenAI-compatible HTTP endpoint
/// is provided as [`crate::OpenAiCompatibleProvider`] under the default
/// `http` feature. To plug in another backend, implement this trait yourself
/// and disable the `http` feature.