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
//! Provider abstraction and per-agent model routing.
//!
//! Why: trusty-code routes each agent to its own model, which may live behind
//! different backends (OpenRouter today, AWS Bedrock later). The agent loop must
//! not branch on the backend; it depends on the [`Provider`] trait and asks a
//! factory for the right implementation given a model slug. This module is that
//! seam (#1021) and the precedence resolver for which slug to use.
//! What: Re-exports the [`Provider`] trait and [`ToolChoice`] enum, the five
//! concrete providers ([`OpenRouterProvider`], [`BedrockProvider`],
//! [`FireworksProvider`], [`TogetherProvider`], [`AtlasCloudProvider`]), the
//! [`provider_for`] factory, the [`resolve_model`] precedence function plus
//! its [`DEFAULT_MODEL`] constant, the [`resolve_max_tokens`] precedence
//! function plus its [`DEFAULT_MAX_TOKENS`] constant, and (#2207) the
//! [`resolve_deadline_secs`] precedence function plus its
//! [`DEFAULT_RUN_DEADLINE_SECS`] constant and [`RUN_DEADLINE_ENV_VAR`] name,
//! and (#2308) the [`resolve_context_window`] precedence function plus its
//! [`DEFAULT_CONTEXT_WINDOW`] constant.
//! Test: submodule `tests` in each file; routing/adapter coverage in
//! `routing.rs` and `adapter.rs`.
pub use provider_for;
pub use AtlasCloudProvider;
pub use BedrockProvider;
pub use FireworksProvider;
pub use OpenRouterProvider;
pub use ;
pub use TogetherProvider;
pub use ;