pub struct CustomProviderConfig {Show 26 fields
pub name: String,
pub display_name: String,
pub base_url: String,
pub api_format: CustomProviderApiFormat,
pub context_window: Option<usize>,
pub supports_tools: Option<bool>,
pub supports_reasoning: Option<bool>,
pub supports_reasoning_effort: Option<bool>,
pub supports_vision: Option<bool>,
pub supports_structured_output: Option<bool>,
pub supports_parallel_tool_calls: Option<bool>,
pub supports_context_caching: Option<bool>,
pub supports_responses_compaction: Option<bool>,
pub supports_context_edits: Option<bool>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<i32>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub max_tokens: Option<u32>,
pub reasoning_effort: Option<ReasoningEffortLevel>,
pub api_key_env: String,
pub auth: Option<CustomProviderCommandAuthConfig>,
pub model: String,
pub models: Vec<String>,
pub profiles: BTreeMap<String, CustomProviderProfileConfig>,
}Expand description
Configuration for a user-defined OpenAI-compatible provider endpoint.
Allows users to define multiple named custom endpoints (e.g., corporate proxies) with distinct display names, so they can toggle between them and clearly see which endpoint is active.
Fields§
§name: StringStable provider key used for routing and persistence (e.g., “mycorp”). Must be lowercase alphanumeric with optional hyphens/underscores.
display_name: StringHuman-friendly label shown in the TUI header, footer, and model picker (e.g., “MyCorporateName”).
base_url: StringBase URL of the OpenAI-compatible API endpoint
(e.g., <https://llm.corp.example/v1>). Non-empty custom providers
from repository-controlled workspace/project layers are rejected.
api_format: CustomProviderApiFormatTyped API format for the provider’s default profile.
context_window: Option<usize>Optional context window size in tokens for models served by this endpoint.
When omitted, the OpenAI-compatible provider uses its default context window size.
supports_tools: Option<bool>Optional support for tool calling.
supports_reasoning: Option<bool>Optional support for reasoning.
supports_reasoning_effort: Option<bool>Optional support for reasoning effort.
supports_vision: Option<bool>Optional support for vision inputs.
supports_structured_output: Option<bool>Optional support for structured output.
supports_parallel_tool_calls: Option<bool>Optional support for parallel tool calls.
supports_context_caching: Option<bool>Optional support for context caching.
supports_responses_compaction: Option<bool>Optional support for responses compaction.
supports_context_edits: Option<bool>Optional support for context edits.
temperature: Option<f32>Optional sampling temperature default (0.0-2.0) for models served by this endpoint unless a profile overrides it.
top_p: Option<f32>Optional nucleus-sampling default (0.0-1.0).
top_k: Option<i32>Optional top-k default (>= 0).
presence_penalty: Option<f32>Optional presence penalty default (-2.0-2.0).
frequency_penalty: Option<f32>Optional frequency penalty default (-2.0-2.0).
max_tokens: Option<u32>Optional max output tokens default (> 0).
reasoning_effort: Option<ReasoningEffortLevel>Optional reasoning effort default for models without a profile override.
api_key_env: StringEnvironment variable name that holds the API key for this endpoint (e.g., “MYCORP_API_KEY”).
auth: Option<CustomProviderCommandAuthConfig>Optional command-backed bearer token configuration.
model: StringDefault model to use with this endpoint (e.g., “gpt-5-mini”).
When models is empty, this single model is what the
/model picker offers for this provider. When models
is non-empty, this field is used as the default selection but the
picker lists every entry in models.
models: Vec<String>Optional list of additional model identifiers offered by the provider.
Useful for OpenAI-compatible aggregators such as Atlas Cloud that
expose many models behind a single endpoint. When set, the /model
picker shows one entry per model. When empty, the picker falls back to
the single model field.
profiles: BTreeMap<String, CustomProviderProfileConfig>Exact model-keyed sparse capability profiles.
Implementations§
Source§impl CustomProviderConfig
impl CustomProviderConfig
Sourcepub fn resolved_api_key_env(&self) -> String
pub fn resolved_api_key_env(&self) -> String
Resolve the API key environment variable used for this provider.
Falls back to a derived NAME_API_KEY-style variable when the config
does not set api_key_env.
pub fn uses_command_auth(&self) -> bool
Sourcepub fn effective_models(&self) -> Vec<String>
pub fn effective_models(&self) -> Vec<String>
Return the list of models the /model picker should offer for this
provider.
If models is non-empty, every entry is returned (trimmed). Otherwise
the single model field is returned as a one-element list. An empty
model field with no models list yields an empty result.
pub fn profile(&self, model: &str) -> Option<&CustomProviderProfileConfig>
pub fn resolved_profile(&self, model: &str) -> ResolvedCustomProviderProfile
pub fn provider_defaults_profile(&self) -> CustomProviderProfileConfig
Trait Implementations§
Source§impl Clone for CustomProviderConfig
impl Clone for CustomProviderConfig
Source§impl Debug for CustomProviderConfig
impl Debug for CustomProviderConfig
Source§impl Default for CustomProviderConfig
impl Default for CustomProviderConfig
Source§impl<'de> Deserialize<'de> for CustomProviderConfig
impl<'de> Deserialize<'de> for CustomProviderConfig
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>,
Source§impl JsonSchema for CustomProviderConfig
impl JsonSchema for CustomProviderConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more