Skip to main content

CompatFamilySpec

Trait CompatFamilySpec 

Source
pub trait CompatFamilySpec {
    const DISPLAY: &'static str;
    const DEFAULT_URL: &'static str;
    const AUTH: AuthStyle;
    const MODELS_DEV_KEY: Option<&'static str> = None;
    const OPENROUTER_VENDOR_PREFIX: Option<&'static str> = None;

    // Provided methods
    fn build_compat_base(
        &self,
        alias: &str,
        key: Option<&str>,
        api_url: Option<&str>,
    ) -> OpenAiCompatibleModelProvider { ... }
    fn build_compat(
        &self,
        alias: &str,
        key: Option<&str>,
        api_url: Option<&str>,
    ) -> OpenAiCompatibleModelProvider { ... }
}
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::new constructor is used.

Required Associated Constants§

Source

const DISPLAY: &'static str

Source

const DEFAULT_URL: &'static str

Source

const AUTH: AuthStyle

Provided Associated Constants§

Source

const MODELS_DEV_KEY: Option<&'static str> = None

models.dev catalog key for this provider, when present in the public catalog. Lets list_models() pre-populate the model picker without a credential — the gateway and TUI both surface the cataloged IDs even before the operator pastes their API key. Set to None for providers that don’t have a models.dev entry; their picker stays empty until a credential unlocks the live /models endpoint, which the dashboard already falls back to a free-text input for.

Source

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

Provided Methods§

Source

fn build_compat_base( &self, alias: &str, key: Option<&str>, api_url: Option<&str>, ) -> OpenAiCompatibleModelProvider

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.

Source

fn build_compat( &self, alias: &str, key: Option<&str>, api_url: Option<&str>, ) -> OpenAiCompatibleModelProvider

Build the underlying compat provider. Default just returns the base from build_compat_base; override to chain family-specific modifiers (e.g. .without_native_tools(), .with_merge_system_into_user()).

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.

Implementors§

Source§

impl CompatFamilySpec for AtomicChatModelProviderConfig

Source§

const DISPLAY: &'static str = "Atomic Chat"

Source§

const DEFAULT_URL: &'static str = "http://127.0.0.1:1337/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for Ai21ModelProviderConfig

Source§

const DISPLAY: &'static str = "AI21 Labs"

Source§

const DEFAULT_URL: &'static str = "https://api.ai21.com/studio/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const OPENROUTER_VENDOR_PREFIX: Option<&'static str>

Source§

impl CompatFamilySpec for AihubmixModelProviderConfig

Source§

const DISPLAY: &'static str = "AiHubMix"

Source§

const DEFAULT_URL: &'static str = "https://aihubmix.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for AnyscaleModelProviderConfig

Source§

const DISPLAY: &'static str = "Anyscale"

Source§

const DEFAULT_URL: &'static str = "https://api.endpoints.anyscale.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for AstraiModelProviderConfig

Source§

const DISPLAY: &'static str = "Astrai"

Source§

const DEFAULT_URL: &'static str = "https://as-trai.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for AvianModelProviderConfig

Source§

const DISPLAY: &'static str = "Avian"

Source§

const DEFAULT_URL: &'static str = "https://api.avian.io/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for BaichuanModelProviderConfig

Source§

const DISPLAY: &'static str = "Baichuan"

Source§

const DEFAULT_URL: &'static str = "https://api.baichuan-ai.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for BasetenModelProviderConfig

Source§

const DISPLAY: &'static str = "Baseten"

Source§

const DEFAULT_URL: &'static str = "https://inference.baseten.co/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for CerebrasModelProviderConfig

Source§

const DISPLAY: &'static str = "Cerebras"

Source§

const DEFAULT_URL: &'static str = "https://api.cerebras.ai/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for CloudflareModelProviderConfig

Source§

const DISPLAY: &'static str = "Cloudflare AI Gateway"

Source§

const DEFAULT_URL: &'static str = "https://gateway.ai.cloudflare.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for CohereModelProviderConfig

Source§

const DISPLAY: &'static str = "Cohere"

Source§

const DEFAULT_URL: &'static str = "https://api.cohere.com/compatibility"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for DeepinfraModelProviderConfig

Source§

const DISPLAY: &'static str = "DeepInfra"

Source§

const DEFAULT_URL: &'static str = "https://api.deepinfra.com/v1/openai"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for DeepmystModelProviderConfig

Source§

const DISPLAY: &'static str = "DeepMyst"

Source§

const DEFAULT_URL: &'static str = "https://api.deepmyst.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for DeepseekModelProviderConfig

Source§

const DISPLAY: &'static str = "DeepSeek"

Source§

const DEFAULT_URL: &'static str = "https://api.deepseek.com"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for DoubaoModelProviderConfig

Source§

const DISPLAY: &'static str = "Doubao"

Source§

const DEFAULT_URL: &'static str = "https://ark.cn-beijing.volces.com/api/v3"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const OPENROUTER_VENDOR_PREFIX: Option<&'static str>

Source§

impl CompatFamilySpec for FireworksModelProviderConfig

Source§

const DISPLAY: &'static str = "Fireworks AI"

Source§

const DEFAULT_URL: &'static str = "https://api.fireworks.ai/inference/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for FriendliModelProviderConfig

Source§

const DISPLAY: &'static str = "Friendli AI"

Source§

const DEFAULT_URL: &'static str = "https://api.friendli.ai/serverless/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for GlmModelProviderConfig

Source§

const DISPLAY: &'static str = "GLM"

Source§

const DEFAULT_URL: &'static str = crate::GLM_GLOBAL_BASE_URL

Source§

const AUTH: AuthStyle = AuthStyle::ZhipuJwt

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for HuggingfaceModelProviderConfig

Source§

const DISPLAY: &'static str = "Hugging Face"

Source§

const DEFAULT_URL: &'static str = "https://router.huggingface.co/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for HunyuanModelProviderConfig

Source§

const DISPLAY: &'static str = "Tencent Hunyuan"

Source§

const DEFAULT_URL: &'static str = "https://api.hunyuan.cloud.tencent.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const OPENROUTER_VENDOR_PREFIX: Option<&'static str>

Source§

impl CompatFamilySpec for HyperbolicModelProviderConfig

Source§

const DISPLAY: &'static str = "Hyperbolic"

Source§

const DEFAULT_URL: &'static str = "https://api.hyperbolic.xyz/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for LeptonModelProviderConfig

Source§

const DISPLAY: &'static str = "Lepton AI"

Source§

const DEFAULT_URL: &'static str = "https://llama3-1-405b.lepton.run/api/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for LitellmModelProviderConfig

Source§

const DISPLAY: &'static str = "LiteLLM"

Source§

const DEFAULT_URL: &'static str = "http://localhost:4000/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for MistralModelProviderConfig

Source§

const DISPLAY: &'static str = "Mistral"

Source§

const DEFAULT_URL: &'static str = "https://api.mistral.ai/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for MoonshotModelProviderConfig

Source§

const DISPLAY: &'static str = "Moonshot"

Source§

const DEFAULT_URL: &'static str = crate::MOONSHOT_INTL_BASE_URL

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for NebiusModelProviderConfig

Source§

const DISPLAY: &'static str = "Nebius AI Studio"

Source§

const DEFAULT_URL: &'static str = "https://api.studio.nebius.ai/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for NovitaModelProviderConfig

Source§

const DISPLAY: &'static str = "Novita AI"

Source§

const DEFAULT_URL: &'static str = "https://api.novita.ai/openai"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for NscaleModelProviderConfig

Source§

const DISPLAY: &'static str = "Nscale"

Source§

const DEFAULT_URL: &'static str = "https://inference.api.nscale.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for NvidiaModelProviderConfig

Source§

const DISPLAY: &'static str = "NVIDIA NIM"

Source§

const DEFAULT_URL: &'static str = "https://integrate.api.nvidia.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

const OPENROUTER_VENDOR_PREFIX: Option<&'static str>

Source§

impl CompatFamilySpec for OpencodeModelProviderConfig

Source§

const DISPLAY: &'static str = "OpenCode Zen"

Source§

const DEFAULT_URL: &'static str = "https://opencode.ai/zen/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for PerplexityModelProviderConfig

Source§

const DISPLAY: &'static str = "Perplexity"

Source§

const DEFAULT_URL: &'static str = "https://api.perplexity.ai"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for QianfanModelProviderConfig

Source§

const DISPLAY: &'static str = "Qianfan"

Source§

const DEFAULT_URL: &'static str = "https://qianfan.baidubce.com/v2"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const OPENROUTER_VENDOR_PREFIX: Option<&'static str>

Source§

impl CompatFamilySpec for RekaModelProviderConfig

Source§

const DISPLAY: &'static str = "Reka"

Source§

const DEFAULT_URL: &'static str = "https://api.reka.ai/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const OPENROUTER_VENDOR_PREFIX: Option<&'static str>

Source§

impl CompatFamilySpec for SambanovaModelProviderConfig

Source§

const DISPLAY: &'static str = "SambaNova"

Source§

const DEFAULT_URL: &'static str = "https://api.sambanova.ai/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for SglangModelProviderConfig

Source§

const DISPLAY: &'static str = "SGLang"

Source§

const DEFAULT_URL: &'static str = "http://localhost:30000/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for SiliconflowModelProviderConfig

Source§

const DISPLAY: &'static str = "SiliconFlow"

Source§

const DEFAULT_URL: &'static str = "https://api.siliconflow.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for StepfunModelProviderConfig

Source§

const DISPLAY: &'static str = "Stepfun"

Source§

const DEFAULT_URL: &'static str = "https://api.stepfun.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

const OPENROUTER_VENDOR_PREFIX: Option<&'static str>

Source§

impl CompatFamilySpec for SyntheticModelProviderConfig

Source§

const DISPLAY: &'static str = "Synthetic"

Source§

const DEFAULT_URL: &'static str = "https://api.synthetic.new/openai/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for TogetherModelProviderConfig

Source§

const DISPLAY: &'static str = "Together AI"

Source§

const DEFAULT_URL: &'static str = "https://api.together.xyz"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for VeniceModelProviderConfig

Source§

const DISPLAY: &'static str = "Venice"

Source§

const DEFAULT_URL: &'static str = "https://api.venice.ai"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for VercelModelProviderConfig

Source§

const DISPLAY: &'static str = "Vercel AI Gateway"

Source§

const DEFAULT_URL: &'static str = crate::VERCEL_AI_GATEWAY_BASE_URL

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for VllmModelProviderConfig

Source§

const DISPLAY: &'static str = "vLLM"

Source§

const DEFAULT_URL: &'static str = "http://localhost:8000/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for XaiModelProviderConfig

Source§

const DISPLAY: &'static str = "xAI"

Source§

const DEFAULT_URL: &'static str = "https://api.x.ai/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

impl CompatFamilySpec for YiModelProviderConfig

Source§

const DISPLAY: &'static str = "01.AI (Yi)"

Source§

const DEFAULT_URL: &'static str = "https://api.lingyiwanwu.com/v1"

Source§

const AUTH: AuthStyle = AuthStyle::Bearer

Source§

impl CompatFamilySpec for ZaiModelProviderConfig

Source§

const DISPLAY: &'static str = "Z.AI"

Source§

const DEFAULT_URL: &'static str = crate::ZAI_GLOBAL_BASE_URL

Source§

const AUTH: AuthStyle = AuthStyle::ZhipuJwt

Source§

const MODELS_DEV_KEY: Option<&'static str>

Source§

const OPENROUTER_VENDOR_PREFIX: Option<&'static str>