Skip to main content

infer_provider

Function infer_provider 

Source
pub fn infer_provider(
    override_provider: Option<&str>,
    model: &str,
) -> Option<Provider>
Expand description

Infer a Provider from an optional override and model string.

Attempts, in order:

  1. Parse the override if provided.
  2. Parse the model into a crate::config::models::ModelId and return its provider.
  3. Fall back to heuristic detection via LLMFactory::provider_from_model.