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
//! Chat with bunsen's Qwen3 ([`bunsen::kits::language::generation::qwen3`]),
//! Gemma ([`bunsen::kits::language::generation::gemma`]) or nanochat
//! ([`bunsen::kits::language::generation::nanochat`]): what turns a
//! conversation into the ids the model reads and its ids back into text, and
//! the driver that holds a conversation on the KV cache.
//!
//! - [`ChatModel`] and [`ChatSession`]: the shared, immutable half of a chat (a
//! loaded checkpoint and its files) and one conversation (its messages and
//! the cache that holds them), over a [`ChatBackend`]: the checkpoint's
//! model, and what turns a conversation into its ids and its ids into text
//! ([`LmChat`], a stacked language model's: [`Qwen3Chat`], [`GemmaChat`],
//! [`Qwen3_5Chat`]). [`send`](ChatSession::send) streams a reply through
//! [`decode_cached_observed`](bunsen::kits::support::decoding::decode_cached_observed),
//! and prefills only what the cache does not already hold.
//! - [`search_config`]: the search a checkpoint's generation policy says.
//! - Every family's tokenizer is a
//! [`BunsenTokenizer`](bunsen::kits::support::tokens::BunsenTokenizer):
//! Qwen3's and Gemma's from their `tokenizer.json`, nanochat's from its
//! `tokenizer.pkl`; a chat holds it as a
//! [`Tokenizer`](bunsen::kits::support::tokens::Tokenizer).
//! - [`ChatTemplate`] and [`ChatMessage`]: a checkpoint's chat template, a
//! conversation rendered as `transformers` renders it.
//! - [`NanoChatChat`] and [`NanoChatLayout`]: a nanochat checkpoint's chat,
//! through its tokenizer, and upstream's conversation layout, as upstream
//! renders it.
//!
//! - [`choose_checkpoint`]: the checkpoint a command chooses, by its `--model`s
//! and its stage and preset flags, among every family's builds in the
//! built-in catalog (or one family's) ([`chat_selection`]: the defaults, and
//! each family's `default`).
//!
//! `bunsen-tool chat` runs them. Its `list`, `fetch`, `run` and `repl` take
//! a checkpoint of any family by its name; `family qwen3`, `family gemma`
//! and `family nanochat` have the same commands for one family, its own
//! default by default, with only the flags that apply to it:
//!
//! ```text
//! bunsen-tool chat list
//! bunsen-tool cache list qwen3
//! bunsen-tool chat run --device wgpu --no-think "What is the capital of France?"
//! bunsen-tool chat repl --device wgpu --model qwen3-4b-instruct-2507 --stats
//! bunsen-tool chat family nanochat list --urls
//! bunsen-tool chat family nanochat repl --device cuda
//! ```
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;