pub struct Preset {
pub id: &'static str,
pub prefix: &'static str,
pub key_envs: &'static [&'static str],
pub base_envs: &'static [&'static str],
pub default_base_url: Option<&'static str>,
pub flavor: Flavor,
pub models: &'static [PresetModel],
pub no_auth: bool,
pub oauth_subscription: bool,
pub discover: bool,
}Expand description
One upstream provider/gateway.
Fields§
§id: &'static strShort stable id, used as a prefix in infinity model ids
(<id>/<model>), e.g. groq/llama-3.3-70b-versatile.
prefix: &'static strEnv prefix for <PREFIX>_BASE_URL / <PREFIX>_MODELS overrides.
key_envs: &'static [&'static str]API-key env vars (first one set wins). Empty = no key needed (local).
base_envs: &'static [&'static str]Extra env vars honored for the base URL (besides <PREFIX>_BASE_URL).
default_base_url: Option<&'static str>Default base URL when no override is set.
flavor: Flavor§models: &'static [PresetModel]§no_auth: boolWhether the endpoint needs no auth (local servers).
oauth_subscription: boolWhether this preset uses Claude subscription OAuth (see oauth).
discover: boolAdvertise the endpoint’s live model list by default (in addition to
the curated catalog). Local servers always discover; cloud backends
can also opt in per backend with <PREFIX>_DISCOVER=1.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Preset
impl Freeze for Preset
impl RefUnwindSafe for Preset
impl Send for Preset
impl Sync for Preset
impl Unpin for Preset
impl UnsafeUnpin for Preset
impl UnwindSafe for Preset
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
Mutably borrows from an owned value. Read more