pub struct CustomProviderConfig {
pub name: String,
pub display_name: String,
pub base_url: String,
pub api_key_env: String,
pub auth: Option<CustomProviderCommandAuthConfig>,
pub model: String,
pub models: Vec<String>,
}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>).
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.
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.
Trait Implementations§
Source§impl Clone for CustomProviderConfig
impl Clone for CustomProviderConfig
Source§fn clone(&self) -> CustomProviderConfig
fn clone(&self) -> CustomProviderConfig
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 CustomProviderConfig
impl Debug for CustomProviderConfig
Source§impl Default for CustomProviderConfig
impl Default for CustomProviderConfig
Source§fn default() -> CustomProviderConfig
fn default() -> 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 moreAuto Trait Implementations§
impl Freeze for CustomProviderConfig
impl RefUnwindSafe for CustomProviderConfig
impl Send for CustomProviderConfig
impl Sync for CustomProviderConfig
impl Unpin for CustomProviderConfig
impl UnsafeUnpin for CustomProviderConfig
impl UnwindSafe for CustomProviderConfig
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