pub struct BitrouterConfig {
pub server: ServerConfig,
pub database: DatabaseConfig,
pub guardrails: GuardrailConfig,
pub solana_rpc_url: Option<String>,
pub mpp: Option<MppConfig>,
pub wallet: Option<WalletConfig>,
pub inherit_defaults: bool,
pub providers: HashMap<String, ProviderConfig>,
pub models: HashMap<String, ModelConfig>,
pub tools: HashMap<String, ToolConfig>,
pub agents: HashMap<String, AgentConfig>,
pub routing: HashMap<String, RoutingRuleConfig>,
}Expand description
Root configuration file, typically bitrouter.yaml.
Fields§
§server: ServerConfig§database: DatabaseConfigDatabase configuration.
guardrails: GuardrailConfigGuardrails configuration — content inspection firewall for AI traffic.
solana_rpc_url: Option<String>Solana RPC endpoint used for Swig wallet operations.
mpp: Option<MppConfig>MPP (Machine Payment Protocol) configuration.
wallet: Option<WalletConfig>OWS (Open Wallet Standard) wallet configuration.
When set, the OWS wallet is used for policy-gated signing in place
of raw private keys. Requires the wallet-ows feature.
inherit_defaults: boolWhen true (the default), built-in provider definitions are merged
into the provider set before user overrides are applied. Set to
false to use only the providers declared in the config file.
providers: HashMap<String, ProviderConfig>Provider definitions (merged on top of built-in providers).
models: HashMap<String, ModelConfig>Model routing definitions.
tools: HashMap<String, ToolConfig>Tool routing definitions.
agents: HashMap<String, AgentConfig>Agent definitions (ACP-compatible coding agents).
routing: HashMap<String, RoutingRuleConfig>Content-based auto-routing rules.
Each key is a virtual model name (e.g. "auto") that triggers
content-aware classification when a request targets it. The rule
maps detected signals and complexity levels to concrete model names
defined in the models section.
Implementations§
Source§impl BitrouterConfig
impl BitrouterConfig
Sourcepub fn has_configured_providers(&self) -> bool
pub fn has_configured_providers(&self) -> bool
Returns true if at least one provider has an API key configured.
Sourcepub fn configured_provider_names(&self) -> Vec<String>
pub fn configured_provider_names(&self) -> Vec<String>
Returns the names of providers that have API keys configured.
Sourcepub fn load_from_file(path: &Path, env_file: Option<&Path>) -> Result<Self>
pub fn load_from_file(path: &Path, env_file: Option<&Path>) -> Result<Self>
Full config loading pipeline:
- Read and parse YAML
- Load
.envfile (provided externally by the runtime) - Substitute
${VAR}references in all string values - Merge user providers on top of the built-in registry
- Resolve
deriveschains - Apply
env_prefixauto-overrides
Trait Implementations§
Source§impl Clone for BitrouterConfig
impl Clone for BitrouterConfig
Source§fn clone(&self) -> BitrouterConfig
fn clone(&self) -> BitrouterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BitrouterConfig
impl Debug for BitrouterConfig
Source§impl Default for BitrouterConfig
impl Default for BitrouterConfig
Source§fn default() -> BitrouterConfig
fn default() -> BitrouterConfig
Source§impl<'de> Deserialize<'de> for BitrouterConfig
impl<'de> Deserialize<'de> for BitrouterConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for BitrouterConfig
impl RefUnwindSafe for BitrouterConfig
impl Send for BitrouterConfig
impl Sync for BitrouterConfig
impl Unpin for BitrouterConfig
impl UnsafeUnpin for BitrouterConfig
impl UnwindSafe for BitrouterConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more