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
use Receiver;
use Result;
use cratecomplete_then_stream;
use crate::;
/// A pluggable connection to one model backend.
///
/// This is the entire surface `kopitiam-workflow` is allowed to see of a
/// model — per the Semantic Runtime's dependency rule ("nothing below
/// `kopitiam-workflow` may depend on `kopitiam-ai`"), this trait is the
/// only place a model gets invoked from anywhere in the platform. Concrete
/// adapters (local Qwen — see `kopitiam-082`, Claude, GPT, Gemini) live
/// behind this trait so workflows are never written against one vendor.
///
/// Implementations should be cheap to construct and treat `complete` as the
/// only place that does real (possibly networked, possibly slow) work —
/// `kopitiam-workflow` decides *whether* to call a model at all, following
/// the Offline First pipeline (existing knowledge, then native Rust, then
/// local AI, then cloud AI as the final fallback).