Skip to main content

ModelProviders

Struct ModelProviders 

pub struct ModelProviders {
Show 74 fields pub openai: HashMap<String, OpenAIModelProviderConfig>, pub azure: HashMap<String, AzureModelProviderConfig>, pub anthropic: HashMap<String, AnthropicModelProviderConfig>, pub moonshot: HashMap<String, MoonshotModelProviderConfig>, pub qwen: HashMap<String, QwenModelProviderConfig>, pub glm: HashMap<String, GlmModelProviderConfig>, pub minimax: HashMap<String, MinimaxModelProviderConfig>, pub zai: HashMap<String, ZaiModelProviderConfig>, pub doubao: HashMap<String, DoubaoModelProviderConfig>, pub yi: HashMap<String, YiModelProviderConfig>, pub hunyuan: HashMap<String, HunyuanModelProviderConfig>, pub qianfan: HashMap<String, QianfanModelProviderConfig>, pub baichuan: HashMap<String, BaichuanModelProviderConfig>, pub openrouter: HashMap<String, OpenRouterModelProviderConfig>, pub ollama: HashMap<String, OllamaModelProviderConfig>, pub gemini: HashMap<String, GeminiModelProviderConfig>, pub gemini_cli: HashMap<String, GeminiCliModelProviderConfig>, pub bedrock: HashMap<String, BedrockModelProviderConfig>, pub telnyx: HashMap<String, TelnyxModelProviderConfig>, pub together: HashMap<String, TogetherModelProviderConfig>, pub fireworks: HashMap<String, FireworksModelProviderConfig>, pub groq: HashMap<String, GroqModelProviderConfig>, pub mistral: HashMap<String, MistralModelProviderConfig>, pub deepseek: HashMap<String, DeepseekModelProviderConfig>, pub atomic_chat: HashMap<String, AtomicChatModelProviderConfig>, pub cohere: HashMap<String, CohereModelProviderConfig>, pub perplexity: HashMap<String, PerplexityModelProviderConfig>, pub xai: HashMap<String, XaiModelProviderConfig>, pub cerebras: HashMap<String, CerebrasModelProviderConfig>, pub sambanova: HashMap<String, SambanovaModelProviderConfig>, pub hyperbolic: HashMap<String, HyperbolicModelProviderConfig>, pub deepinfra: HashMap<String, DeepinfraModelProviderConfig>, pub huggingface: HashMap<String, HuggingfaceModelProviderConfig>, pub ai21: HashMap<String, Ai21ModelProviderConfig>, pub reka: HashMap<String, RekaModelProviderConfig>, pub baseten: HashMap<String, BasetenModelProviderConfig>, pub nscale: HashMap<String, NscaleModelProviderConfig>, pub anyscale: HashMap<String, AnyscaleModelProviderConfig>, pub nebius: HashMap<String, NebiusModelProviderConfig>, pub friendli: HashMap<String, FriendliModelProviderConfig>, pub stepfun: HashMap<String, StepfunModelProviderConfig>, pub aihubmix: HashMap<String, AihubmixModelProviderConfig>, pub siliconflow: HashMap<String, SiliconflowModelProviderConfig>, pub astrai: HashMap<String, AstraiModelProviderConfig>, pub avian: HashMap<String, AvianModelProviderConfig>, pub deepmyst: HashMap<String, DeepmystModelProviderConfig>, pub venice: HashMap<String, VeniceModelProviderConfig>, pub nearai: HashMap<String, NearaiModelProviderConfig>, pub novita: HashMap<String, NovitaModelProviderConfig>, pub nvidia: HashMap<String, NvidiaModelProviderConfig>, pub vercel: HashMap<String, VercelModelProviderConfig>, pub cloudflare: HashMap<String, CloudflareModelProviderConfig>, pub ovh: HashMap<String, OvhModelProviderConfig>, pub copilot: HashMap<String, CopilotModelProviderConfig>, pub lmstudio: HashMap<String, LmstudioModelProviderConfig>, pub llamacpp: HashMap<String, LlamacppModelProviderConfig>, pub sglang: HashMap<String, SglangModelProviderConfig>, pub vllm: HashMap<String, VllmModelProviderConfig>, pub osaurus: HashMap<String, OsaurusModelProviderConfig>, pub litellm: HashMap<String, LitellmModelProviderConfig>, pub lepton: HashMap<String, LeptonModelProviderConfig>, pub manifest: HashMap<String, ManifestModelProviderConfig>, pub morph: HashMap<String, MorphModelProviderConfig>, pub github_models: HashMap<String, GithubModelsModelProviderConfig>, pub upstage: HashMap<String, UpstageModelProviderConfig>, pub featherless: HashMap<String, FeatherlessModelProviderConfig>, pub arcee: HashMap<String, ArceeModelProviderConfig>, pub lambda_ai: HashMap<String, LambdaAiModelProviderConfig>, pub inception: HashMap<String, InceptionModelProviderConfig>, pub synthetic: HashMap<String, SyntheticModelProviderConfig>, pub opencode: HashMap<String, OpencodeModelProviderConfig>, pub kilocli: HashMap<String, KiloCliModelProviderConfig>, pub kilo: HashMap<String, KiloModelProviderConfig>, pub custom: HashMap<String, CustomModelProviderConfig>,
}
Expand description

Typed model provider container with one alias map per provider family.

Fields§

§openai: HashMap<String, OpenAIModelProviderConfig>§azure: HashMap<String, AzureModelProviderConfig>§anthropic: HashMap<String, AnthropicModelProviderConfig>§moonshot: HashMap<String, MoonshotModelProviderConfig>§qwen: HashMap<String, QwenModelProviderConfig>§glm: HashMap<String, GlmModelProviderConfig>§minimax: HashMap<String, MinimaxModelProviderConfig>§zai: HashMap<String, ZaiModelProviderConfig>§doubao: HashMap<String, DoubaoModelProviderConfig>§yi: HashMap<String, YiModelProviderConfig>§hunyuan: HashMap<String, HunyuanModelProviderConfig>§qianfan: HashMap<String, QianfanModelProviderConfig>§baichuan: HashMap<String, BaichuanModelProviderConfig>§openrouter: HashMap<String, OpenRouterModelProviderConfig>§ollama: HashMap<String, OllamaModelProviderConfig>§gemini: HashMap<String, GeminiModelProviderConfig>§gemini_cli: HashMap<String, GeminiCliModelProviderConfig>§bedrock: HashMap<String, BedrockModelProviderConfig>§telnyx: HashMap<String, TelnyxModelProviderConfig>§together: HashMap<String, TogetherModelProviderConfig>§fireworks: HashMap<String, FireworksModelProviderConfig>§groq: HashMap<String, GroqModelProviderConfig>§mistral: HashMap<String, MistralModelProviderConfig>§deepseek: HashMap<String, DeepseekModelProviderConfig>§atomic_chat: HashMap<String, AtomicChatModelProviderConfig>§cohere: HashMap<String, CohereModelProviderConfig>§perplexity: HashMap<String, PerplexityModelProviderConfig>§xai: HashMap<String, XaiModelProviderConfig>§cerebras: HashMap<String, CerebrasModelProviderConfig>§sambanova: HashMap<String, SambanovaModelProviderConfig>§hyperbolic: HashMap<String, HyperbolicModelProviderConfig>§deepinfra: HashMap<String, DeepinfraModelProviderConfig>§huggingface: HashMap<String, HuggingfaceModelProviderConfig>§ai21: HashMap<String, Ai21ModelProviderConfig>§reka: HashMap<String, RekaModelProviderConfig>§baseten: HashMap<String, BasetenModelProviderConfig>§nscale: HashMap<String, NscaleModelProviderConfig>§anyscale: HashMap<String, AnyscaleModelProviderConfig>§nebius: HashMap<String, NebiusModelProviderConfig>§friendli: HashMap<String, FriendliModelProviderConfig>§stepfun: HashMap<String, StepfunModelProviderConfig>§aihubmix: HashMap<String, AihubmixModelProviderConfig>§siliconflow: HashMap<String, SiliconflowModelProviderConfig>§astrai: HashMap<String, AstraiModelProviderConfig>§avian: HashMap<String, AvianModelProviderConfig>§deepmyst: HashMap<String, DeepmystModelProviderConfig>§venice: HashMap<String, VeniceModelProviderConfig>§nearai: HashMap<String, NearaiModelProviderConfig>§novita: HashMap<String, NovitaModelProviderConfig>§nvidia: HashMap<String, NvidiaModelProviderConfig>§vercel: HashMap<String, VercelModelProviderConfig>§cloudflare: HashMap<String, CloudflareModelProviderConfig>§ovh: HashMap<String, OvhModelProviderConfig>§copilot: HashMap<String, CopilotModelProviderConfig>§lmstudio: HashMap<String, LmstudioModelProviderConfig>§llamacpp: HashMap<String, LlamacppModelProviderConfig>§sglang: HashMap<String, SglangModelProviderConfig>§vllm: HashMap<String, VllmModelProviderConfig>§osaurus: HashMap<String, OsaurusModelProviderConfig>§litellm: HashMap<String, LitellmModelProviderConfig>§lepton: HashMap<String, LeptonModelProviderConfig>§manifest: HashMap<String, ManifestModelProviderConfig>§morph: HashMap<String, MorphModelProviderConfig>§github_models: HashMap<String, GithubModelsModelProviderConfig>§upstage: HashMap<String, UpstageModelProviderConfig>§featherless: HashMap<String, FeatherlessModelProviderConfig>§arcee: HashMap<String, ArceeModelProviderConfig>§lambda_ai: HashMap<String, LambdaAiModelProviderConfig>§inception: HashMap<String, InceptionModelProviderConfig>§synthetic: HashMap<String, SyntheticModelProviderConfig>§opencode: HashMap<String, OpencodeModelProviderConfig>§kilocli: HashMap<String, KiloCliModelProviderConfig>§kilo: HashMap<String, KiloModelProviderConfig>§custom: HashMap<String, CustomModelProviderConfig>

Implementations§

Source§

impl ModelProviders

Source

pub fn configurable_prefix() -> &'static str

Returns the #[prefix] value for this Configurable struct.

Source

pub fn secret_fields(&self) -> Vec<SecretFieldInfo>

Returns metadata about all #[secret] fields on this struct and nested children.

Source

pub fn secret_field_terminals() -> Vec<&'static str>

Source

pub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>

Encrypt all secret fields in place using the provided store.

Source

pub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>

Decrypt all secret fields in place using the provided store.

Source

pub fn set_secret(&mut self, name: &str, value: String) -> Result<(), Error>

Set a secret field by its full dotted name, dispatching to nested children.

Source

pub fn prop_fields(&self) -> Vec<PropFieldInfo>

Returns metadata about all property fields on this struct and nested children.

Source

pub fn get_prop(&self, name: &str) -> Result<String, Error>

Get a property value by its full dotted name, returning it as a display string.

Source

pub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<(), Error>

Set a property value by its full dotted name, parsing from string.

Source

pub fn prop_is_secret(name: &str) -> bool

Check if a property name refers to a secret field (static, no instance needed).

Source

pub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>

Instantiate None nested sections whose prefix matches. Returns the prefixes that were initialized.

Source

pub fn map_key_sections() -> Vec<MapKeySection>

Enumerate every map-keyed (HashMap<String, T>) and list-shaped (Vec<T>) section discoverable from this Configurable’s tree. The dashboard / CLI consume this to surface “+ Add” affordances without hardcoding the section list.

Source

pub fn nested_section_help(name: &str) -> Option<&'static str>

Help blurb for a #[nested] field on this struct, sourced from the field-level /// docstring. Returns None for unknown names so callers can fall through to a different lookup.

Source

pub fn nested_section_group(name: &str) -> Option<&'static str>

Source

pub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>

Return the current alias keys at section_path, or None if the path doesn’t resolve to a map-keyed section in this tree.

Source

pub fn nested_option_entries(&self) -> Vec<NestedOptionEntry>

Source

pub fn create_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>

Source

pub fn delete_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>

Source

pub fn rename_map_key( &mut self, section_path: &str, map_key: &str, new_key: &str, ) -> Result<bool, String>

Source§

impl ModelProviders

Source

pub fn iter_entries( &self, ) -> impl Iterator<Item = (&'static str, &str, &ModelProviderConfig)>

Source

pub fn iter_entries_mut( &mut self, ) -> impl Iterator<Item = (&'static str, &str, &mut ModelProviderConfig)>

Iterate every entry mutably across every typed slot.

Source

pub fn resolved_endpoint_uri( &self, family: &str, alias: &str, ) -> Option<&'static str>

Resolve the family-default endpoint URI for <family>.<alias>. Returns None when the family is single-endpoint, unknown, or the alias is missing. Dispatch is generated by for_each_model_provider_slot!, so adding a family without a FamilyEndpoint impl is a compile error.

Source

pub fn find(&self, family: &str, alias: &str) -> Option<&ModelProviderConfig>

Look up the shared base config for a given <provider_type>.<alias> pair. Returns None when the family isn’t recognized OR when the alias doesn’t exist in that family’s typed slot.

Source

pub fn find_by_name( &self, name: &str, ) -> Option<(&'static str, String, &ModelProviderConfig)>

Source

pub fn ensure( &mut self, family: &str, alias: &str, ) -> Option<&mut ModelProviderConfig>

Source

pub fn contains_model_provider_type(&self, family: &str) -> bool

True when family’s typed slot has at least one configured alias entry. Returns false for unknown families.

Source

pub fn aliases_of<'a>( &'a self, family: &str, ) -> Box<dyn Iterator<Item = &'a str> + 'a>

Iterate the alias keys for a given model_provider type. Returns an empty iterator for unknown model_provider types.

Source

pub fn slot_names() -> &'static [&'static str]

Canonical family slot names, straight from for_each_model_provider_slot!. Use this to distinguish “unknown family” from “known family, missing alias” in validation messages, and to detect raw-TOML sections that deserialization silently drops.

Source

pub fn remove_alias(&mut self, family: &str, alias: &str) -> bool

Remove the entry for <provider_type>.<alias>, returning whether it existed. Returns false for unknown families.

Source

pub fn is_empty(&self) -> bool

True when no slot has any entry.

Source

pub fn len(&self) -> usize

Total number of (provider_type, alias) entries across all slots.

Trait Implementations§

Source§

impl Clone for ModelProviders

Source§

fn clone(&self) -> ModelProviders

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelProviders

Source§

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

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

impl Default for ModelProviders

Source§

fn default() -> ModelProviders

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

impl<'de> Deserialize<'de> for ModelProviders

Source§

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

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

impl JsonSchema for ModelProviders

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl MaskSecrets for ModelProviders

Source§

impl Serialize for ModelProviders

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::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<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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

§

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

Source§

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

§

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