Skip to main content

ProviderConfig

Struct ProviderConfig 

Source
pub struct ProviderConfig {
Show 23 fields pub vendor: Option<String>, pub api_key: Option<String>, pub base_url: Option<String>, pub model: Option<String>, pub context_window: Option<u32>, pub model_context_windows: Option<BTreeMap<String, u32>>, pub mode: Option<String>, pub wire: Option<String>, pub responses_profile: Option<String>, pub auth_mode: Option<String>, pub oauth: Option<PluginOAuthConfig>, pub oauth_credential_generation: Option<String>, pub insecure_skip_tls_verify: Option<bool>, pub allow_insecure_http: Option<bool>, pub http_headers: Option<HashMap<String, String>>, pub path_suffix: Option<String>, pub reasoning_stream_style: Option<String>, pub max_concurrency: Option<usize>, pub auth: Option<ProviderAuthSourceToml>, pub external_credentials: Option<ExternalCredentialConsentToml>, pub kind: Option<String>, pub plugin_authority: Option<PluginAuthority>, pub api_key_env: Option<String>,
}

Fields§

§vendor: Option<String>

OpenRouter upstream slug; disables upstream fallbacks when set.

§api_key: Option<String>§base_url: Option<String>§model: Option<String>§context_window: Option<u32>§model_context_windows: Option<BTreeMap<String, u32>>

Per-model context-window overrides keyed by exact wire model id ([providers.<name>.model_context_windows], #6108). A matching entry wins over this provider’s context_window for that model only, so one gateway can front models with heterogeneous windows.

§mode: Option<String>§wire: Option<String>

Dual-wire dialect toggle: openai (default) or anthropic. Not a separate catalog provider — config only (DeepSeek / MiniMax / Model Studio).

§responses_profile: Option<String>

Responses dialect for a custom table whose wire is responses.

§auth_mode: Option<String>§oauth: Option<PluginOAuthConfig>

Core-owned public-client OAuth descriptor for a named plugin provider.

§oauth_credential_generation: Option<String>

Validated basename of the active Codewhale-owned xAI OAuth generation. The file always lives below Codewhale’s private credentials directory.

§insecure_skip_tls_verify: Option<bool>§allow_insecure_http: Option<bool>

Per-provider consent to a plain-HTTP base_url (#5991). Loopback is always allowed without it.

§http_headers: Option<HashMap<String, String>>§path_suffix: Option<String>§reasoning_stream_style: Option<String>§max_concurrency: Option<usize>§auth: Option<ProviderAuthSourceToml>§external_credentials: Option<ExternalCredentialConsentToml>

Explicit, provider-scoped consent for one credential file owned by another CLI. Absence is the disabled default.

§kind: Option<String>

Wire-protocol selector for a custom [providers.<name>] entry (#1519).

Only "openai-compatible" is accepted for now; any other value is rejected at selection time so unsupported wire formats fail loudly rather than silently routing as OpenAI. Built-in providers leave this unset.

§plugin_authority: Option<PluginAuthority>

Runtime-only receipt; a config file cannot manufacture plugin authority.

§api_key_env: Option<String>

Name of the environment variable holding this custom provider’s API key (#1519), e.g. api_key_env = "EXAMPLE_API_KEY". The key value itself is never stored in config; only the env var name is.

Implementations§

Source§

impl ProviderConfig

Source

pub fn is_openai_compatible_custom(&self) -> bool

True when this entry selects the OpenAI-compatible custom wire protocol.

kind is matched case-insensitively against openai-compatible (and the openai_compatible underscore spelling). Returns false when kind is unset (built-in providers) or names any other value.

Trait Implementations§

Source§

impl Clone for ProviderConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProviderConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProviderConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ProviderConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ProviderConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more