pub struct Config {Show 29 fields
pub default_model: String,
pub default_embedding_model: String,
pub default_image_model: String,
pub default_judgment_model: String,
pub default_speech_model: String,
pub default_transcription_model: String,
pub default_moderation_model: String,
pub default_ocr_model: String,
pub default_video_model: String,
pub video_generation_timeout: Duration,
pub video_generation_poll_interval: Duration,
pub request_timeout: Duration,
pub max_retries: u32,
pub retry_interval: f64,
pub retry_backoff_factor: f64,
pub retry_interval_randomness: f64,
pub retry_max_interval: f64,
pub http_proxy: Option<String>,
pub tool_concurrency: bool,
pub auto_upload_large_files: bool,
pub instrumenter: Option<Arc<dyn Instrumenter>>,
pub model_registry_file: Option<PathBuf>,
pub model_registry_store: Option<Arc<dyn ModelRegistryStore>>,
pub prompt_roots: Vec<PathBuf>,
pub mcp_credential_store: Option<Arc<dyn CredentialStore>>,
pub mcp_client_name: String,
pub mcp_client_id: Option<String>,
pub batch_store: Option<Arc<dyn BatchStore>>,
pub usage_ledger: Option<Arc<dyn UsageLedger>>,
/* private fields */
}Expand description
RubyLLM::Configuration. Provider keys live in values under RubyLLM’s option names
(openai_api_key, anthropic_api_base, …) so every provider reads its settings the same way.
Fields§
§default_model: String§default_embedding_model: String§default_image_model: Stringdefault_image_model: the model rust_llm::paint uses when none is given.
default_judgment_model: Stringdefault_judgment_model: what judge uses; judges never fall back to the chat model.
default_speech_model: Stringdefault_speech_model: what rust_llm::speak uses when no model is given.
default_transcription_model: Stringdefault_transcription_model: what rust_llm::transcribe uses when no model is given.
default_moderation_model: Stringdefault_moderation_model: what rust_llm::moderate uses when no model is given.
default_ocr_model: Stringdefault_ocr_model: what rust_llm::ocr uses when no model is given.
default_video_model: Stringdefault_video_model: what rust_llm::animate uses when no model is given.
video_generation_timeout: Durationvideo_generation_timeout: how long VideoJob::wait polls before giving up.
video_generation_poll_interval: Durationvideo_generation_poll_interval: the pause between VideoJob::wait polls.
request_timeout: Duration§max_retries: u32§retry_interval: f64§retry_backoff_factor: f64§retry_interval_randomness: f64§retry_max_interval: f64§http_proxy: Option<String>http_proxy: proxy URL for every request (Connection.basic and provider connections).
tool_concurrency: bool§auto_upload_large_files: boolauto_upload_large_files: upload oversized local attachments to the provider’s Files API.
instrumenter: Option<Arc<dyn Instrumenter>>instrumenter: receives every *.rust_llm event (rust_llm::instrumentation).
model_registry_file: Option<PathBuf>model_registry_file: where Models::refresh saves the registry and where the registry
loads from before falling back to the bundled copy. None keeps it in memory only.
model_registry_store: Option<Arc<dyn ModelRegistryStore>>model_registry_store: where the registry lives instead of model_registry_file, such as
an application’s database (rust_llm::models::registry::ModelRegistryStore).
prompt_roots: Vec<PathBuf>Prompt.roots: the directories render_prompt searches after app/prompts, in order.
mcp_credential_store: Option<Arc<dyn CredentialStore>>mcp_credential_store: where MCP OAuth credentials live. None keeps them in memory;
rust_llm_loco::McpCredentialStore keeps them in rust_llm_mcp_credentials.
mcp_client_name: Stringmcp_client_name: the client name given when registering with an MCP server’s
authorization server. RubyLLM says "RubyLLM"; the port says "RustLLM".
mcp_client_id: Option<String>mcp_client_id: the HTTPS URL of your OAuth client metadata document, used instead of
registering by authorization servers that support client ID metadata documents.
batch_store: Option<Arc<dyn BatchStore>>batch_store: where submitted chat batches are persisted, so Batch::find can hand one
back without contacting the provider. None keeps nothing (crate::batch::BatchStore).
usage_ledger: Option<Arc<dyn UsageLedger>>Accounting::Usage.ledger: where attempts no chat records are persisted (one-shot
operations, finished video jobs, chats without a record). None keeps them in memory
(crate::accounting::UsageLedger).
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Config
pub fn from_env() -> Config
Defaults plus any OPENAI_API_KEY-style variables present in the environment.