Trait CompatFamilySpec
pub trait CompatFamilySpec {
const DISPLAY: &'static str;
const DEFAULT_URL: &'static str;
const AUTH: AuthStyle;
const FALLBACK_ALLOWS_MISSING_API_KEY: bool = false;
const MODELS_DEV_KEY: Option<&'static str> = None;
const OPENROUTER_VENDOR_PREFIX: Option<&'static str> = None;
const PUBLIC_MODEL_LISTING: bool = false;
// Provided methods
fn wire_api(&self) -> Option<WireApi> { ... }
fn build_compat_base(
&self,
alias: &str,
key: Option<&str>,
api_url: Option<&str>,
) -> OpenAiCompatibleBuilder { ... }
fn build_compat(
&self,
alias: &str,
key: Option<&str>,
api_url: Option<&str>,
) -> OpenAiCompatibleBuilder { ... }
}Expand description
Spec trait for OpenAI-compatible families. Implementing this gives a
FamilyProviderFactory impl for free via the blanket below.
Override CompatFamilySpec::build_compat when the family needs minor
modifiers (e.g. .without_native_tools()); otherwise the default
OpenAiCompatibleModelProvider::builder entry point is used.
Required Associated Constants§
Provided Associated Constants§
const FALLBACK_ALLOWS_MISSING_API_KEY: bool = false
const MODELS_DEV_KEY: Option<&'static str> = None
Sourceconst OPENROUTER_VENDOR_PREFIX: Option<&'static str> = None
const OPENROUTER_VENDOR_PREFIX: Option<&'static str> = None
OpenRouter vendor prefix used by list_models as a last-resort
fallback when this family has no models.dev entry and no live
credential. None when no OpenRouter prefix exists for this family
(e.g. Sambanova, Hyperbolic — no public catalog at all without a key).
const PUBLIC_MODEL_LISTING: bool = false
Provided Methods§
fn wire_api(&self) -> Option<WireApi>
Sourcefn build_compat_base(
&self,
alias: &str,
key: Option<&str>,
api_url: Option<&str>,
) -> OpenAiCompatibleBuilder
fn build_compat_base( &self, alias: &str, key: Option<&str>, api_url: Option<&str>, ) -> OpenAiCompatibleBuilder
Build the base compat provider with both catalog consts applied. Use
this from inside build_compat overrides so the catalog hooks ride
along with any family-specific modifiers.
Sourcefn build_compat(
&self,
alias: &str,
key: Option<&str>,
api_url: Option<&str>,
) -> OpenAiCompatibleBuilder
fn build_compat( &self, alias: &str, key: Option<&str>, api_url: Option<&str>, ) -> OpenAiCompatibleBuilder
Build the underlying compat provider builder. Default just returns the
base from build_compat_base; override to chain family-specific
modifiers (e.g. .without_native_tools(), .merge_system_into_user_preserving_native()).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.