pub struct AresConfig {Show 13 fields
pub server: ServerConfig,
pub auth: AuthConfig,
pub database: DatabaseConfig,
pub nvidia: Option<NvidiaConfig>,
pub providers: HashMap<String, ProviderConfig>,
pub models: HashMap<String, ModelConfig>,
pub tools: HashMap<String, ToolConfig>,
pub agents: HashMap<String, AgentConfig>,
pub workflows: HashMap<String, WorkflowConfig>,
pub rag: RagConfig,
pub billing: BillingConfig,
pub skills: Option<SkillsTomlConfig>,
pub config: DynamicConfigPaths,
}Expand description
Root configuration structure loaded from ares.toml
Fields§
§server: ServerConfigHTTP server configuration (host, port, log level).
auth: AuthConfigAuthentication configuration (JWT secrets, expiry times).
database: DatabaseConfigDatabase configuration (Turso/SQLite, Qdrant).
nvidia: Option<NvidiaConfig>NVIDIA provider + catalog configuration. When present, the runtime
fetches the model catalog from models_url (default: NVIDIA NIM) and
exposes it through the provider registry. If absent, the registry
uses built-in defaults.
providers: HashMap<String, ProviderConfig>Named LLM provider configurations
models: HashMap<String, ModelConfig>Named model configurations that reference providers NOTE: These are being migrated to TOON files in config/models/
tools: HashMap<String, ToolConfig>Tool configurations NOTE: These are being migrated to TOON files in config/tools/
agents: HashMap<String, AgentConfig>Agent configurations NOTE: These are being migrated to TOON files in config/agents/
workflows: HashMap<String, WorkflowConfig>Workflow configurations NOTE: These are being migrated to TOON files in config/workflows/
rag: RagConfigRAG configuration
billing: BillingConfigBilling and cost-estimation configuration
skills: Option<SkillsTomlConfig>Skills configuration (SKILL.md discovery directories)
config: DynamicConfigPathsDynamic configuration paths (TOON files)
Implementations§
Source§impl AresConfig
impl AresConfig
Sourcepub fn load<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
Load configuration from a TOML file
§Panics
Panics if the configuration file doesn’t exist or is invalid. This is intentional - the server cannot run without a valid config.
Sourcepub fn load_unchecked<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
pub fn load_unchecked<P: AsRef<Path>>(path: P) -> Result<Self, ConfigError>
Load configuration from a TOML file without validation.
This is useful for CLI commands that only need to inspect the configuration
without actually running the server (e.g., ares-server config).
Environment variables are not checked.
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate the configuration for internal consistency and env var availability
Sourcepub fn validate_with_warnings(&self) -> Result<Vec<ConfigWarning>, ConfigError>
pub fn validate_with_warnings(&self) -> Result<Vec<ConfigWarning>, ConfigError>
Validate configuration with warnings for unused items
Returns Ok with warnings, or Err if validation fails
Sourcepub fn resolve_env(&self, env_name: &str) -> Option<String>
pub fn resolve_env(&self, env_name: &str) -> Option<String>
Get a resolved value from an env var reference
Sourcepub fn mcp_client_names(&self) -> Vec<String>
pub fn mcp_client_names(&self) -> Vec<String>
Get the JWT secret from the environment
§Errors
Returns an error if:
- The environment variable is not set
- The secret is shorter than 32 characters (256 bits)
Get names of configured MCP clients (from mcps directory .toon files). Used by validation to allow MCP bridge tool names in agent configs.
pub fn jwt_secret(&self) -> Result<String, ConfigError>
Sourcepub fn api_key(&self) -> Result<String, ConfigError>
pub fn api_key(&self) -> Result<String, ConfigError>
Get the API key from the environment
Sourcepub fn get_provider(&self, name: &str) -> Option<&ProviderConfig>
pub fn get_provider(&self, name: &str) -> Option<&ProviderConfig>
Get provider by name
Sourcepub fn get_model(&self, name: &str) -> Option<&ModelConfig>
pub fn get_model(&self, name: &str) -> Option<&ModelConfig>
Get model by name
Sourcepub fn get_agent(&self, name: &str) -> Option<&AgentConfig>
pub fn get_agent(&self, name: &str) -> Option<&AgentConfig>
Get agent config by name
Sourcepub fn get_tool(&self, name: &str) -> Option<&ToolConfig>
pub fn get_tool(&self, name: &str) -> Option<&ToolConfig>
Get tool config by name
Sourcepub fn get_workflow(&self, name: &str) -> Option<&WorkflowConfig>
pub fn get_workflow(&self, name: &str) -> Option<&WorkflowConfig>
Get workflow config by name
Sourcepub fn enabled_tools(&self) -> Vec<&str>
pub fn enabled_tools(&self) -> Vec<&str>
Get all enabled tools
Sourcepub fn agent_tools(&self, agent_name: &str) -> Vec<&str>
pub fn agent_tools(&self, agent_name: &str) -> Vec<&str>
Get all tools for an agent
Trait Implementations§
Source§impl Clone for AresConfig
impl Clone for AresConfig
Source§fn clone(&self) -> AresConfig
fn clone(&self) -> AresConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AresConfig
impl Debug for AresConfig
Source§impl<'de> Deserialize<'de> for AresConfig
impl<'de> Deserialize<'de> for AresConfig
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 AresConfig
impl RefUnwindSafe for AresConfig
impl Send for AresConfig
impl Sync for AresConfig
impl Unpin for AresConfig
impl UnsafeUnpin for AresConfig
impl UnwindSafe for AresConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreimpl<T> MaybeSendSync for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.